QGIS API Documentation 3.41.0-Master (af5edcb665c)
Loading...
Searching...
No Matches
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
24class QgsLayout;
25class QgsLayoutView;
26class QgsLayoutItem;
27class QgsMessageBar;
28class QgsFeature;
30class QMenu;
31class QDockWidget;
32class QToolBar;
33
54class GUI_EXPORT QgsLayoutDesignerInterface : public QObject
55{
56#ifdef SIP_RUN
58 if ( qobject_cast<QgsLayoutDesignerInterface *>( sipCpp ) )
59 sipType = sipType_QgsLayoutDesignerInterface;
60 else
61 sipType = NULL;
63#endif
64
65 Q_OBJECT
66
67 public:
74
78 QgsLayoutDesignerInterface( QObject *parent SIP_TRANSFERTHIS = nullptr )
79 : QObject( parent )
80 {}
81
86 virtual QgsLayout *layout() = 0;
87
93
99 virtual QWidget *window() = 0;
100
105 virtual QgsLayoutView *view() = 0;
106
110 virtual QgsMessageBar *messageBar() = 0;
111
115 virtual void selectItems( const QList<QgsLayoutItem *> &items ) = 0;
116
123 virtual void setAtlasPreviewEnabled( bool enabled ) = 0;
124
131 virtual bool atlasPreviewEnabled() const = 0;
132
138 virtual void setAtlasFeature( const QgsFeature &feature ) = 0;
139
148 virtual void showItemOptions( QgsLayoutItem *item, bool bringPanelToFront = true ) = 0;
149
150 // Menus and toolbars
151
166 virtual QMenu *layoutMenu() = 0;
167
182 virtual QMenu *editMenu() = 0;
183
198 virtual QMenu *viewMenu() = 0;
199
214 virtual QMenu *itemsMenu() = 0;
215
232 virtual QMenu *atlasMenu() = 0;
233
250 virtual QMenu *reportMenu() = 0;
251
266 virtual QMenu *settingsMenu() = 0;
267
279 virtual QToolBar *layoutToolbar() = 0;
280
292 virtual QToolBar *navigationToolbar() = 0;
293
305 virtual QToolBar *actionsToolbar() = 0;
306
321 virtual QToolBar *atlasToolbar() = 0;
322
332 virtual void addDockWidget( Qt::DockWidgetArea area, QDockWidget *dock ) = 0;
333
343 virtual void removeDockWidget( QDockWidget *dock ) = 0;
344
350 virtual void activateTool( StandardTool tool ) = 0;
351
358 {
359 public:
364
370 QMap<QString, QgsLabelingResults *> labelingResults;
371 };
372
381
382 public slots:
383
387 virtual void close() = 0;
388
394 virtual void showRulers( bool visible ) = 0;
395
396 signals:
397
406
407
414};
415
416#endif // QGSLAYOUTDESIGNERINTERFACE_H
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Definition qgsfeature.h:58
Encapsulates the results of an export operation performed in the designer.
QMap< QString, QgsLabelingResults * > labelingResults
Returns the labeling results for all map items included in the export.
QgsLayoutExporter::ExportResult result
Result/error code of export.
A common interface for layout designer dialogs and widgets.
virtual void removeDockWidget(QDockWidget *dock)=0
Removes the specified dock widget from layout designer (without deleting it).
virtual void showItemOptions(QgsLayoutItem *item, bool bringPanelToFront=true)=0
Shows the configuration widget for the specified layout item.
virtual QgsLayoutView * view()=0
Returns the layout view utilized by the designer.
virtual QMenu * settingsMenu()=0
Returns a reference to the designer's "Settings" menu.
virtual QgsMasterLayoutInterface * masterLayout()=0
Returns the master layout displayed in the designer.
virtual QgsMessageBar * messageBar()=0
Returns the designer's message bar.
virtual QMenu * layoutMenu()=0
Returns a reference to the designer's "Layout" menu.
virtual QgsLayoutDesignerInterface::ExportResults * lastExportResults() const =0
Returns the results of the last export operation performed in the designer.
virtual QToolBar * navigationToolbar()=0
Returns a reference to the designer's "Navigation" toolbar.
virtual QMenu * atlasMenu()=0
Returns a reference to the designer's "Atlas" menu.
virtual QToolBar * atlasToolbar()=0
Returns a reference to the designer's "Atlas" toolbar.
virtual bool atlasPreviewEnabled() const =0
Returns whether the atlas preview mode is enabled in the designer.
virtual QWidget * window()=0
Returns a pointer to the designer window.
virtual void addDockWidget(Qt::DockWidgetArea area, QDockWidget *dock)=0
Adds a dock widget to the layout designer, in the specified dock area.
virtual QMenu * reportMenu()=0
Returns a reference to the designer's "Report" menu.
virtual void selectItems(const QList< QgsLayoutItem * > &items)=0
Selects the specified items.
void mapPreviewRefreshed(QgsLayoutItemMap *map)
Emitted when a map item's preview has been refreshed.
virtual QgsLayout * layout()=0
Returns the current layout displayed in the designer.
virtual void setAtlasPreviewEnabled(bool enabled)=0
Toggles whether the atlas preview mode should be enabled in the designer.
virtual QToolBar * layoutToolbar()=0
Returns a reference to the designer's "Layout" toolbar.
virtual void activateTool(StandardTool tool)=0
Activates a standard layout designer tool.
virtual void close()=0
Closes the layout designer.
QgsLayoutDesignerInterface(QObject *parent=nullptr)
Constructor for QgsLayoutDesignerInterface.
virtual void setAtlasFeature(const QgsFeature &feature)=0
Sets the specified feature as the current atlas feature.
virtual void showRulers(bool visible)=0
Toggles whether or not the rulers should be visible in the designer.
virtual QMenu * editMenu()=0
Returns a reference to the designer's "Edit" menu.
virtual QMenu * viewMenu()=0
Returns a reference to the designer's "View" menu.
void layoutExported()
Emitted whenever a layout is exported from the layout designer.
virtual QToolBar * actionsToolbar()=0
Returns a reference to the designer's "Actions" toolbar.
virtual QMenu * itemsMenu()=0
Returns a reference to the designer's "Items" menu.
StandardTool
Standard designer tools which are always available for use.
@ ToolMoveItemNodes
Move item nodes tool.
@ ToolMoveItemContent
Move item content tool.
ExportResult
Result codes for exporting layouts.
Layout graphical items for displaying a map.
Base class for graphical items within a QgsLayout.
A graphical widget to display and interact with QgsLayouts.
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
Definition qgslayout.h:49
Interface for master layout type objects, such as print layouts and reports.
A bar for displaying non-blocking messages to the user.
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition qgis_sip.h:191
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53
#define SIP_FACTORY
Definition qgis_sip.h:76
#define SIP_END
Definition qgis_sip.h:208