Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

QgisAppInterface Class Reference

#include <qgisappinterface.h>

Inheritance diagram for QgisAppInterface:

Inheritance graph
[legend]
Collaboration diagram for QgisAppInterface:

Collaboration graph
[legend]
List of all members.

Detailed Description

Interface class to provide access to private methods in QgisApp for use by plugins.

Only those functions "exposed" by QgisInterface can be called from within a plugin.

Definition at line 33 of file qgisappinterface.h.

Public Member Functions

 QgisAppInterface (OmgMainWindow *thepOmgMainWindow)
 ~QgisAppInterface ()
void zoomFull ()
 Zoom map to full extent.
void zoomPrevious ()
 Zoom map to previous extent.
void zoomActiveLayer ()
 Zoom to active layer.
QgsVectorLayer * addVectorLayer (QString vectorLayerPath, QString baseName, QString providerKey)
 Add a vector layer.
QgsRasterLayer * addRasterLayer (QString rasterLayerPath, QString baseName)
 Add a raster layer given its file name.
QgsRasterLayer * addRasterLayer (QgsRasterLayer *theRasterLayer, bool theForceRenderFlag=false)
 Add a raster layer given a raster layer obj.
bool addProject (QString theProjectName)
 Add a project.
void newProject (bool thePromptToSaveFlag=false)
 Start a new blank project.
QgsMapLayer * activeLayer ()
 Get pointer to the active layer (layer selected in the legend).
int addToolBarIcon (QAction *qAction)
 Add an icon to the plugins toolbar.
void removeToolBarIcon (QAction *qAction)
 Remove an icon (action) from the plugin toolbar.
QToolBar * addToolBar (QString name)
 Add toolbar with specified name.
void openURL (QString url, bool useQgisDocDirectory=true)
std::map< QString, int > menuMapByName ()
std::map< int, QString > menuMapById ()
QgsMapCanvas * getMapCanvas ()
QWidgetgetMainWindow ()
void addPluginMenu (QString name, QAction *action)
void removePluginMenu (QString name, QAction *action)
virtual QToolBox * getToolBox ()
virtual void refreshLegend (QgsMapLayer *)

Private Member Functions

 QgisAppInterface (QgisAppInterface const &)
 QgisInterface aren't copied.
QgisAppInterfaceoperator= (QgisAppInterface const &)
 QgisInterface aren't copied.

Private Attributes

OmgMainWindowmpOmgMainWindow
 Pointer to the OmgMainWindow object.


Constructor & Destructor Documentation

QgisAppInterface::QgisAppInterface OmgMainWindow thepOmgMainWindow  ) 
 

Constructor.

Parameters:
qgis Pointer to the QgisApp object

Definition at line 31 of file qgisappinterface.cpp.

QgisAppInterface::~QgisAppInterface  ) 
 

Definition at line 40 of file qgisappinterface.cpp.

QgisAppInterface::QgisAppInterface QgisAppInterface const &   )  [private]
 

QgisInterface aren't copied.


Member Function Documentation

QgsMapLayer * QgisAppInterface::activeLayer  ) 
 

Get pointer to the active layer (layer selected in the legend).

Definition at line 86 of file qgisappinterface.cpp.

void QgisAppInterface::addPluginMenu QString  name,
QAction *  action
 

Add action to the plugins menu

Definition at line 91 of file qgisappinterface.cpp.

bool QgisAppInterface::addProject QString  theProjectName  ) 
 

Add a project.

Definition at line 76 of file qgisappinterface.cpp.

QgsRasterLayer * QgisAppInterface::addRasterLayer QgsRasterLayer *  theRasterLayer,
bool  theForceRenderFlag = false
 

Add a raster layer given a raster layer obj.

Definition at line 71 of file qgisappinterface.cpp.

QgsRasterLayer * QgisAppInterface::addRasterLayer QString  rasterLayerPath,
QString  baseName
 

Add a raster layer given its file name.

