2009-02-01 11:37:07 -05:00
|
|
|
#ifndef _PLUGIN_INTERFACE_H_
|
|
|
|
#define _PLUGIN_INTERFACE_H_
|
|
|
|
|
|
|
|
#include <QtPlugin>
|
|
|
|
|
2009-07-30 17:48:54 -04:00
|
|
|
#include <QString>
|
|
|
|
/***
|
2009-02-01 11:37:07 -05:00
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
class QString;
|
|
|
|
class QWidget;
|
|
|
|
QT_END_NAMESPACE
|
2009-07-30 17:48:54 -04:00
|
|
|
***/
|
2009-02-01 11:37:07 -05:00
|
|
|
|
2009-02-09 16:01:41 -05:00
|
|
|
//! a base class for plugins
|
|
|
|
|
|
|
|
//! All plugin classes must inherite this class and QObject.
|
2009-02-01 11:37:07 -05:00
|
|
|
class PluginInterface
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual ~PluginInterface() {}
|
|
|
|
|
|
|
|
public slots:
|
2009-02-09 16:01:41 -05:00
|
|
|
//! A description of the plugin
|
|
|
|
|
|
|
|
//! A description of the plugin. Is not used in current version.
|
2009-02-01 11:37:07 -05:00
|
|
|
virtual QString pluginDescription() const = 0;
|
2009-02-09 16:01:41 -05:00
|
|
|
|
|
|
|
//! The plugin's name
|
|
|
|
|
|
|
|
//! A name serves like an unique ID. The name is used in all operations
|
|
|
|
//! such as installing, removing, receiving a widget
|
2009-02-01 11:37:07 -05:00
|
|
|
virtual QString pluginName() const = 0;
|
|
|
|
|
2009-02-09 16:01:41 -05:00
|
|
|
//! plugin's widget.
|
|
|
|
|
|
|
|
//! Returns the widget, which is actually a plugin. Main application must
|
|
|
|
//! delete the widget; usually, a parent widget does it. If you want to use
|
|
|
|
//! the widget as top-level (i.e. parent==0), please, set
|
|
|
|
//! Qt::WA_DeleteOnClose flag .
|
2009-02-01 11:37:07 -05:00
|
|
|
virtual QWidget* pluginWidget(QWidget * parent = 0) = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
|
|
|
Q_DECLARE_INTERFACE(PluginInterface,
|
|
|
|
"com.beardog.retroshare.PluginInterface/1.0")
|
|
|
|
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|