umbrello: umbrello/_unused/plugin.h Source File

umbrello 2.32.1 Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology

plugin.h
Go to the documentation of this file.
1 /***************************************************************************
2 plugin.h
3 -------------------
4 begin : Mon Jan 13 2003
5 copyright : (C) 2003 by Andrew Sutton
6 email : ansutton@kent.edu
7 Bugs and comments to umbrello-devel@kde.org or https://bugs.kde.org
8 ***************************************************************************/
9
10 /***************************************************************************
11 * *
12 * This program is free software; you can redistribute it and/or modify *
13 * it under the terms of the GNU General Public License as published by *
14 * the Free Software Foundation; either version 2 of the License, or *
15 * (at your option) any later version. *
16 * *
17 ***************************************************************************/
18
19 #ifndef UMBRELLO_PLUGIN_H
20 #define UMBRELLO_PLUGIN_H
21
22 // Qt includes
23 #include <qobject.h>
24
25 // KDE includes
26 #include <kgenericfactory.h>
27
28 // local includes
29 #include "configurable.h"
30
31 // forward declarations
32 class QStringList;
33 class KConfig;
34
49 #define UMBRELLO_EXPORT_PLUGIN_FACTORY(libname, factory) \
50 extern "C" { KDE_EXPORT void *init_##libname() { return new factory(#libname); } }
51
52 namespace Umbrello
53 {
54 // forward declarations
55 class PluginLoader;
56
87 class Plugin :
88 public QObject,
89 public Configurable
90 {
91 Q_OBJECT
92 friend class PluginLoader;
93 public:
95 virtual ~Plugin();
96
98 QByteArray instanceName() const;
99
101 KConfig *config();
102
104 virtual QString category();
105
111 void unload();
112
113 protected:
115 Plugin(QObject *parent, const char *name, const QStringList &args);
116
118 virtual bool onInit();
119
121 virtual bool onShutdown();
122
123 private:
132 bool init();
133
141 bool shutdown();
142
151 virtual bool configure();
152
154 void ref();
155
156 protected:
157 uint _ref;
158 QByteArray _instanceName;
159 KConfig *_config;
160 };
161 }
162
163 #endif
Umbrello::Plugin::onInit
virtual bool onInit()
Definition: plugin.cpp:122
Umbrello::Plugin::~Plugin
virtual ~Plugin()
Definition: plugin.cpp:42
Umbrello::Plugin::_instanceName
QByteArray _instanceName
Instance name of the plugin.
Definition: plugin.h:158
Umbrello::Plugin::ref
void ref()
Definition: plugin.cpp:47
Umbrello::Configurable::loadPlugins
bool loadPlugins(KConfig *config, const QString &group, const QString &key)
Definition: configurable.cpp:47
Umbrello::PluginLoader::unloadPlugin
void unloadPlugin(const QString &name)
Definition: pluginloader.cpp:137
Umbrello::Plugin::config
KConfig * config()
Definition: plugin.cpp:116
plugin.h
Umbrello
Definition: configurable.h:36
Umbrello::Plugin::unload
void unload()
Definition: plugin.cpp:53
Umbrello::Plugin::shutdown
bool shutdown()
Definition: plugin.cpp:93
Umbrello::Plugin::Plugin
Plugin(QObject *parent, const char *name, const QStringList &args)
Definition: plugin.cpp:31
Umbrello::Plugin::_config
KConfig * _config
Configuration record.
Definition: plugin.h:159
Umbrello::Plugin::configure
virtual bool configure()
Definition: plugin.cpp:134
Umbrello::Plugin::onShutdown
virtual bool onShutdown()
Definition: plugin.cpp:128
Umbrello::Configurable::unloadPlugins
bool unloadPlugins()
Definition: configurable.cpp:73
Umbrello::Plugin::category
virtual QString category()
Definition: plugin.cpp:159
Umbrello::Plugin::_ref
uint _ref
Reference counter.
Definition: plugin.h:157
Umbrello::Plugin
Definition: plugin.h:90
Umbrello::Plugin::init
bool init()
Definition: plugin.cpp:71
Umbrello::Plugin::instanceName
QByteArray instanceName() const
Definition: plugin.cpp:110
Umbrello::PluginLoader
Definition: pluginloader.h:67
configurable.h
pluginloader.h
Umbrello::Configurable
Definition: configurable.h:65
Umbrello::PluginLoader::instance
static PluginLoader * instance()
Definition: pluginloader.cpp:49