QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
qgslayoutdesignerinterface.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgslayoutdesignerinterface.h
3  ---------------------
4  Date : July 2017
5  Copyright : (C) 2017 Nyall Dawson
6  Email : nyall dot dawson at gmail dot com
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 #ifndef QGSLAYOUTDESIGNERINTERFACE_H
17 #define QGSLAYOUTDESIGNERINTERFACE_H
18 
19 #include "qgis_gui.h"
20 #include "qgis_sip.h"
21 #include <QObject>
22 
23 class QgsLayout;
24 class QgsLayoutView;
25 class QgsLayoutItem;
26 class QgsMessageBar;
27 class QgsFeature;
29 class QMenu;
30 class QDockWidget;
31 class QToolBar;
32 
54 class GUI_EXPORT QgsLayoutDesignerInterface: public QObject
55 {
56 
57 #ifdef SIP_RUN
59  if ( qobject_cast<QgsLayoutDesignerInterface *>( sipCpp ) )
60  sipType = sipType_QgsLayoutDesignerInterface;
61  else
62  sipType = NULL;
63  SIP_END
64 #endif
65 
66  Q_OBJECT
67 
68  public:
69 
72  {
75  };
76 
80  QgsLayoutDesignerInterface( QObject *parent SIP_TRANSFERTHIS = nullptr )
81  : QObject( parent )
82  {}
83 
88  virtual QgsLayout *layout() = 0;
89 
95 
101  virtual QWidget *window() = 0;
102 
107  virtual QgsLayoutView *view() = 0;
108 
112  virtual QgsMessageBar *messageBar() = 0;
113 
117  virtual void selectItems( const QList< QgsLayoutItem * > &items ) = 0;
118 
125  virtual void setAtlasPreviewEnabled( bool enabled ) = 0;
126 
133  virtual bool atlasPreviewEnabled() const = 0;
134 
140  virtual void setAtlasFeature( const QgsFeature &feature ) = 0;
141 
150  virtual void showItemOptions( QgsLayoutItem *item, bool bringPanelToFront = true ) = 0;
151 
152  // Menus and toolbars
153 
168  virtual QMenu *layoutMenu() = 0;
169 
184  virtual QMenu *editMenu() = 0;
185 
200  virtual QMenu *viewMenu() = 0;
201 
216  virtual QMenu *itemsMenu() = 0;
217 
234  virtual QMenu *atlasMenu() = 0;
235 
252  virtual QMenu *reportMenu() = 0;
253 
268  virtual QMenu *settingsMenu() = 0;
269 
281  virtual QToolBar *layoutToolbar() = 0;
282 
294  virtual QToolBar *navigationToolbar() = 0;
295 
307  virtual QToolBar *actionsToolbar() = 0;
308 
323  virtual QToolBar *atlasToolbar() = 0;
324 
334  virtual void addDockWidget( Qt::DockWidgetArea area, QDockWidget *dock ) = 0;
335 
345  virtual void removeDockWidget( QDockWidget *dock ) = 0;
346 
352  virtual void activateTool( StandardTool tool ) = 0;
353 
354  public slots:
355 
359  virtual void close() = 0;
360 
366  virtual void showRulers( bool visible ) = 0;
367 
368 
369 };
370 
371 #endif // QGSLAYOUTDESIGNERINTERFACE_H
QgsLayoutDesignerInterface::viewMenu
virtual QMenu * viewMenu()=0
Returns a reference to the designer's "View" menu.
QgsLayoutDesignerInterface::showRulers
virtual void showRulers(bool visible)=0
Toggles whether or not the rulers should be visible in the designer.
QgsLayoutDesignerInterface::navigationToolbar
virtual QToolBar * navigationToolbar()=0
Returns a reference to the designer's "Navigation" toolbar.
QgsLayoutDesignerInterface::ToolMoveItemNodes
@ ToolMoveItemNodes
Move item nodes tool.
Definition: qgslayoutdesignerinterface.h:74
QgsLayoutDesignerInterface::addDockWidget
virtual void addDockWidget(Qt::DockWidgetArea area, QDockWidget *dock)=0
Adds a dock widget to the layout designer, in the specified dock area.
QgsLayoutDesignerInterface::view
virtual QgsLayoutView * view()=0
Returns the layout view utilized by the designer.
QgsLayoutDesignerInterface::QgsLayoutDesignerInterface
QgsLayoutDesignerInterface(QObject *parent=nullptr)
Constructor for QgsLayoutDesignerInterface.
Definition: qgslayoutdesignerinterface.h:80
QgsLayoutDesignerInterface::close
virtual void close()=0
Closes the layout designer.
QgsLayoutDesignerInterface::setAtlasPreviewEnabled
virtual void setAtlasPreviewEnabled(bool enabled)=0
Toggles whether the atlas preview mode should be enabled in the designer.
QgsLayoutDesignerInterface::layoutToolbar
virtual QToolBar * layoutToolbar()=0
Returns a reference to the designer's "Layout" toolbar.
QgsLayoutDesignerInterface::itemsMenu
virtual QMenu * itemsMenu()=0
Returns a reference to the designer's "Items" menu.
QgsLayoutDesignerInterface::editMenu
virtual QMenu * editMenu()=0
Returns a reference to the designer's "Edit" menu.
QgsLayoutDesignerInterface::ToolMoveItemContent
@ ToolMoveItemContent
Move item content tool.
Definition: qgslayoutdesignerinterface.h:73
QgsLayoutDesignerInterface::settingsMenu
virtual QMenu * settingsMenu()=0
Returns a reference to the designer's "Settings" menu.
QgsLayoutDesignerInterface::window
virtual QWidget * window()=0
Returns a pointer to the designer window.
QgsLayoutDesignerInterface::masterLayout
virtual QgsMasterLayoutInterface * masterLayout()=0
Returns the master layout displayed in the designer.
QgsLayoutDesignerInterface::atlasToolbar
virtual QToolBar * atlasToolbar()=0
Returns a reference to the designer's "Atlas" toolbar.
QgsLayoutDesignerInterface::layoutMenu
virtual QMenu * layoutMenu()=0
Returns a reference to the designer's "Layout" menu.
SIP_CONVERT_TO_SUBCLASS_CODE
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition: qgis_sip.h:177
QgsLayoutDesignerInterface::selectItems
virtual void selectItems(const QList< QgsLayoutItem * > &items)=0
Selects the specified items.
QgsLayoutDesignerInterface::reportMenu
virtual QMenu * reportMenu()=0
Returns a reference to the designer's "Report" menu.
QgsLayoutDesignerInterface::atlasMenu
virtual QMenu * atlasMenu()=0
Returns a reference to the designer's "Atlas" menu.
qgis_sip.h
QgsLayoutDesignerInterface::setAtlasFeature
virtual void setAtlasFeature(const QgsFeature &feature)=0
Sets the specified feature as the current atlas feature.
QgsMessageBar
A bar for displaying non-blocking messages to the user.
Definition: qgsmessagebar.h:61
QgsLayoutDesignerInterface::StandardTool
StandardTool
Standard designer tools which are always available for use.
Definition: qgslayoutdesignerinterface.h:72
QgsLayoutDesignerInterface::atlasPreviewEnabled
virtual bool atlasPreviewEnabled() const =0
Returns whether the atlas preview mode is enabled in the designer.
QgsLayoutItem
Base class for graphical items within a QgsLayout.
Definition: qgslayoutitem.h:113
QgsLayoutDesignerInterface::actionsToolbar
virtual QToolBar * actionsToolbar()=0
Returns a reference to the designer's "Actions" toolbar.
QgsLayoutDesignerInterface::activateTool
virtual void activateTool(StandardTool tool)=0
Activates a standard layout designer tool.
QgsLayoutDesignerInterface::layout
virtual QgsLayout * layout()=0
Returns the current layout displayed in the designer.
QgsLayout
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
Definition: qgslayout.h:50
QgsLayoutDesignerInterface
A common interface for layout designer dialogs and widgets.
Definition: qgslayoutdesignerinterface.h:55
QgsLayoutDesignerInterface::messageBar
virtual QgsMessageBar * messageBar()=0
Returns the designer's message bar.
QgsLayoutView
A graphical widget to display and interact with QgsLayouts.
Definition: qgslayoutview.h:50
QgsLayoutDesignerInterface::removeDockWidget
virtual void removeDockWidget(QDockWidget *dock)=0
Removes the specified dock widget from layout designer (without deleting it).
QgsFeature
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Definition: qgsfeature.h:56
QgsMasterLayoutInterface
Interface for master layout type objects, such as print layouts and reports.
Definition: qgsmasterlayoutinterface.h:43
QgsLayoutDesignerInterface::showItemOptions
virtual void showItemOptions(QgsLayoutItem *item, bool bringPanelToFront=true)=0
Shows the configuration widget for the specified layout item.
SIP_END
#define SIP_END
Definition: qgis_sip.h:194
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:53