QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
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 "qgslayoutexporter.h"
22 #include <QObject>
23 
24 class QgsLayout;
25 class QgsLayoutView;
26 class QgsLayoutItem;
27 class QgsMessageBar;
28 class QgsFeature;
30 class QMenu;
31 class QDockWidget;
32 class QToolBar;
33 
55 class GUI_EXPORT QgsLayoutDesignerInterface: public QObject
56 {
57 
58 #ifdef SIP_RUN
60  if ( qobject_cast<QgsLayoutDesignerInterface *>( sipCpp ) )
61  sipType = sipType_QgsLayoutDesignerInterface;
62  else
63  sipType = NULL;
64  SIP_END
65 #endif
66 
67  Q_OBJECT
68 
69  public:
70 
73  {
76  };
77 
81  QgsLayoutDesignerInterface( QObject *parent SIP_TRANSFERTHIS = nullptr )
82  : QObject( parent )
83  {}
84 
89  virtual QgsLayout *layout() = 0;
90 
95  virtual QgsMasterLayoutInterface *masterLayout() = 0;
96 
102  virtual QWidget *window() = 0;
103 
108  virtual QgsLayoutView *view() = 0;
109 
113  virtual QgsMessageBar *messageBar() = 0;
114 
118  virtual void selectItems( const QList< QgsLayoutItem * > &items ) = 0;
119 
126  virtual void setAtlasPreviewEnabled( bool enabled ) = 0;
127 
134  virtual bool atlasPreviewEnabled() const = 0;
135 
141  virtual void setAtlasFeature( const QgsFeature &feature ) = 0;
142 
151  virtual void showItemOptions( QgsLayoutItem *item, bool bringPanelToFront = true ) = 0;
152 
153  // Menus and toolbars
154 
169  virtual QMenu *layoutMenu() = 0;
170 
185  virtual QMenu *editMenu() = 0;
186 
201  virtual QMenu *viewMenu() = 0;
202 
217  virtual QMenu *itemsMenu() = 0;
218 
235  virtual QMenu *atlasMenu() = 0;
236 
253  virtual QMenu *reportMenu() = 0;
254 
269  virtual QMenu *settingsMenu() = 0;
270 
282  virtual QToolBar *layoutToolbar() = 0;
283 
295  virtual QToolBar *navigationToolbar() = 0;
296 
308  virtual QToolBar *actionsToolbar() = 0;
309 
324  virtual QToolBar *atlasToolbar() = 0;
325 
335  virtual void addDockWidget( Qt::DockWidgetArea area, QDockWidget *dock ) = 0;
336 
346  virtual void removeDockWidget( QDockWidget *dock ) = 0;
347 
353  virtual void activateTool( StandardTool tool ) = 0;
354 
361  {
362  public:
363 
368 
374  QMap< QString, QgsLabelingResults * > labelingResults;
375 
376  };
377 
385  virtual QgsLayoutDesignerInterface::ExportResults *lastExportResults() const = 0 SIP_FACTORY;
386 
387  public slots:
388 
392  virtual void close() = 0;
393 
399  virtual void showRulers( bool visible ) = 0;
400 
401  signals:
402 
410  void layoutExported();
411 
412 
418  void mapPreviewRefreshed( QgsLayoutItemMap *map );
419 
420 };
421 
422 #endif // QGSLAYOUTDESIGNERINTERFACE_H
QgsLayoutDesignerInterface::ToolMoveItemNodes
@ ToolMoveItemNodes
Move item nodes tool.
Definition: qgslayoutdesignerinterface.h:75
QgsLayoutExporter::ExportResult
ExportResult
Result codes for exporting layouts.
Definition: qgslayoutexporter.h:138
QgsLayoutDesignerInterface::QgsLayoutDesignerInterface
QgsLayoutDesignerInterface(QObject *parent=nullptr)
Constructor for QgsLayoutDesignerInterface.
Definition: qgslayoutdesignerinterface.h:81
QgsLayoutDesignerInterface::ToolMoveItemContent
@ ToolMoveItemContent
Move item content tool.
Definition: qgslayoutdesignerinterface.h:74
QgsLayoutDesignerInterface::ExportResults::result
QgsLayoutExporter::ExportResult result
Result/error code of export.
Definition: qgslayoutdesignerinterface.h:367
SIP_FACTORY
#define SIP_FACTORY
Definition: qgis_sip.h:76
qgslayoutexporter.h
SIP_CONVERT_TO_SUBCLASS_CODE
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition: qgis_sip.h:186
qgis_sip.h
QgsMessageBar
A bar for displaying non-blocking messages to the user.
Definition: qgsmessagebar.h:60
QgsLayoutDesignerInterface::StandardTool
StandardTool
Standard designer tools which are always available for use.
Definition: qgslayoutdesignerinterface.h:72
QgsLayoutItem
Base class for graphical items within a QgsLayout.
Definition: qgslayoutitem.h:112
QgsLayoutItemMap
Layout graphical items for displaying a map.
Definition: qgslayoutitemmap.h:317
QgsLayoutDesignerInterface::ExportResults::labelingResults
QMap< QString, QgsLabelingResults * > labelingResults
Returns the labeling results for all map items included in the export.
Definition: qgslayoutdesignerinterface.h:374
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::ExportResults
Encapsulates the results of an export operation performed in the designer.
Definition: qgslayoutdesignerinterface.h:360
QgsLayoutView
A graphical widget to display and interact with QgsLayouts.
Definition: qgslayoutview.h:49
QgsFeature
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Definition: qgsfeature.h:55
QgsMasterLayoutInterface
Interface for master layout type objects, such as print layouts and reports.
Definition: qgsmasterlayoutinterface.h:42
SIP_END
#define SIP_END
Definition: qgis_sip.h:203
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:53