2016-02-14 03:50:23 +01:00
|
|
|
/** \ingroup gui
|
|
|
|
* QgisInterface
|
|
|
|
* Abstract base class defining interfaces exposed by QgisApp and
|
2007-01-09 02:39:15 +00:00
|
|
|
* made available to plugins.
|
|
|
|
*
|
|
|
|
* Only functionality exposed by QgisInterface can be used in plugins.
|
|
|
|
* This interface has to be implemented with application specific details.
|
|
|
|
*
|
|
|
|
* QGIS implements it in QgisAppInterface class, 3rd party applications
|
|
|
|
* could provide their own implementation to be able to use plugins.
|
|
|
|
*/
|
|
|
|
|
|
|
|
class QgisInterface : QObject
|
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include <qgisinterface.h>
|
|
|
|
%End
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
/** Constructor */
|
|
|
|
QgisInterface();
|
|
|
|
|
|
|
|
/** Virtual destructor */
|
|
|
|
virtual ~QgisInterface();
|
2011-04-03 17:08:38 +00:00
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual QgsPluginManagerInterface *pluginManagerInterface() = 0;
|
2013-05-19 17:44:57 +02:00
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual QgsLayerTreeView *layerTreeView() = 0;
|
2014-05-16 18:44:19 +07:00
|
|
|
|
2016-11-21 23:43:30 +08:00
|
|
|
/** Add action to context menu for layers in the layer tree.
|
|
|
|
* If allLayers is true, then the action will be available for all layers of given type,
|
|
|
|
* otherwise the action will be available only for specific layers added with addCustomActionForLayer()
|
|
|
|
* after this call.
|
|
|
|
*
|
|
|
|
* If menu argument is not empty, the action will be also added to a menu within the main window,
|
|
|
|
* creating menu with the given name if it does not exist yet.
|
|
|
|
*
|
|
|
|
* @see removeCustomActionForLayerType()
|
|
|
|
* @see addCustomActionForLayer()
|
|
|
|
*/
|
|
|
|
virtual void addCustomActionForLayerType( QAction* action, QString menu,
|
|
|
|
QgsMapLayer::LayerType type, bool allLayers ) = 0;
|
|
|
|
|
|
|
|
/** Add action to context menu for a specific layer in the layer tree.
|
|
|
|
* It is necessary to first call addCustomActionForLayerType() with allLayers=false
|
|
|
|
* in order for this method to have any effect.
|
|
|
|
* @see addCustomActionForLayerType()
|
|
|
|
*/
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual void addCustomActionForLayer( QAction *action, QgsMapLayer *layer ) = 0;
|
2016-11-21 23:43:30 +08:00
|
|
|
|
|
|
|
/** Remove action for layers in the layer tree previously added with addCustomActionForLayerType()
|
|
|
|
* @see addCustomActionForLayerType()
|
|
|
|
*/
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual bool removeCustomActionForLayerType( QAction *action ) = 0;
|
2016-11-21 23:43:30 +08:00
|
|
|
|
2007-01-09 02:39:15 +00:00
|
|
|
public slots: // TODO: do these functions really need to be slots?
|
|
|
|
|
2012-10-05 21:54:54 +02:00
|
|
|
/* Exposed functions */
|
2012-09-26 18:18:44 -06:00
|
|
|
|
2017-02-27 14:50:22 +10:00
|
|
|
virtual QList< QgsMapCanvas* > mapCanvases() = 0;
|
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual QgsMapCanvas *createNewMapCanvas( const QString &name ) = 0;
|
2017-02-27 14:50:22 +10:00
|
|
|
|
2017-03-14 12:20:58 +10:00
|
|
|
virtual void closeMapCanvas( const QString &name ) = 0;
|
|
|
|
|
2017-02-27 14:50:22 +10:00
|
|
|
public slots:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
virtual void zoomFull() = 0;
|
|
|
|
|
2007-01-09 02:39:15 +00:00
|
|
|
//! Zoom to previous view extent
|
2012-09-24 02:28:15 +02:00
|
|
|
virtual void zoomToPrevious() = 0;
|
|
|
|
|
2009-04-18 00:02:22 +00:00
|
|
|
//! Zoom to next view extent
|
2012-09-24 02:28:15 +02:00
|
|
|
virtual void zoomToNext() = 0;
|
|
|
|
|
|
|
|
//! Zoom to extent of the active layer
|
|
|
|
virtual void zoomToActiveLayer() = 0;
|
2007-01-09 02:39:15 +00:00
|
|
|
|
|
|
|
//! Add a vector layer
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual QgsVectorLayer *addVectorLayer( const QString &vectorLayerPath, const QString &baseName, const QString &providerKey ) = 0;
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2007-01-09 02:39:15 +00:00
|
|
|
//! Add a raster layer given a raster layer file name
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual QgsRasterLayer *addRasterLayer( const QString &rasterLayerPath, const QString &baseName = QString() ) = 0;
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2008-06-05 09:30:48 +00:00
|
|
|
//! Add a WMS layer
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual QgsRasterLayer *addRasterLayer( const QString &url, const QString &layerName, const QString &providerKey ) = 0;
|
2007-01-09 02:39:15 +00:00
|
|
|
|
|
|
|
//! Add a project
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual bool addProject( const QString &project ) = 0;
|
2007-01-09 02:39:15 +00:00
|
|
|
//! Start a blank project
|
2017-02-21 18:14:58 +01:00
|
|
|
virtual void newProject( bool promptToSaveFlag = false ) = 0;
|
2007-01-09 02:39:15 +00:00
|
|
|
|
|
|
|
//! Get pointer to the active layer (layer selected in the legend)
|
2012-09-24 02:28:15 +02:00
|
|
|
virtual QgsMapLayer *activeLayer() = 0;
|
2007-01-09 02:39:15 +00:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
//! Set the active layer (layer gets selected in the legend)
|
|
|
|
//! returns true if the layer exists, false otherwise
|
|
|
|
virtual bool setActiveLayer( QgsMapLayer * ) = 0;
|
2009-12-07 18:59:25 +00:00
|
|
|
|
2007-01-09 02:39:15 +00:00
|
|
|
//! Add an icon to the plugins toolbar
|
2012-09-24 02:28:15 +02:00
|
|
|
virtual int addToolBarIcon( QAction *qAction ) = 0;
|
|
|
|
|
2013-04-28 21:15:25 +02:00
|
|
|
/**
|
|
|
|
* Add a widget to the plugins toolbar.
|
|
|
|
* To remove this widget again, call {@link removeToolBarIcon}
|
|
|
|
* with the returned QAction.
|
|
|
|
*
|
|
|
|
* @param widget widget to add. The toolbar will take ownership of this widget
|
|
|
|
* @return the QAction you can use to remove this widget from the toolbar
|
|
|
|
*/
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual QAction *addToolBarWidget( QWidget *widget /Transfer/ ) = 0;
|
2013-04-28 21:15:25 +02:00
|
|
|
|
2007-01-09 02:39:15 +00:00
|
|
|
//! Remove an action (icon) from the plugin toolbar
|
2012-09-24 02:28:15 +02:00
|
|
|
virtual void removeToolBarIcon( QAction *qAction ) = 0;
|
|
|
|
|
2013-04-28 21:15:25 +02:00
|
|
|
/**
|
|
|
|
* Add a widget to the raster toolbar.
|
|
|
|
* To remove this widget again, call {@link removeRasterToolBarIcon}
|
|
|
|
* with the returned QAction.
|
|
|
|
*
|
|
|
|
* @param widget widget to add. The toolbar will take ownership of this widget
|
|
|
|
* @return the QAction you can use to remove this widget from the toolbar
|
|
|
|
*/
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual QAction *addRasterToolBarWidget( QWidget *widget /Transfer/ ) = 0;
|
2013-04-28 21:15:25 +02:00
|
|
|
|
2011-12-20 17:53:57 +02:00
|
|
|
//! Add an icon to the Raster toolbar
|
2012-09-24 02:28:15 +02:00
|
|
|
virtual int addRasterToolBarIcon( QAction *qAction ) = 0;
|
|
|
|
|
2011-12-20 17:53:57 +02:00
|
|
|
//! Remove an action (icon) from the Raster toolbar
|
2012-09-24 02:28:15 +02:00
|
|
|
virtual void removeRasterToolBarIcon( QAction *qAction ) = 0;
|
|
|
|
|
2011-12-20 17:59:16 +02:00
|
|
|
//! Add an icon to the Vector toolbar
|
2012-09-24 02:28:15 +02:00
|
|
|
virtual int addVectorToolBarIcon( QAction *qAction ) = 0;
|
|
|
|
|
2013-04-28 21:15:25 +02:00
|
|
|
/**
|
|
|
|
* Add a widget to the vector toolbar.
|
|
|
|
* To remove this widget again, call {@link removeVectorToolBarIcon}
|
|
|
|
* with the returned QAction.
|
|
|
|
*
|
|
|
|
* @param widget widget to add. The toolbar will take ownership of this widget
|
|
|
|
* @return the QAction you can use to remove this widget from the toolbar
|
|
|
|
*/
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual QAction *addVectorToolBarWidget( QWidget *widget /Transfer/ ) = 0;
|
2013-04-28 21:15:25 +02:00
|
|
|
|
2011-12-20 17:59:16 +02:00
|
|
|
//! Remove an action (icon) from the Vector toolbar
|
2012-09-24 02:28:15 +02:00
|
|
|
virtual void removeVectorToolBarIcon( QAction *qAction ) = 0;
|
|
|
|
|
2011-12-20 18:03:44 +02:00
|
|
|
//! Add an icon to the Database toolbar
|
2012-09-24 02:28:15 +02:00
|
|
|
virtual int addDatabaseToolBarIcon( QAction *qAction ) = 0;
|
|
|
|
|
2013-04-28 21:15:25 +02:00
|
|
|
/**
|
|
|
|
* Add a widget to the database toolbar.
|
|
|
|
* To remove this widget again, call {@link removeDatabaseToolBarIcon}
|
|
|
|
* with the returned QAction.
|
|
|
|
*
|
|
|
|
* @param widget widget to add. The toolbar will take ownership of this widget
|
|
|
|
* @return the QAction you can use to remove this widget from the toolbar
|
|
|
|
*/
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual QAction *addDatabaseToolBarWidget( QWidget *widget /Transfer/ ) = 0;
|
2013-04-28 21:15:25 +02:00
|
|
|
|
2011-12-20 18:03:44 +02:00
|
|
|
//! Remove an action (icon) from the Database toolbar
|
2012-09-24 02:28:15 +02:00
|
|
|
virtual void removeDatabaseToolBarIcon( QAction *qAction ) = 0;
|
|
|
|
|
2011-12-23 20:17:16 +02:00
|
|
|
//! Add an icon to the Web toolbar
|
2012-09-24 02:28:15 +02:00
|
|
|
virtual int addWebToolBarIcon( QAction *qAction ) = 0;
|
|
|
|
|
2013-04-28 21:15:25 +02:00
|
|
|
/**
|
|
|
|
* Add a widget to the web toolbar.
|
|
|
|
* To remove this widget again, call {@link removeWebToolBarIcon}
|
|
|
|
* with the returned QAction.
|
|
|
|
*
|
|
|
|
* @param widget widget to add. The toolbar will take ownership of this widget
|
|
|
|
* @return the QAction you can use to remove this widget from the toolbar
|
|
|
|
*/
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual QAction *addWebToolBarWidget( QWidget *widget /Transfer/ ) = 0;
|
2013-04-28 21:15:25 +02:00
|
|
|
|
2011-12-23 20:17:16 +02:00
|
|
|
//! Remove an action (icon) from the Web toolbar
|
2012-09-24 02:28:15 +02:00
|
|
|
virtual void removeWebToolBarIcon( QAction *qAction ) = 0;
|
2011-12-20 17:53:57 +02:00
|
|
|
|
2007-01-09 02:39:15 +00:00
|
|
|
//! Add toolbar with specified name
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual QToolBar *addToolBar( const QString &name ) = 0 /Factory/;
|
2007-01-09 02:39:15 +00:00
|
|
|
|
2014-04-10 15:28:52 +02:00
|
|
|
//! Add a toolbar
|
|
|
|
//! @note added in 2.3
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual void addToolBar( QToolBar *toolbar /Transfer/, Qt::ToolBarArea area = Qt::TopToolBarArea ) = 0;
|
2014-04-10 15:28:52 +02:00
|
|
|
|
2007-01-09 02:39:15 +00:00
|
|
|
/** Return a pointer to the map canvas */
|
2017-05-03 07:45:22 +02:00
|
|
|
virtual QgsMapCanvas *mapCanvas() = 0;
|
2007-01-09 02:39:15 +00:00
|
|
|
|
2016-02-14 03:50:23 +01:00
|
|
|
/**
|
|
|
|
* Returns a pointer to the layer tree canvas bridge
|
|
|
|
*
|
|
|
|
* @note added in 2.12
|
|
|
|
*/
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual QgsLayerTreeMapCanvasBridge *layerTreeCanvasBridge() = 0;
|
2015-07-26 22:59:51 +02:00
|
|
|
|
2007-01-09 02:39:15 +00:00
|
|
|
/** Return a pointer to the main window (instance of QgisApp in case of QGIS) */
|
2017-05-03 07:45:22 +02:00
|
|
|
virtual QWidget *mainWindow() = 0;
|
2007-01-09 02:39:15 +00:00
|
|
|
|
2012-09-02 22:41:20 +10:00
|
|
|
/** Return the message bar of the main app */
|
2017-05-03 07:45:22 +02:00
|
|
|
virtual QgsMessageBar *messageBar() = 0;
|
2012-09-02 22:41:20 +10:00
|
|
|
|
2016-02-14 03:50:23 +01:00
|
|
|
/** Open the message log dock widget **/
|
2015-09-28 17:13:41 +10:00
|
|
|
virtual void openMessageLog() = 0;
|
|
|
|
|
2015-05-20 08:17:39 +02:00
|
|
|
/** Adds a widget to the user input tool bar.*/
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual void addUserInputWidget( QWidget *widget ) = 0;
|
2015-05-20 08:17:39 +02:00
|
|
|
|
2017-03-18 10:46:19 +10:00
|
|
|
virtual QList<QgsComposerInterface *> openComposers() = 0;
|
|
|
|
virtual QgsComposerInterface *openComposer( QgsComposition *composition ) = 0;
|
|
|
|
virtual void closeComposer( QgsComposition *composition ) = 0;
|
2017-03-24 11:16:49 +10:00
|
|
|
virtual void showOptionsDialog( QWidget *parent = 0, const QString ¤tPage = QString() ) = 0;
|
2009-02-25 19:15:23 +00:00
|
|
|
|
2013-01-18 18:55:31 -07:00
|
|
|
virtual QMap<QString, QVariant> defaultStyleSheetOptions() = 0;
|
|
|
|
|
|
|
|
/** Generate stylesheet
|
|
|
|
* @param opts generated default option values, or a changed copy of them
|
|
|
|
*/
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual void buildStyleSheet( const QMap<QString, QVariant> &opts ) = 0;
|
2013-01-18 18:55:31 -07:00
|
|
|
|
2014-10-30 09:30:52 +01:00
|
|
|
/** Save changed default option keys/values to user settings */
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual void saveStyleSheetOptions( const QMap<QString, QVariant> &opts ) = 0;
|
2013-01-18 18:55:31 -07:00
|
|
|
|
2014-10-30 09:30:52 +01:00
|
|
|
/** Get reference font for initial qApp (may not be same as QgisApp) */
|
2013-01-18 18:55:31 -07:00
|
|
|
virtual QFont defaultStyleSheetFont() = 0;
|
|
|
|
|
2007-01-09 02:39:15 +00:00
|
|
|
/** Add action to the plugins menu */
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual void addPluginToMenu( const QString &name, QAction *action ) = 0;
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2007-01-09 02:39:15 +00:00
|
|
|
/** Remove action from the plugins menu */
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual void removePluginMenu( const QString &name, QAction *action ) = 0;
|
2007-01-09 02:39:15 +00:00
|
|
|
|
2014-10-30 09:30:52 +01:00
|
|
|
/** Add "add layer" action to layer menu */
|
2012-09-24 02:28:15 +02:00
|
|
|
virtual void insertAddLayerAction( QAction *action ) = 0;
|
2011-03-13 14:22:21 +00:00
|
|
|
|
2015-02-03 02:21:52 +01:00
|
|
|
/** Remove "add layer" action from layer menu */
|
2012-09-24 02:28:15 +02:00
|
|
|
virtual void removeAddLayerAction( QAction *action ) = 0;
|
2011-03-13 14:22:21 +00:00
|
|
|
|
2014-10-30 09:30:52 +01:00
|
|
|
/** Add action to the Database menu */
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual void addPluginToDatabaseMenu( const QString &name, QAction *action ) = 0;
|
2011-03-13 14:22:21 +00:00
|
|
|
|
2014-10-30 09:30:52 +01:00
|
|
|
/** Remove action from the Database menu */
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual void removePluginDatabaseMenu( const QString &name, QAction *action ) = 0;
|
2010-11-14 14:00:57 +00:00
|
|
|
|
2014-10-30 09:30:52 +01:00
|
|
|
/** Add action to the Raster menu */
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual void addPluginToRasterMenu( const QString &name, QAction *action ) = 0;
|
2011-12-20 17:53:57 +02:00
|
|
|
|
2014-10-30 09:30:52 +01:00
|
|
|
/** Remove action from the Raster menu */
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual void removePluginRasterMenu( const QString &name, QAction *action ) = 0;
|
2011-12-20 17:53:57 +02:00
|
|
|
|
2014-10-30 09:30:52 +01:00
|
|
|
/** Add action to the Vector menu */
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual void addPluginToVectorMenu( const QString &name, QAction *action ) = 0;
|
2011-12-20 17:59:16 +02:00
|
|
|
|
2014-10-30 09:30:52 +01:00
|
|
|
/** Remove action from the Vector menu */
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual void removePluginVectorMenu( const QString &name, QAction *action ) = 0;
|
2011-12-20 17:59:16 +02:00
|
|
|
|
2014-10-30 09:30:52 +01:00
|
|
|
/** Add action to the Web menu */
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual void addPluginToWebMenu( const QString &name, QAction *action ) = 0;
|
2011-12-23 20:17:16 +02:00
|
|
|
|
2014-10-30 09:30:52 +01:00
|
|
|
/** Remove action from the Web menu */
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual void removePluginWebMenu( const QString &name, QAction *action ) = 0;
|
2011-12-23 20:17:16 +02:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
/** Add a dock widget to the main window */
|
2017-05-03 07:45:22 +02:00
|
|
|
virtual void addDockWidget( Qt::DockWidgetArea area, QDockWidget *dockwidget ) = 0;
|
2007-01-09 02:39:15 +00:00
|
|
|
|
2014-10-30 09:30:52 +01:00
|
|
|
/** Remove specified dock widget from main window (doesn't delete it). */
|
2017-05-03 07:45:22 +02:00
|
|
|
virtual void removeDockWidget( QDockWidget *dockwidget ) = 0;
|
2009-03-16 14:22:07 +00:00
|
|
|
|
2015-10-19 17:46:15 +02:00
|
|
|
/** Advanced digitizing dock widget
|
|
|
|
* @note Added in 2.12
|
|
|
|
*/
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual QgsAdvancedDigitizingDockWidget *cadDockWidget() = 0;
|
2015-10-19 17:46:15 +02:00
|
|
|
|
2015-07-29 11:52:14 +02:00
|
|
|
/** Open layer properties dialog */
|
2012-09-24 02:28:15 +02:00
|
|
|
virtual void showLayerProperties( QgsMapLayer *l ) = 0;
|
2010-01-23 21:50:09 +00:00
|
|
|
|
2015-07-29 11:52:14 +02:00
|
|
|
/** Open attribute table dialog */
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual QDialog *showAttributeTable( QgsVectorLayer *l, const QString &filterExpression = QString() ) = 0;
|
2010-11-23 12:25:24 +00:00
|
|
|
|
2008-09-05 05:46:56 +00:00
|
|
|
/** Add window to Window menu. The action title is the window title
|
|
|
|
* and the action should raise, unminimize and activate the window. */
|
|
|
|
virtual void addWindow( QAction *action ) = 0;
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2008-09-05 05:46:56 +00:00
|
|
|
/** Remove window from Window menu. Calling this is necessary only for
|
|
|
|
* windows which are hidden rather than deleted when closed. */
|
|
|
|
virtual void removeWindow( QAction *action ) = 0;
|
|
|
|
|
2017-03-07 15:39:31 +10:00
|
|
|
virtual bool registerMainWindowAction( QAction *action, const QString &defaultShortcut ) = 0;
|
|
|
|
virtual bool unregisterMainWindowAction( QAction *action ) = 0;
|
|
|
|
virtual void registerMapLayerConfigWidgetFactory( QgsMapLayerConfigWidgetFactory *factory ) = 0;
|
|
|
|
virtual void unregisterMapLayerConfigWidgetFactory( QgsMapLayerConfigWidgetFactory *factory ) = 0;
|
|
|
|
virtual void registerOptionsWidgetFactory( QgsOptionsWidgetFactory *factory ) = 0;
|
|
|
|
virtual void unregisterOptionsWidgetFactory( QgsOptionsWidgetFactory *factory ) = 0;
|
|
|
|
virtual void registerCustomDropHandler( QgsCustomDropHandler *handler ) = 0;
|
|
|
|
virtual void unregisterCustomDropHandler( QgsCustomDropHandler *handler ) = 0;
|
|
|
|
virtual void openURL( const QString &url, bool useQgisDocDirectory = true ) = 0 /Deprecated/;
|
2008-09-05 05:46:56 +00:00
|
|
|
|
2013-05-28 12:17:38 +02:00
|
|
|
virtual QMenu *projectMenu() = 0;
|
2008-09-05 05:46:56 +00:00
|
|
|
virtual QMenu *editMenu() = 0;
|
|
|
|
virtual QMenu *viewMenu() = 0;
|
|
|
|
virtual QMenu *layerMenu() = 0;
|
2013-02-21 12:42:47 +04:00
|
|
|
virtual QMenu *newLayerMenu() = 0;
|
2014-10-30 09:30:52 +01:00
|
|
|
/** @note added in 2.5 */
|
2014-09-06 16:23:53 +03:00
|
|
|
virtual QMenu *addLayerMenu() = 0;
|
2008-09-05 05:46:56 +00:00
|
|
|
virtual QMenu *settingsMenu() = 0;
|
|
|
|
virtual QMenu *pluginMenu() = 0;
|
2011-12-20 17:53:57 +02:00
|
|
|
virtual QMenu *rasterMenu() = 0;
|
2012-09-24 02:28:15 +02:00
|
|
|
virtual QMenu *databaseMenu() = 0;
|
2011-12-20 17:59:16 +02:00
|
|
|
virtual QMenu *vectorMenu() = 0;
|
2011-12-23 20:17:16 +02:00
|
|
|
virtual QMenu *webMenu() = 0;
|
2008-09-05 05:46:56 +00:00
|
|
|
virtual QMenu *firstRightStandardMenu() = 0;
|
|
|
|
virtual QMenu *windowMenu() = 0;
|
|
|
|
virtual QMenu *helpMenu() = 0;
|
|
|
|
|
2014-01-27 09:22:24 +01:00
|
|
|
// ToolBars
|
2008-09-05 05:46:56 +00:00
|
|
|
virtual QToolBar *fileToolBar() = 0;
|
|
|
|
virtual QToolBar *layerToolBar() = 0;
|
|
|
|
virtual QToolBar *mapNavToolToolBar() = 0;
|
|
|
|
virtual QToolBar *digitizeToolBar() = 0;
|
2014-10-30 09:30:52 +01:00
|
|
|
virtual QToolBar *advancedDigitizeToolBar() = 0;
|
2008-09-05 05:46:56 +00:00
|
|
|
virtual QToolBar *attributesToolBar() = 0;
|
|
|
|
virtual QToolBar *pluginToolBar() = 0;
|
|
|
|
virtual QToolBar *helpToolBar() = 0;
|
2011-04-03 17:08:38 +00:00
|
|
|
virtual QToolBar *rasterToolBar() = 0;
|
2011-12-20 17:59:16 +02:00
|
|
|
virtual QToolBar *vectorToolBar() = 0;
|
2011-12-20 18:03:44 +02:00
|
|
|
virtual QToolBar *databaseToolBar() = 0;
|
2011-12-23 20:17:16 +02:00
|
|
|
virtual QToolBar *webToolBar() = 0;
|
2008-09-05 05:46:56 +00:00
|
|
|
|
2014-01-27 09:22:24 +01:00
|
|
|
// Project menu actions
|
2008-09-05 05:46:56 +00:00
|
|
|
virtual QAction *actionNewProject() = 0;
|
|
|
|
virtual QAction *actionOpenProject() = 0;
|
|
|
|
virtual QAction *actionSaveProject() = 0;
|
|
|
|
virtual QAction *actionSaveProjectAs() = 0;
|
|
|
|
virtual QAction *actionSaveMapAsImage() = 0;
|
|
|
|
virtual QAction *actionProjectProperties() = 0;
|
|
|
|
virtual QAction *actionPrintComposer() = 0;
|
2013-02-20 13:10:21 -07:00
|
|
|
virtual QAction *actionShowComposerManager() = 0;
|
2008-09-05 05:46:56 +00:00
|
|
|
virtual QAction *actionExit() = 0;
|
|
|
|
|
2014-01-27 09:22:24 +01:00
|
|
|
// Edit menu actions
|
2008-09-05 05:46:56 +00:00
|
|
|
virtual QAction *actionCutFeatures() = 0;
|
|
|
|
virtual QAction *actionCopyFeatures() = 0;
|
|
|
|
virtual QAction *actionPasteFeatures() = 0;
|
2011-05-06 00:48:29 +02:00
|
|
|
virtual QAction *actionAddFeature() = 0;
|
2008-09-05 05:46:56 +00:00
|
|
|
virtual QAction *actionDeleteSelected() = 0;
|
|
|
|
virtual QAction *actionMoveFeature() = 0;
|
|
|
|
virtual QAction *actionSplitFeatures() = 0;
|
2013-04-22 17:41:17 +02:00
|
|
|
virtual QAction *actionSplitParts() = 0;
|
2008-09-05 05:46:56 +00:00
|
|
|
virtual QAction *actionAddRing() = 0;
|
2012-09-24 02:28:15 +02:00
|
|
|
virtual QAction *actionAddPart() = 0;
|
2010-04-30 21:19:22 +00:00
|
|
|
virtual QAction *actionSimplifyFeature() = 0;
|
|
|
|
virtual QAction *actionDeleteRing() = 0;
|
|
|
|
virtual QAction *actionDeletePart() = 0;
|
|
|
|
virtual QAction *actionNodeTool() = 0;
|
2008-09-05 05:46:56 +00:00
|
|
|
|
2014-01-27 09:22:24 +01:00
|
|
|
// View menu actions
|
|
|
|
//! Get access to the native pan action. Call trigger() on it to set the default pan map tool.
|
2008-09-05 05:46:56 +00:00
|
|
|
virtual QAction *actionPan() = 0;
|
2014-01-27 09:22:24 +01:00
|
|
|
//! Get access to the native pan to selected action. Call trigger() on it to pan the map canvas to the selection.
|
2012-01-18 11:57:35 +02:00
|
|
|
virtual QAction *actionPanToSelected() = 0;
|
2014-01-27 09:22:24 +01:00
|
|
|
//! Get access to the native zoom in action. Call trigger() on it to set the default zoom in map tool.
|
2008-09-05 05:46:56 +00:00
|
|
|
virtual QAction *actionZoomIn() = 0;
|
2014-01-27 09:22:24 +01:00
|
|
|
//! Get access to the native zoom out action. Call trigger() on it to set the default zoom out map tool.
|
2008-09-05 05:46:56 +00:00
|
|
|
virtual QAction *actionZoomOut() = 0;
|
2014-01-27 09:22:24 +01:00
|
|
|
//! Get access to the native select action. Call trigger() on it to set the default select map tool.
|
2008-09-05 05:46:56 +00:00
|
|
|
virtual QAction *actionSelect() = 0;
|
2014-01-27 09:22:24 +01:00
|
|
|
//! Get access to the native select rectangle action. Call trigger() on it to set the default select rectangle map tool.
|
2010-08-12 16:59:57 +00:00
|
|
|
virtual QAction *actionSelectRectangle() = 0;
|
2014-01-27 09:22:24 +01:00
|
|
|
//! Get access to the native select polygon action. Call trigger() on it to set the default select polygon map tool.
|
2010-08-12 16:59:57 +00:00
|
|
|
virtual QAction *actionSelectPolygon() = 0;
|
2014-01-27 09:22:24 +01:00
|
|
|
//! Get access to the native select freehand action. Call trigger() on it to set the default select freehand map tool.
|
2010-08-12 16:59:57 +00:00
|
|
|
virtual QAction *actionSelectFreehand() = 0;
|
2014-01-27 09:22:24 +01:00
|
|
|
//! Get access to the native select radius action. Call trigger() on it to set the default select radius map tool.
|
2010-08-12 16:59:57 +00:00
|
|
|
virtual QAction *actionSelectRadius() = 0;
|
2014-01-27 09:22:24 +01:00
|
|
|
//! Get access to the native identify action. Call trigger() on it to set the default identify map tool.
|
2008-09-05 05:46:56 +00:00
|
|
|
virtual QAction *actionIdentify() = 0;
|
2014-01-27 09:22:24 +01:00
|
|
|
//! Get access to the native run action feature action. Call trigger() on it to set the default run feature action map tool.
|
2013-11-13 08:07:29 +01:00
|
|
|
virtual QAction *actionFeatureAction() = 0;
|
2014-01-27 09:22:24 +01:00
|
|
|
//! Get access to the native measure action. Call trigger() on it to set the default measure map tool.
|
2008-09-05 05:46:56 +00:00
|
|
|
virtual QAction *actionMeasure() = 0;
|
2014-01-27 09:22:24 +01:00
|
|
|
//! Get access to the native measure area action. Call trigger() on it to set the default measure area map tool.
|
2008-09-05 05:46:56 +00:00
|
|
|
virtual QAction *actionMeasureArea() = 0;
|
2014-01-27 09:22:24 +01:00
|
|
|
//! Get access to the native zoom full extent action. Call trigger() on it to zoom to the full extent.
|
2008-09-05 05:46:56 +00:00
|
|
|
virtual QAction *actionZoomFullExtent() = 0;
|
2014-01-27 09:22:24 +01:00
|
|
|
//! Get access to the native zoom to layer action. Call trigger() on it to zoom to the active layer.
|
2008-09-05 05:46:56 +00:00
|
|
|
virtual QAction *actionZoomToLayer() = 0;
|
2014-01-27 09:22:24 +01:00
|
|
|
//! Get access to the native zoom to selected action. Call trigger() on it to zoom to the current selection.
|
2008-09-05 05:46:56 +00:00
|
|
|
virtual QAction *actionZoomToSelected() = 0;
|
2014-01-27 09:22:24 +01:00
|
|
|
//! Get access to the native zoom last action. Call trigger() on it to zoom to last.
|
2008-09-05 05:46:56 +00:00
|
|
|
virtual QAction *actionZoomLast() = 0;
|
2014-01-27 09:22:24 +01:00
|
|
|
//! Get access to the native zoom next action. Call trigger() on it to zoom to next.
|
2013-11-02 16:57:12 +01:00
|
|
|
virtual QAction *actionZoomNext() = 0;
|
2016-02-14 03:50:23 +01:00
|
|
|
//! Get access to the native zoom resolution (100%) action. Call trigger() on it to zoom to actual size.
|
2008-09-05 05:46:56 +00:00
|
|
|
virtual QAction *actionZoomActualSize() = 0;
|
2014-01-27 09:22:24 +01:00
|
|
|
//! Get access to the native map tips action. Call trigger() on it to toggle map tips.
|
2008-09-05 05:46:56 +00:00
|
|
|
virtual QAction *actionMapTips() = 0;
|
2014-01-27 09:22:24 +01:00
|
|
|
//! Get access to the native new bookmark action. Call trigger() on it to open the new bookmark dialog.
|
2008-09-05 05:46:56 +00:00
|
|
|
virtual QAction *actionNewBookmark() = 0;
|
2014-01-27 09:22:24 +01:00
|
|
|
//! Get access to the native show bookmarks action. Call trigger() on it to open the bookmarks dialog.
|
2008-09-05 05:46:56 +00:00
|
|
|
virtual QAction *actionShowBookmarks() = 0;
|
2014-01-27 09:22:24 +01:00
|
|
|
//! Get access to the native draw action.
|
2008-09-05 05:46:56 +00:00
|
|
|
virtual QAction *actionDraw() = 0;
|
|
|
|
|
2014-01-27 09:22:24 +01:00
|
|
|
// Layer menu actions
|
2008-09-05 05:46:56 +00:00
|
|
|
virtual QAction *actionNewVectorLayer() = 0;
|
|
|
|
virtual QAction *actionAddOgrLayer() = 0;
|
|
|
|
virtual QAction *actionAddRasterLayer() = 0;
|
|
|
|
virtual QAction *actionAddPgLayer() = 0;
|
|
|
|
virtual QAction *actionAddWmsLayer() = 0;
|
2016-05-30 19:35:23 +02:00
|
|
|
/** Get access to the native Add ArcGIS FeatureServer action. */
|
2016-05-27 12:06:22 +02:00
|
|
|
virtual QAction *actionAddAfsLayer() = 0;
|
2016-05-30 19:35:23 +02:00
|
|
|
/** Get access to the native Add ArcGIS MapServer action. */
|
2016-05-27 12:06:22 +02:00
|
|
|
virtual QAction *actionAddAmsLayer() = 0;
|
2012-11-27 10:35:22 -07:00
|
|
|
virtual QAction *actionCopyLayerStyle() = 0;
|
|
|
|
virtual QAction *actionPasteLayerStyle() = 0;
|
2008-09-05 05:46:56 +00:00
|
|
|
virtual QAction *actionOpenTable() = 0;
|
2013-05-15 10:01:34 +10:00
|
|
|
virtual QAction *actionOpenFieldCalculator() = 0;
|
2008-09-05 05:46:56 +00:00
|
|
|
virtual QAction *actionToggleEditing() = 0;
|
2012-12-31 16:26:46 -07:00
|
|
|
virtual QAction *actionSaveActiveLayerEdits() = 0;
|
2012-12-18 22:51:14 -07:00
|
|
|
virtual QAction *actionAllEdits() = 0;
|
2012-12-01 17:16:01 -07:00
|
|
|
virtual QAction *actionSaveEdits() = 0;
|
|
|
|
virtual QAction *actionSaveAllEdits() = 0;
|
2012-12-18 22:51:14 -07:00
|
|
|
virtual QAction *actionRollbackEdits() = 0;
|
|
|
|
virtual QAction *actionRollbackAllEdits() = 0;
|
|
|
|
virtual QAction *actionCancelEdits() = 0;
|
|
|
|
virtual QAction *actionCancelAllEdits() = 0;
|
2008-09-05 05:46:56 +00:00
|
|
|
virtual QAction *actionLayerSaveAs() = 0;
|
2012-10-31 20:04:24 -06:00
|
|
|
virtual QAction *actionDuplicateLayer() = 0;
|
2008-09-05 05:46:56 +00:00
|
|
|
virtual QAction *actionLayerProperties() = 0;
|
|
|
|
virtual QAction *actionAddToOverview() = 0;
|
|
|
|
virtual QAction *actionAddAllToOverview() = 0;
|
|
|
|
virtual QAction *actionRemoveAllFromOverview() = 0;
|
|
|
|
virtual QAction *actionHideAllLayers() = 0;
|
|
|
|
virtual QAction *actionShowAllLayers() = 0;
|
2014-10-15 18:49:35 +02:00
|
|
|
virtual QAction *actionHideSelectedLayers() = 0;
|
2016-12-27 11:05:00 +10:00
|
|
|
/**
|
|
|
|
* Returns the Hide Deselected Layers action.
|
|
|
|
* @note added in QGIS 3.0
|
|
|
|
*/
|
|
|
|
virtual QAction *actionHideDeselectedLayers() = 0;
|
2014-10-15 18:49:35 +02:00
|
|
|
virtual QAction *actionShowSelectedLayers() = 0;
|
2008-09-05 05:46:56 +00:00
|
|
|
|
2014-01-27 09:22:24 +01:00
|
|
|
// Plugin menu actions
|
2008-09-05 05:46:56 +00:00
|
|
|
virtual QAction *actionManagePlugins() = 0;
|
|
|
|
virtual QAction *actionPluginListSeparator() = 0;
|
|
|
|
virtual QAction *actionShowPythonDialog() = 0;
|
|
|
|
|
2014-01-27 09:22:24 +01:00
|
|
|
// Settings menu actions
|
2008-09-05 05:46:56 +00:00
|
|
|
virtual QAction *actionToggleFullScreen() = 0;
|
|
|
|
virtual QAction *actionOptions() = 0;
|
|
|
|
virtual QAction *actionCustomProjection() = 0;
|
|
|
|
|
2014-01-27 09:22:24 +01:00
|
|
|
// Help menu actions
|
2008-09-05 05:46:56 +00:00
|
|
|
virtual QAction *actionHelpContents() = 0;
|
|
|
|
virtual QAction *actionQgisHomePage() = 0;
|
|
|
|
virtual QAction *actionCheckQgisVersion() = 0;
|
|
|
|
virtual QAction *actionAbout() = 0;
|
|
|
|
|
2014-01-27 09:22:24 +01:00
|
|
|
/**
|
|
|
|
* Open feature form
|
2014-08-20 09:56:48 +02:00
|
|
|
* @param l vector layer
|
|
|
|
* @param f feature to show/modify
|
|
|
|
* @param updateFeatureOnly only update the feature update (don't change any attributes of the layer) [UNUSED]
|
|
|
|
* @param showModal if true, will wait for the dialog to be executed (only shown otherwise)
|
2014-01-27 09:22:24 +01:00
|
|
|
*/
|
2014-08-18 14:04:18 +02:00
|
|
|
virtual bool openFeatureForm( QgsVectorLayer *l, QgsFeature &f, bool updateFeatureOnly = false, bool showModal = true ) = 0;
|
2010-09-17 12:39:15 +00:00
|
|
|
|
2014-08-20 09:56:48 +02:00
|
|
|
/**
|
|
|
|
* Returns a feature form for a given feature
|
|
|
|
*
|
|
|
|
* @param l The layer for which the dialog will be created
|
|
|
|
* @param f The feature for which the dialog will be created
|
|
|
|
*
|
|
|
|
* @return A feature form
|
|
|
|
*/
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual QgsAttributeDialog *getFeatureForm( QgsVectorLayer *l, QgsFeature &f ) = 0;
|
2013-04-26 00:27:54 +10:00
|
|
|
|
2014-08-20 09:56:48 +02:00
|
|
|
/**
|
|
|
|
* Access the vector layer tools instance.
|
|
|
|
* With the help of this you can access methods like addFeature, startEditing
|
|
|
|
* or stopEditing while giving the user the appropriate dialogs.
|
|
|
|
*
|
|
|
|
* @return An instance of the vector layer tools
|
|
|
|
*/
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual QgsVectorLayerTools *vectorLayerTools() = 0;
|
2013-10-04 11:22:57 +02:00
|
|
|
|
2014-08-20 09:56:48 +02:00
|
|
|
/** This method is only needed when using a UI form with a custom widget plugin and calling
|
2017-01-12 22:01:50 +01:00
|
|
|
* openFeatureForm or getFeatureForm from Python (PyQt4) and you haven't used the info tool first.
|
2017-01-16 15:13:30 +01:00
|
|
|
* Python will crash bringing QGIS with it
|
2014-08-20 09:56:48 +02:00
|
|
|
* if the custom form is not loaded from a C++ method call.
|
|
|
|
*
|
|
|
|
* This method uses a QTimer to call QUiLoader in order to load the form via C++
|
|
|
|
* you only need to call this once after that you can call openFeatureForm/getFeatureForm
|
|
|
|
* like normal
|
|
|
|
*
|
|
|
|
* More information here: http://qt-project.org/forums/viewthread/27098/
|
|
|
|
*/
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual void preloadForm( const QString &uifile ) = 0;
|
2013-06-23 16:00:16 +02:00
|
|
|
|
2012-12-18 22:51:14 -07:00
|
|
|
/** Return vector layers in edit mode
|
|
|
|
* @param modified whether to return only layers that have been modified
|
2014-10-30 09:30:52 +01:00
|
|
|
* @returns list of layers in legend order, or empty list */
|
2012-12-18 22:51:14 -07:00
|
|
|
virtual QList<QgsMapLayer *> editableLayers( bool modified = false ) const = 0;
|
|
|
|
|
2014-10-30 09:30:52 +01:00
|
|
|
/** Get timeout for timed messages: default of 5 seconds */
|
2013-01-13 17:10:47 -07:00
|
|
|
virtual int messageTimeout() = 0;
|
|
|
|
|
2007-01-09 02:39:15 +00:00
|
|
|
signals:
|
2017-03-18 10:46:19 +10:00
|
|
|
void currentLayerChanged( QgsMapLayer *layer );
|
2017-04-10 09:19:42 +10:00
|
|
|
void currentThemeChanged( const QString &theme );
|
2017-03-18 10:46:19 +10:00
|
|
|
void composerOpened( QgsComposerInterface *composer );
|
|
|
|
void composerWillBeClosed( QgsComposerInterface *composer );
|
|
|
|
void composerClosed( QgsComposerInterface *composer );
|
2011-04-03 17:08:38 +00:00
|
|
|
void initializationCompleted();
|
2015-07-29 11:52:14 +02:00
|
|
|
/** Emitted when a project file is successfully read
|
2016-02-14 03:50:23 +01:00
|
|
|
* @note
|
|
|
|
* This is useful for plug-ins that store properties with project files. A
|
|
|
|
* plug-in can connect to this signal. When it is emitted, the plug-in
|
|
|
|
* knows to then check the project properties for any relevant state.
|
2010-10-30 09:33:01 +00:00
|
|
|
*/
|
|
|
|
void projectRead();
|
2015-07-29 11:52:14 +02:00
|
|
|
/** Emitted when starting an entirely new project
|
2016-02-14 03:50:23 +01:00
|
|
|
* @note
|
|
|
|
* This is similar to projectRead(); plug-ins might want to be notified
|
|
|
|
* that they're in a new project. Yes, projectRead() could have been
|
|
|
|
* overloaded to be used in the case of new projects instead. However,
|
|
|
|
* it's probably more semantically correct to have an entirely separate
|
|
|
|
* signal for when this happens.
|
|
|
|
*/
|
2012-09-24 02:28:15 +02:00
|
|
|
void newProjectCreated();
|
2015-02-03 02:21:52 +01:00
|
|
|
|
2015-07-29 11:52:14 +02:00
|
|
|
/** This signal is emitted when a layer has been saved using save as
|
2016-02-14 03:50:23 +01:00
|
|
|
* @note
|
|
|
|
* added in version 2.7
|
|
|
|
*/
|
2017-05-01 16:42:33 +02:00
|
|
|
void layerSavedAs( QgsMapLayer *l, const QString &path );
|
2007-01-09 02:39:15 +00:00
|
|
|
};
|