GeopsyGui/GeopsyGuiInterface.h
Go to the documentation of this file.
00001 /***************************************************************************
00002 **
00003 **  This file is part of GeopsyGui.
00004 **
00005 **  This library is free software; you can redistribute it and/or
00006 **  modify it under the terms of the GNU Lesser General Public
00007 **  License as published by the Free Software Foundation; either
00008 **  version 2.1 of the License, or (at your option) any later version.
00009 **
00010 **  This file is distributed in the hope that it will be useful, but WITHOUT
00011 **  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00012 **  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
00013 **  License for more details.
00014 **
00015 **  You should have received a copy of the GNU Lesser General Public
00016 **  License along with this library; if not, write to the Free Software
00017 **  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00018 **
00019 **  See http://www.geopsy.org for more information.
00020 **
00021 **  Created : 2005-11-05
00022 **  Authors :
00023 **    Marc Wathelet
00024 **    Marc Wathelet (LGIT, Grenoble, France)
00025 **
00026 ***************************************************************************/
00027 
00028 #ifndef GEOPSYGUIINTERFACE_H
00029 #define GEOPSYGUIINTERFACE_H
00030 
00031 #include <QtGui>
00032 #include <GeopsyCore.h>
00033 
00034 #include "GeopsyGuiDLLExport.h"
00035 #include "GeopsyGuiVersion.h"
00036 #include "GeopsyGuiInstallPath.h"
00037 
00038 namespace GeopsyGui {
00039 
00040 class ToolBase;
00041 
00042 class GEOPSYGUI_EXPORT GeopsyGuiInterface : public GeopsyCoreInterface
00043 {
00044   Q_OBJECT
00045 public:
00046   virtual void createToolActions(QObject * toolFactory)=0;
00047   virtual QList<QAction *> createImportActions(QObject * /* parent */) const {return QList<QAction *>();}
00048   virtual ToolBase * createTool(int id, QWidget * wsParent) const=0;
00049 
00050   virtual void addPreferenceTab(QTabWidget * parent);
00051   virtual void setPreferences();
00052 
00053   virtual int exec(SubSignalPool * subPool, int slot, int argc, char ** argv);
00054   virtual void setHelp(ApplicationHelp * h);
00055 
00056   int slotCount() const {return _actions.count();}
00057   int slotOf(QAction * a) {return _actions.indexOf(a);}
00058   QAction * action(int slot) const {return _actions[slot];}
00059   QString slotText(int id) {return _actions[id]->text();}
00060   void addActions(QWidget * w) const;
00061 protected:
00062   void addAction(QAction * a) {_actions << a;}
00063 private:
00064   QVector<QAction *> _actions;
00065 };
00066 
00067 } // namespace GeopsyGui
00068 
00069 #endif // GEOPSYGUIINTERFACE_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines