1 /***************************************************************************
2 * This file is part of KWorship. *
3 * Copyright 2008 James Hogan <james@albanarts.com> *
5 * KWorship is free software: you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation, either version 2 of the License, or *
8 * (at your option) any later version. *
10 * KWorship is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with KWorship. If not, write to the Free Software Foundation, *
17 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
18 ***************************************************************************/
25 * @brief An abstract KWorship plugin.
26 * @author James Hogan <james@albanarts.com>
29 #include <kdemacros.h>
34 class KwPluginManager
;
38 /// An abstract KWorship plugin.
39 class KDE_EXPORT KwPlugin
: public QObject
46 * Constructors + destructor
49 /** Primary constructor.
50 * @param id Short unique untranslated id.
51 * @param name Translated name of plugin.
52 * @param description Translated description of plugin.
54 KwPlugin(const QString
& id
, const QString
& name
, const QString
& description
);
60 * Basic information accessors
64 const QString
& id() const;
67 const QString
& name() const;
69 /// Get the description.
70 const QString
& description() const;
72 /// Get whether the plugin is loaded.
73 bool isLoaded() const;
76 * Loading and unloading
80 * This should only be called by the manager class itself.
81 * @pre Manager must not have already been set.
82 * @param manager New manager object.
84 void setManager(KwPluginManager
* manager
);
87 * @pre Manager must have been set.
91 /// Unload the plugin.
97 * Loading and unloading virtual interface
103 virtual void _load() = 0;
105 /** Unload the plugin.
108 virtual void _unload() = 0;
116 /// Short unique untranslated id.
122 /// Translated description.
123 QString m_description
;
129 /// The current plugin manager.
130 KwPluginManager
* m_manager
;
132 /// Whether the plugin is loaded.
137 #endif // _KwPlugin_h_