umbrello: umbrello/_unused/plugin.h Source File

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

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

plugin.h
Go to the documentation of this file.
1/*
2 SPDX-FileCopyrightText: 2003 Andrew Sutton <ansutton@kent.edu>
3 Bugs and comments to umbrello-devel@kde.org or https://bugs.kde.org
4*/
5
6#ifndef UMBRELLO_PLUGIN_H
7#define UMBRELLO_PLUGIN_H
8
9// Qt includes
10#include <qobject.h>
11
12// KDE includes
13#include <kgenericfactory.h>
14
15// local includes
16#include "configurable.h"
17
18// forward declarations
19class QStringList;
20class KConfig;
21
36#define UMBRELLO_EXPORT_PLUGIN_FACTORY(libname, factory) \
37 extern "C" { KDE_EXPORT void *init_##libname() { return new factory(#libname); } }
38
39namespace Umbrello
40{
41// forward declarations
42class PluginLoader;
43
74 class Plugin :
75 public QObject,
76 public Configurable
77{
78 Q_OBJECT
79 friend class PluginLoader;
80public:
82 virtual ~Plugin();
83
85 QByteArray instanceName() const;
86
88 KConfig *config();
89
91 virtual QString category();
92
98 void unload();
99
100protected:
102 Plugin(QObject *parent, const char *name, const QStringList &args);
103
105 virtual bool onInit();
106
108 virtual bool onShutdown();
109
110private:
119 bool init();
120
128 bool shutdown();
129
138 virtual bool configure();
139
141 void ref();
142
143protected:
144 uint _ref;
145 QByteArray _instanceName;
146 KConfig *_config;
147};
148}
149
150#endif
Umbrello::Configurable
Definition: configurable.h:53
Umbrello::PluginLoader
Definition: pluginloader.h:54
Umbrello::Plugin
Definition: plugin.h:77
Umbrello::Plugin::onInit
virtual bool onInit()
Definition: plugin.cpp:110
Umbrello::Plugin::_instanceName
QByteArray _instanceName
Instance name of the plugin.
Definition: plugin.h:145
Umbrello::Plugin::onShutdown
virtual bool onShutdown()
Definition: plugin.cpp:116
Umbrello::Plugin::shutdown
bool shutdown()
Definition: plugin.cpp:81
Umbrello::Plugin::category
virtual QString category()
Definition: plugin.cpp:147
Umbrello::Plugin::_config
KConfig * _config
Configuration record.
Definition: plugin.h:146
Umbrello::Plugin::configure
virtual bool configure()
Definition: plugin.cpp:122
Umbrello::Plugin::instanceName
QByteArray instanceName() const
Definition: plugin.cpp:98
Umbrello::Plugin::config
KConfig * config()
Definition: plugin.cpp:104
Umbrello::Plugin::ref
void ref()
Definition: plugin.cpp:35
Umbrello::Plugin::init
bool init()
Definition: plugin.cpp:59
Umbrello::Plugin::~Plugin
virtual ~Plugin()
Definition: plugin.cpp:30
Umbrello::Plugin::_ref
uint _ref
Reference counter.
Definition: plugin.h:144
Umbrello::Plugin::unload
void unload()
Definition: plugin.cpp:41
configurable.h
Umbrello
Definition: configurable.h:24