From e9ae80694875f869892f13f4fcaf1170a00dea41 Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdewebdev@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- quanta/plugins/quantaplugininterface.h | 103 +++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 quanta/plugins/quantaplugininterface.h (limited to 'quanta/plugins/quantaplugininterface.h') diff --git a/quanta/plugins/quantaplugininterface.h b/quanta/plugins/quantaplugininterface.h new file mode 100644 index 00000000..a3e85030 --- /dev/null +++ b/quanta/plugins/quantaplugininterface.h @@ -0,0 +1,103 @@ +/*************************************************************************** + quantaplugininterface.h - description + ------------------- + begin : Mon Sep 16 2002 + copyright : (C) 2002 by Marc Britton + (C) 2003 by Andras Mantia + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef QUANTAPLUGININTERFACE_H +#define QUANTAPLUGININTERFACE_H + +/* KDE INCLUDES */ +#include +#include + +/* QT INCLUDES */ +#include +#include +#include +#include + +/* OTHER INCLUDES */ + +class QuantaPlugin; + +/**Provides an interface to the installed plugins + *@author Marc Britton + */ +class QuantaPluginInterface : public QObject +{ + Q_OBJECT +public: + /** + * since this class is a singleton you must use this function to access it + * + * the parameters are only used at the first call to create the class + * + */ + static QuantaPluginInterface* const ref(QWidget *parent = 0L) + { + static QuantaPluginInterface *m_ref; + if (!m_ref) m_ref = new QuantaPluginInterface (parent); + return m_ref; + } + + ~QuantaPluginInterface(); + /** Reads the rc file */ + virtual void readConfig(); + /** Write the rc file */ + virtual void writeConfig(); + /* Returns TRUE if the plugin specified by a_name is available for us*/ + bool pluginAvailable(const QString &); + /** Gets the plugins */ + QDict plugins() {return m_plugins;}; + /** Sets the plugins */ + void setPlugins(QDict plugins) {m_plugins = plugins;}; + /** Gets the plugin specified by a_name */ + virtual QuantaPlugin *plugin(const QString &); + /** Gets the plugin menu */ + virtual QPopupMenu *pluginMenu() {return m_pluginMenu;}; + void setPluginMenu(QPopupMenu *pluginMenu) {m_pluginMenu = pluginMenu;} + /** Builds the plugins menu dynamically */ + void buildPluginMenu(); + +private: + /** The constructor is privat because we use singleton patter. + * If you need the class use QuantaPluginInterface::ref() for + * construction and reference + */ + QuantaPluginInterface(QWidget *parent); + +protected slots: + /** slot for the menu: validate */ + void slotPluginsValidate(); + /** slot for the menu: edit */ + void slotPluginsEdit(); + +protected: + /** Gets the plugin names */ + virtual QStringList pluginNames() const; + void readConfigFile(const QString& configFile); + + QDict m_plugins; + + QWidget *m_parent; + + QPopupMenu *m_pluginMenu; + +signals: + void hideSplash(); + void statusMsg(const QString &); +}; + +#endif -- cgit v1.2.1