00001 /*************************************************************************** 00002 qgisappinterface.h 00003 Interface class for exposing functions in QgisApp for use by plugins 00004 ------------------- 00005 begin : 2004-02-11 00006 copyright : (C) 2004 by Gary E.Sherman 00007 email : sherman at mrcc.com 00008 ***************************************************************************/ 00009 00010 /*************************************************************************** 00011 * * 00012 * This program is free software; you can redistribute it and/or modify * 00013 * it under the terms of the GNU General Public License as published by * 00014 * the Free Software Foundation; either version 2 of the License, or * 00015 * (at your option) any later version. * 00016 * * 00017 ***************************************************************************/ 00018 /* $Id: qgisappinterface.h 7114 2007-07-30 07:58:57Z mhugent $ */ 00019 #ifndef QGISIFACE_H 00020 #define QGISIFACE_H 00021 00022 #include "qgisinterface.h" 00023 00024 class OmgMainWindow; 00025 00033 class QgisAppInterface : public QgisInterface 00034 { 00035 Q_OBJECT; 00036 00037 public: 00042 QgisAppInterface ( OmgMainWindow * thepOmgMainWindow ); 00043 ~QgisAppInterface(); 00044 00045 /* Exposed functions */ 00047 void zoomFull(); 00049 void zoomPrevious(); 00051 void zoomActiveLayer(); 00052 00054 QgsVectorLayer * addVectorLayer ( QString vectorLayerPath, QString baseName, QString providerKey ); 00056 QgsRasterLayer * addRasterLayer ( QString rasterLayerPath, QString baseName ); 00058 QgsRasterLayer * addRasterLayer ( QgsRasterLayer * theRasterLayer, bool theForceRenderFlag = false ); 00059 00061 bool addProject ( QString theProjectName ); 00063 void newProject ( bool thePromptToSaveFlag = false ); 00064 00066 QgsMapLayer *activeLayer(); 00067 00069 int addToolBarIcon ( QAction *qAction ); 00071 void removeToolBarIcon ( QAction *qAction ); 00073 QToolBar* addToolBar ( QString name ); 00074 00082 void openURL ( QString url, bool useQgisDocDirectory = true ); 00083 00085 std::map<QString, int> menuMapByName(); 00087 std::map<int, QString> menuMapById(); 00088 00090 QgsMapCanvas * getMapCanvas(); 00091 00097 QWidget * getMainWindow(); 00098 00100 void addPluginMenu ( QString name, QAction* action ); 00102 void removePluginMenu ( QString name, QAction* action ); 00103 00105 virtual QToolBox* getToolBox(); 00106 00107 virtual void refreshLegend ( QgsMapLayer* ) {}; 00108 00109 private: 00110 00112 QgisAppInterface ( QgisAppInterface const & ); 00113 00115 QgisAppInterface & operator= ( QgisAppInterface const & ); 00116 00118 OmgMainWindow * mpOmgMainWindow; 00119 }; 00120 00121 00122 #endif //#define QGISAPPINTERFACE_H