SciDAVis  1.D4
interfaces.h
Go to the documentation of this file.
1 /***************************************************************************
2  File : interfaces.h
3  Project : SciDAVis
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
8 
9  ***************************************************************************/
10 
11 /***************************************************************************
12  * *
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. *
17  * *
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. *
22  * *
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 *
27  * *
28  ***************************************************************************/
29 #ifndef INTERFACES_H
30 #define INTERFACES_H
31 
32 #include "lib/ConfigPageWidget.h"
33 #include "core/AbstractAspect.h"
34 #include "lib/XmlStreamReader.h"
35 
36 #include <QtPlugin>
37 
38 class AbstractPart;
39 class QAction;
40 class QMenu;
41 class ProjectWindow;
42 class AbstractFilter;
44 class AbstractExportFilter;
45 class ActionManager;
46 
48 class PartMaker
49 {
50  public:
51  virtual ~PartMaker() {}
53  virtual AbstractPart *makePart() = 0;
55 
60  virtual QAction *makeAction(QObject *parent) = 0;
61 };
62 
63 Q_DECLARE_INTERFACE(PartMaker, "net.sf.scidavis.partmaker/0.1")
64 
65 
66 
70 {
71  public:
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;
76 };
77 
78 Q_DECLARE_INTERFACE(FilterMaker, "net.sf.scidavis.filtermaker/0.1")
79 
80 
82 {
83  public:
84  virtual ~FileFormat() {}
85  virtual AbstractImportFilter * makeImportFilter() = 0;
86  virtual AbstractExportFilter * makeExportFilter() = 0;
87 };
88 
89 Q_DECLARE_INTERFACE(FileFormat, "net.sf.scidavis.fileformat/0.1")
90 
91 
93 {
94  public:
96  virtual ActionManager * actionManager() = 0;
98  virtual void initActionManager() {}
99 };
100 
101 Q_DECLARE_INTERFACE(ActionManagerOwner, "net.sf.scidavis.actionmanagerowner/0.1")
102 
103 
105  public:
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;
112 };
113 
114 Q_DECLARE_INTERFACE(ConfigPageMaker, "net.sf.scidavis.configpagemaker/0.1")
115 
116 
118 {
119  public:
122  virtual bool canCreate(const QString & element_name) = 0;
124  virtual AbstractAspect * createAspectFromXml(XmlStreamReader * reader) = 0;
125 };
126 
127 Q_DECLARE_INTERFACE(XmlElementAspectMaker, "net.sf.scidavis.xmlelementaspectmaker/0.1")
128 
129 #endif // ifndef INTERFACES_H