File indexing completed on 2024-05-19 15:01:20
0001 /*************************************************************************** 0002 File : interfaces.h 0003 Project : SciDAVis 0004 -------------------------------------------------------------------- 0005 Copyright : (C) 2008 by Knut Franke 0006 Email (use @ for *) : knut.franke*gmx.de 0007 Description : Interfaces the kernel uses to talk to modules 0008 0009 ***************************************************************************/ 0010 0011 /*************************************************************************** 0012 * * 0013 * This program is free software; you can redistribute it and/or modify * 0014 * it under the terms of the GNU General Public License as published by * 0015 * the Free Software Foundation; either version 2 of the License, or * 0016 * (at your option) any later version. * 0017 * * 0018 * This program is distributed in the hope that it will be useful, * 0019 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 0020 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 0021 * GNU General Public License for more details. * 0022 * * 0023 * You should have received a copy of the GNU General Public License * 0024 * along with this program; if not, write to the Free Software * 0025 * Foundation, Inc., 51 Franklin Street, Fifth Floor, * 0026 * Boston, MA 02110-1301 USA * 0027 * * 0028 ***************************************************************************/ 0029 #ifndef INTERFACES_H 0030 #define INTERFACES_H 0031 0032 #include "backend/core/AbstractAspect.h" 0033 #include "backend/lib/XmlStreamReader.h" 0034 0035 #include <QtPlugin> 0036 0037 class AbstractPart; 0038 class QAction; 0039 class QMenu; 0040 class ProjectWindow; 0041 class AbstractFilter; 0042 class AbstractImportFilter; 0043 class AbstractExportFilter; 0044 class ActionManager; 0045 0046 class PartMaker { 0047 public: 0048 virtual ~PartMaker() = default; 0049 virtual AbstractPart *makePart() = 0; 0050 virtual QAction *makeAction(QObject *parent) = 0; 0051 }; 0052 0053 Q_DECLARE_INTERFACE(PartMaker, "net.sf.scidavis.partmaker/0.1") 0054 0055 class FilterMaker { 0056 public: 0057 virtual ~FilterMaker() = default; 0058 virtual AbstractFilter * makeFilter(int id=0) = 0; 0059 virtual int filterCount() const { return 1; } 0060 virtual QAction *makeAction(QObject *parent, int id=0) = 0; 0061 }; 0062 0063 Q_DECLARE_INTERFACE(FilterMaker, "net.sf.scidavis.filtermaker/0.1") 0064 0065 class FileFormat { 0066 public: 0067 virtual ~FileFormat() = default; 0068 virtual AbstractImportFilter * makeImportFilter() = 0; 0069 virtual AbstractExportFilter * makeExportFilter() = 0; 0070 }; 0071 0072 Q_DECLARE_INTERFACE(FileFormat, "net.sf.scidavis.fileformat/0.1") 0073 0074 class XmlElementAspectMaker { 0075 public: 0076 virtual ~XmlElementAspectMaker() = default; 0077 virtual bool canCreate(const QString & element_name) = 0; 0078 virtual AbstractAspect * createAspectFromXml(XmlStreamReader * reader) = 0; 0079 }; 0080 0081 Q_DECLARE_INTERFACE(XmlElementAspectMaker, "net.sf.scidavis.xmlelementaspectmaker/0.1") 0082 0083 class NeedsStaticInit { 0084 public: 0085 virtual ~NeedsStaticInit() = default; 0086 virtual void staticInit() = 0; 0087 }; 0088 0089 Q_DECLARE_INTERFACE(NeedsStaticInit, "net.sf.scidavis.needsstaticinit/0.1") 0090 0091 class VersionedPlugin { 0092 public: 0093 virtual ~VersionedPlugin() = default; 0094 virtual int pluginTargetAppVersion() const = 0; 0095 virtual QString pluginTargetAppName() const = 0; 0096 virtual QString pluginName() const = 0; 0097 }; 0098 0099 Q_DECLARE_INTERFACE(VersionedPlugin, "net.sf.scidavis.versionedplugin/0.1") 0100 0101 #endif // ifndef INTERFACES_H