1
/***************************************************************************
4
--------------------------------------------------------------------
5
Copyright : (C) 2008-2009 by Knut Franke
6
Email (use @ for *) : knut.franke*gmx.de
7
Description : Interfaces the kernel uses to talk to modules
9
***************************************************************************/
11
/***************************************************************************
13
* This program is free software; you can redistribute it and/or modify *
14
* it under the terms of the GNU General Public License as published by *
15
* the Free Software Foundation; either version 2 of the License, or *
16
* (at your option) any later version. *
18
* This program is distributed in the hope that it will be useful, *
19
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
20
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
21
* GNU General Public License for more details. *
23
* You should have received a copy of the GNU General Public License *
24
* along with this program; if not, write to the Free Software *
25
* Foundation, Inc., 51 Franklin Street, Fifth Floor, *
26
* Boston, MA 02110-1301 USA *
28
***************************************************************************/
32
#include "lib/ConfigPageWidget.h"
33
#include "core/AbstractAspect.h"
34
#include "lib/XmlStreamReader.h"
43
class AbstractImportFilter;
44
class AbstractExportFilter;
47
//! Factory for AbstractPart objects.
51
virtual ~PartMaker() {}
52
//! The factory method.
53
virtual AbstractPart *makePart() = 0;
54
//! The action to be used for making new parts.
56
* The caller takes care of connecting the action. If the parent argument is zero, it
57
* also recieves ownership of the action.
58
* Implementations should only set things like name and icon.
60
virtual QAction *makeAction(QObject *parent) = 0;
63
Q_DECLARE_INTERFACE(PartMaker, "net.sf.scidavis.partmaker/0.1")
65
//! Factory for filters.
67
* A FilterMaker introduces one or more filters to the kernel.
72
virtual ~FilterMaker() {}
73
virtual AbstractFilter * makeFilter(int id=0) = 0;
74
virtual int filterCount() const { return 1; }
75
virtual QAction *makeAction(QObject *parent, int id=0) = 0;
78
Q_DECLARE_INTERFACE(FilterMaker, "net.sf.scidavis.filtermaker/0.1")
80
//! Factory for import/export filters.
84
virtual ~FileFormat() {}
85
virtual AbstractImportFilter * makeImportFilter() = 0;
86
virtual AbstractExportFilter * makeExportFilter() = 0;
89
Q_DECLARE_INTERFACE(FileFormat, "net.sf.scidavis.fileformat/0.1")
91
//! A module (typically a PartMaker) that has an ActionManager
92
class ActionManagerOwner
95
//! Return the action manager of the module
96
virtual ActionManager * actionManager() = 0;
97
//! Method that contains initialization that has to be done after loading the plugin
98
virtual void initActionManager() {}
101
Q_DECLARE_INTERFACE(ActionManagerOwner, "net.sf.scidavis.actionmanagerowner/0.1")
103
//! A module with application-wide settings
104
class ConfigPageMaker {
106
virtual ConfigPageWidget * makeConfigPage() = 0;
107
virtual QString configPageLabel() = 0;
108
virtual void loadSettings() = 0;
109
virtual void saveSettings() = 0;
110
// TODO (maybe): icons instead of tabs to select the pages
111
// virtual QIcon icon() = 0;
114
Q_DECLARE_INTERFACE(ConfigPageMaker, "net.sf.scidavis.configpagemaker/0.1")
116
//! Factory that creates an aspect out of an XML element.
117
class XmlElementAspectMaker
120
virtual ~XmlElementAspectMaker() {}
121
//! Determine whether the loader can handle the given element.
122
virtual bool canCreate(const QString & element_name) = 0;
123
//! The factory method.
124
virtual AbstractAspect * createAspectFromXml(XmlStreamReader * reader) = 0;
127
Q_DECLARE_INTERFACE(XmlElementAspectMaker, "net.sf.scidavis.xmlelementaspectmaker/0.1")
129
#endif // ifndef INTERFACES_H