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

- Main Page
- Related Pages
- Topics
- 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
19 class QStringList;
20 class KConfig;
21
36#define UMBRELLO_EXPORT_PLUGIN_FACTORY(libname, factory) \
37 extern "C" { KDE_EXPORT void *init_##libname() { return new factory(#libname); } }
38
39 namespace Umbrello
40{
41// forward declarations
42 class PluginLoader;
43
74 class Plugin :
75 public QObject,
76 public Configurable
77{
78 Q_OBJECT
79 friend class PluginLoader;
80 public:
82 virtual ~Plugin();
83
85 QByteArray instanceName() const;
86
88 KConfig *config();
89
91 virtual QString category();
92
98 void unload();
99
100 protected:
102 Plugin(QObject *parent, const char *name, const QStringList &args);
103
105 virtual bool onInit();
106
108 virtual bool onShutdown();
109
110 private:
119 bool init();
120
128 bool shutdown();
129
138 virtual bool configure();
139
141 void ref();
142
143 protected:
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::Plugin
Plugin(QObject *parent, const char *name, const QStringList &args)
Definition plugin.cpp:19
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