Go to the documentation of this file.00001 #ifndef PJ_PLUGIN_H
00002 #define PJ_PLUGIN_H
00003
00004 #include <QtPlugin>
00005 #include <QMenu>
00006 #include <QWidget>
00007 #include <QDomDocument>
00008
00009 class PlotJugglerPlugin: public QObject
00010 {
00011
00012 public:
00013 PlotJugglerPlugin() {}
00014
00015 virtual const char* name() const = 0;
00016
00017 virtual bool isDebugPlugin() { return false; }
00018
00019 virtual QWidget* optionsWidget() { return nullptr; }
00020
00021 virtual bool xmlSaveState(QDomDocument &doc, QDomElement &parent_element) const
00022 {
00023 return false;
00024 }
00025
00026 virtual bool xmlLoadState(const QDomElement &parent_element )
00027 {
00028 return false;
00029 }
00030
00031 QDomElement xmlSaveState(QDomDocument &doc) const
00032 {
00033 QDomElement plugin_elem = doc.createElement("plugin");
00034 plugin_elem.setAttribute("ID", QString(this->name()).replace(" ", "_") );
00035 xmlSaveState(doc, plugin_elem);
00036 return plugin_elem;
00037 }
00038
00039 virtual void addActionsToParentMenu( QMenu* menu ) {}
00040
00041 private:
00042
00043 };
00044
00045 #endif // PJ_PLUGIN_H