Definition at line 66 of file qgisappinterface.cpp.

QToolBar * QgisAppInterface::addToolBar QString  name  ) 
 

Add toolbar with specified name.

Definition at line 110 of file qgisappinterface.cpp.

int QgisAppInterface::addToolBarIcon QAction *  qAction  ) 
 

Add an icon to the plugins toolbar.

Definition at line 101 of file qgisappinterface.cpp.

QgsVectorLayer * QgisAppInterface::addVectorLayer QString  vectorLayerPath,
QString  baseName,
QString  providerKey
 

Add a vector layer.

Definition at line 59 of file qgisappinterface.cpp.

QWidget * QgisAppInterface::getMainWindow  ) 
 

Gives access to main QgisApp object

Plugins don't need to know about QgisApp, as we pass it as QWidget, it can be used for connecting slots and using as widget's parent

Definition at line 137 of file qgisappinterface.cpp.

References mpOmgMainWindow.

QgsMapCanvas * QgisAppInterface::getMapCanvas  ) 
 

Return a pointer to the map canvas used by qgisapp

Definition at line 132 of file qgisappinterface.cpp.

References mpOmgMainWindow.

QToolBox * QgisAppInterface::getToolBox  )  [virtual]
 

Return a pointer to the toolbox (where additional pages can be inserted)

Definition at line 142 of file qgisappinterface.cpp.

std::map< int, QString > QgisAppInterface::menuMapById  ) 
 

Get the menu info mapped by menu id (key is menu id, value is name)

Definition at line 126 of file qgisappinterface.cpp.

std::map< QString, int > QgisAppInterface::menuMapByName  ) 
 

Get the menu info mapped by menu name (key is name, value is menu id)

Definition at line 119 of file qgisappinterface.cpp.

void QgisAppInterface::newProject bool  thePromptToSaveFlag = false  ) 
 

Start a new blank project.

Definition at line 81 of file qgisappinterface.cpp.

void QgisAppInterface::openURL QString  url,
bool  useQgisDocDirectory = true
 

Open a url in the users browser. By default the QGIS doc directory is used as the base for the URL. To open a URL that is not relative to the installed QGIS documentation, set useQgisDocDirectory to false.

Parameters:
url URL to open
useQgisDocDirectory If true, the URL will be formed by concatenating url to the QGIS documentation directory path (<prefix>/share/doc)

Definition at line 114 of file qgisappinterface.cpp.

QgisAppInterface& QgisAppInterface::operator= QgisAppInterface const &   )  [private]
 

QgisInterface aren't copied.

virtual void QgisAppInterface::refreshLegend QgsMapLayer *   )  [inline, virtual]
 

Definition at line 107 of file qgisappinterface.h.

void QgisAppInterface::removePluginMenu QString  name,
QAction *  action
 

Remove action from the plugins menu

Definition at line 96 of file qgisappinterface.cpp.

void QgisAppInterface::removeToolBarIcon QAction *  qAction  ) 
 

Remove an icon (action) from the plugin toolbar.

Definition at line 106 of file qgisappinterface.cpp.

void QgisAppInterface::zoomActiveLayer  ) 
 

Zoom to active layer.

Definition at line 54 of file qgisappinterface.cpp.

void QgisAppInterface::zoomFull  ) 
 

Zoom map to full extent.

Definition at line 44 of file qgisappinterface.cpp.

void QgisAppInterface::zoomPrevious  ) 
 

Zoom map to previous extent.

Definition at line 49 of file qgisappinterface.cpp.


Member Data Documentation

OmgMainWindow* QgisAppInterface::mpOmgMainWindow [private]
 

Pointer to the OmgMainWindow object.

Definition at line 118 of file qgisappinterface.h.

Referenced by getMainWindow(), and getMapCanvas().


The documentation for this class was generated from the following files:
Generated on Mon Apr 28 15:14:18 2008 for openModellerDesktop by  doxygen 1.4.1-20050210