Quantum GIS API Documentation

This documentation is taken from CVS and is certain to be incomplete at any given time


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

QgisIface Class Reference

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

#include <qgisiface.h>

Inheritance diagram for QgisIface:

Inheritance graph
[legend]
Collaboration diagram for QgisIface:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 QgisIface (QgisApp *qgis=0, const char *name=0)
 ~QgisIface ()
void zoomFull ()
 Zoom map to full extent.
void zoomPrevious ()
 Zoom map to previous extent.
void zoomActiveLayer ()
 Zoom to active layer.
bool addVectorLayer (QString vectorLayerPath, QString baseName, QString providerKey)
 Add a vector layer.
bool addRasterLayer (QString rasterLayerPath)
 Add a raster layer given its file name.
bool 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.
QgsMapLayeractiveLayer ()
 Get pointer to the active layer (layer selected in the legend).
QString activeLayerSource ()
 Get source of the active layer.
int addMenu (QString menuText, QPopupMenu *menu)
 Add a menu to the main menu bar of the application, positioned to the left of Help.
QPopupMenu * getPluginMenu (QString menuName)
void removePluginMenuItem (QString name, int menuId)
int addToolBarIcon (QAction *qAction)
 Add an icon to the plugins toolbar.
void removeToolBarIcon (QAction *qAction)
 Remove an icon (action) from the plugin toolbar.
void openURL (QString url, bool useQgisDocDirectory=true)
std::map< QString, int > menuMapByName ()
std::map< int, QString > menuMapById ()
QgsMapCanvasgetMapCanvas ()
QgsMapLayerRegistrygetLayerRegistry ()
QgisAppapp ()

Private Member Functions

 QgisIface (QgisIface const &)
 QgisIface aren't copied.
QgisIfaceoperator= (QgisIface const &)
 QgisIface aren't copied.

Private Attributes

QgisAppqgis
 Pointer to the QgisApp object.

Detailed Description

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

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

Definition at line 32 of file qgisiface.h.


Constructor & Destructor Documentation

QgisIface::QgisIface QgisApp qgis = 0,
const char *  name = 0
 

Constructor.

Parameters:
qgis Pointer to the QgisApp object

QgisIface::~QgisIface  ) 
 

QgisIface::QgisIface QgisIface const &   )  [private]
 

QgisIface aren't copied.


Member Function Documentation

QgsMapLayer* QgisIface::activeLayer  )  [virtual]
 

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

Implements QgisInterface.

QString QgisIface::activeLayerSource  ) 
 

Get source of the active layer.

int QgisIface::addMenu QString  menuText,
QPopupMenu *  menu
[virtual]
 

Add a menu to the main menu bar of the application, positioned to the left of Help.

Implements QgisInterface.

bool QgisIface::addProject QString  theProjectName  )  [virtual]
 

Add a project.

Implements QgisInterface.

bool QgisIface::addRasterLayer QgsRasterLayer theRasterLayer,
bool  theForceRenderFlag = false
[virtual]
 

Add a raster layer given a raster layer obj.

Implements QgisInterface.

bool QgisIface::addRasterLayer QString  rasterLayerPath  )  [virtual]
 

Add a raster layer given its file name.

Implements QgisInterface.

int QgisIface::addToolBarIcon QAction *  qAction  )  [virtual]
 

Add an icon to the plugins toolbar.

Implements QgisInterface.

bool QgisIface::addVectorLayer QString  vectorLayerPath,
QString  baseName,
QString  providerKey
[virtual]
 

Add a vector layer.

Implements QgisInterface.

QgisApp* QgisIface::app  ) 
 

Gives access to main QgisApp object

Even though this class is supposed to act as a Facade for the QgisApp, the plug-ins need direct access to the application object for their connect() calls.

Todo:
XXX this may call into question the current need for this interface? Maybe these connect() calls can be done in some other less intrusive way?

QgsMapLayerRegistry* QgisIface::getLayerRegistry  )  [virtual]
 

Return a pointer to the map layer registry

Implements QgisInterface.

QgsMapCanvas* QgisIface::getMapCanvas  )  [virtual]
 

Return a pointer to the map canvas used by qgisapp

Implements QgisInterface.

QPopupMenu* QgisIface::getPluginMenu QString  menuName  ) 
 

std::map<int,QString> QgisIface::menuMapById  )  [virtual]
 

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

Implements QgisInterface.

std::map<QString,int> QgisIface::menuMapByName  )  [virtual]
 

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

Implements QgisInterface.

void QgisIface::newProject bool  thePromptToSaveFlag = false  )  [virtual]
 

Start a new blank project.

Implements QgisInterface.

void QgisIface::openURL QString  url,
bool  useQgisDocDirectory = true
[virtual]
 

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)

Implements QgisInterface.

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

QgisIface aren't copied.

void QgisIface::removePluginMenuItem QString  name,
int  menuId
 

void QgisIface::removeToolBarIcon QAction *  qAction  )  [virtual]
 

Remove an icon (action) from the plugin toolbar.

Implements QgisInterface.

void QgisIface::zoomActiveLayer  )  [virtual]
 

Zoom to active layer.

Implements QgisInterface.

void QgisIface::zoomFull  )  [virtual]
 

Zoom map to full extent.

Implements QgisInterface.

void QgisIface::zoomPrevious  )  [virtual]
 

Zoom map to previous extent.

Implements QgisInterface.


Member Data Documentation

QgisApp* QgisIface::qgis [private]
 

Pointer to the QgisApp object.

Definition at line 117 of file qgisiface.h.


The documentation for this class was generated from the following file:

SourceForge.net Logo
Generated on Sun Aug 21 11:18:10 2005 for Quantum GIS by doxygen 1.4.0