00001 /*************************************************************************** 00002 ** 00003 ** This file is part of DinverCore. 00004 ** 00005 ** This file may be distributed and/or modified under the terms of the 00006 ** GNU General Public License version 2 or 3 as published by the Free 00007 ** Software Foundation and appearing in the file LICENSE.GPL included 00008 ** in the packaging of this file. 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 General Public License for 00013 ** more details. 00014 ** 00015 ** You should have received a copy of the GNU General Public License 00016 ** along with this program. If not, see <http://www.gnu.org/licenses/>. 00017 ** 00018 ** See http://www.geopsy.org for more information. 00019 ** 00020 ** Created : 2005-11-05 00021 ** Authors: 00022 ** Marc Wathelet 00023 ** Marc Wathelet (LGIT, Grenoble, France) 00024 ** 00025 ***************************************************************************/ 00026 00027 #ifndef DINVERCOREOBJECT_H 00028 #define DINVERCOREOBJECT_H 00029 00030 #include <QGpCoreTools.h> 00031 00032 #include "DinverCoreDLLExport.h" 00033 00034 namespace DinverCore { 00035 00036 class DinverInterface; 00037 00038 class DINVERCORE_EXPORT DinverCoreObject : public GlobalObject 00039 { 00040 TRANSLATIONS("DinverCoreObject") 00041 public: 00042 DinverCoreObject(); 00043 virtual ~DinverCoreObject(); 00044 00045 virtual void addWindow(QWidget * w); 00046 virtual void showWindow(QWidget * w); 00047 virtual void removeWindow(QWidget * w); 00048 virtual QStringList selectedReports(const QString& title) const; 00049 00050 virtual bool useProgress() {return false;} 00051 virtual void setProgressMaximum(int) {} 00052 virtual int progressMaximum() {return 0;} 00053 virtual void setProgressValue(int) {} 00054 virtual AbstractProgress * progress() {return 0;} 00055 virtual void showMessage(QString) {} 00056 00057 bool isModified() const {return _modified;} 00058 void setModified(bool m) {_modified=m;} 00059 00060 bool setPlugin(QString pluginFile, bool debug); 00061 DinverInterface * plugin() const {return _plugin;} 00062 00063 static DinverInterface * loadPlugin(QString pluginFile, bool debug); 00064 static void printPluginList(); 00065 static QStringList defaultPluginPaths(); 00066 static QString pluginFile(QString tag, bool debug); 00067 private: 00068 bool _modified; 00069 DinverInterface * _plugin; 00070 }; 00071 00072 DINVERCORE_EXPORT extern DinverCoreObject * dinverCore; 00073 00074 } // namespace Dinvercore 00075 00076 #endif // DINVERCOREOBJECT_H