2017-06-20 13:34:27 +02:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
2018-01-08 12:18:07 +10:00
|
|
|
* src/core/layout/qgslayoutmanager.h *
|
2017-06-20 13:34:27 +02:00
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-15 15:07:37 +10:00
|
|
|
|
|
|
|
class QgsLayoutManager : QObject
|
|
|
|
{
|
2017-06-20 13:34:27 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2017-06-20 13:34:27 +02:00
|
|
|
.. versionadded:: 3.0
|
|
|
|
|
2017-12-05 15:27:49 +10:00
|
|
|
Manages storage of a set of layouts.
|
2017-06-20 13:34:27 +02:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
QgsLayoutManager handles the storage, serializing and deserializing
|
2018-01-17 07:51:06 +10:00
|
|
|
of print layouts and reports. Usually this class is not constructed directly, but
|
2017-12-19 11:43:52 -04:00
|
|
|
rather accessed through a QgsProject via :py:func:`QgsProject.layoutManager()`
|
2017-06-20 13:34:27 +02:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
QgsLayoutManager retains ownership of all the layouts contained
|
|
|
|
in the manager.
|
2018-01-08 12:13:09 +10:00
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
Not available in Python bindings
|
2017-06-20 13:34:27 +02:00
|
|
|
%End
|
|
|
|
|
2017-03-15 15:07:37 +10:00
|
|
|
%TypeHeaderCode
|
2017-06-20 13:34:27 +02:00
|
|
|
#include "qgslayoutmanager.h"
|
2017-03-15 15:07:37 +10:00
|
|
|
%End
|
|
|
|
public:
|
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
explicit QgsLayoutManager( QgsProject *project /TransferThis/ = 0 );
|
2017-06-20 13:34:27 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Constructor for QgsLayoutManager. The project will become the parent object for this
|
|
|
|
manager.
|
2017-06-20 13:34:27 +02:00
|
|
|
%End
|
2017-03-15 15:07:37 +10:00
|
|
|
|
|
|
|
~QgsLayoutManager();
|
2017-06-20 13:34:27 +02:00
|
|
|
|
2017-12-29 17:56:33 +10:00
|
|
|
bool addLayout( QgsMasterLayoutInterface *layout /Transfer/ );
|
2017-12-05 15:27:49 +10:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Adds a ``layout`` to the manager. Ownership of the layout is transferred to the manager.
|
|
|
|
Returns true if the addition was successful, or false if the layout could not be added (eg
|
|
|
|
as a result of a duplicate layout name).
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`removeLayout`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`layoutAdded`
|
2017-12-05 15:27:49 +10:00
|
|
|
%End
|
|
|
|
|
2017-12-29 17:56:33 +10:00
|
|
|
bool removeLayout( QgsMasterLayoutInterface *layout );
|
2017-12-05 15:27:49 +10:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Removes a ``layout`` from the manager. The layout is deleted.
|
|
|
|
Returns true if the removal was successful, or false if the removal failed (eg as a result
|
|
|
|
of removing a layout which is not contained in the manager).
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`addLayout`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`layoutRemoved`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`layoutAboutToBeRemoved`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`clear`
|
2017-06-20 13:34:27 +02:00
|
|
|
%End
|
2017-03-15 15:07:37 +10:00
|
|
|
|
|
|
|
void clear();
|
2017-06-20 13:34:27 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Removes and deletes all layouts from the manager.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`removeLayout`
|
2017-06-20 13:34:27 +02:00
|
|
|
%End
|
|
|
|
|
2017-12-29 17:56:33 +10:00
|
|
|
QList< QgsMasterLayoutInterface * > layouts() const;
|
2017-12-05 15:27:49 +10:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns a list of all layouts contained in the manager.
|
2017-12-05 15:27:49 +10:00
|
|
|
%End
|
|
|
|
|
2018-01-10 17:58:47 +01:00
|
|
|
QList< QgsPrintLayout * > printLayouts() const;
|
|
|
|
%Docstring
|
|
|
|
Returns a list of all print layouts contained in the manager.
|
|
|
|
%End
|
|
|
|
|
2017-12-29 17:56:33 +10:00
|
|
|
QgsMasterLayoutInterface *layoutByName( const QString &name ) const;
|
2017-12-05 15:27:49 +10:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the layout with a matching name, or None if no matching layouts
|
|
|
|
were found.
|
2017-12-05 15:27:49 +10:00
|
|
|
%End
|
|
|
|
|
2017-03-17 20:52:57 +10:00
|
|
|
bool readXml( const QDomElement &element, const QDomDocument &doc );
|
2017-06-20 13:34:27 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Reads the manager's state from a DOM element, restoring all layouts
|
|
|
|
present in the XML document.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`writeXml`
|
2017-06-20 13:34:27 +02:00
|
|
|
%End
|
|
|
|
|
2017-03-17 20:52:57 +10:00
|
|
|
QDomElement writeXml( QDomDocument &doc ) const;
|
2017-06-20 13:34:27 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns a DOM element representing the state of the manager.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`readXml`
|
2017-06-20 13:34:27 +02:00
|
|
|
%End
|
|
|
|
|
2017-12-29 17:56:33 +10:00
|
|
|
QgsMasterLayoutInterface *duplicateLayout( const QgsMasterLayoutInterface *layout, const QString &newName );
|
2017-12-04 16:33:37 +10:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Duplicates an existing ``layout`` from the manager. The new
|
|
|
|
layout will automatically be stored in the manager.
|
|
|
|
Returns new the layout if duplication was successful.
|
2017-06-20 13:34:27 +02:00
|
|
|
%End
|
2017-03-15 15:07:37 +10:00
|
|
|
|
2018-01-05 12:51:52 +10:00
|
|
|
QString generateUniqueTitle( QgsMasterLayoutInterface::Type type = QgsMasterLayoutInterface::PrintLayout ) const;
|
2017-12-05 15:27:49 +10:00
|
|
|
%Docstring
|
2018-01-05 12:51:52 +10:00
|
|
|
Generates a unique title for a new layout of the specified ``type``, which does not
|
2017-12-15 10:36:55 -04:00
|
|
|
clash with any already contained by the manager.
|
2017-12-05 15:27:49 +10:00
|
|
|
%End
|
|
|
|
|
2017-03-15 15:07:37 +10:00
|
|
|
signals:
|
2017-03-18 12:41:38 +10:00
|
|
|
|
2017-12-05 15:27:49 +10:00
|
|
|
void layoutAboutToBeAdded( const QString &name );
|
|
|
|
%Docstring
|
|
|
|
Emitted when a layout is about to be added to the manager
|
|
|
|
%End
|
|
|
|
|
|
|
|
void layoutAdded( const QString &name );
|
|
|
|
%Docstring
|
|
|
|
Emitted when a layout has been added to the manager
|
|
|
|
%End
|
|
|
|
|
|
|
|
void layoutRemoved( const QString &name );
|
|
|
|
%Docstring
|
|
|
|
Emitted when a layout was removed from the manager
|
|
|
|
%End
|
|
|
|
|
|
|
|
void layoutAboutToBeRemoved( const QString &name );
|
|
|
|
%Docstring
|
|
|
|
Emitted when a layout is about to be removed from the manager
|
2017-06-20 13:34:27 +02:00
|
|
|
%End
|
2017-03-18 12:41:38 +10:00
|
|
|
|
2017-12-29 17:56:33 +10:00
|
|
|
void layoutRenamed( QgsMasterLayoutInterface *layout, const QString &newName );
|
2017-12-05 15:27:49 +10:00
|
|
|
%Docstring
|
|
|
|
Emitted when a layout is renamed
|
2017-06-20 13:34:27 +02:00
|
|
|
%End
|
2017-03-15 15:07:37 +10:00
|
|
|
|
|
|
|
};
|
|
|
|
|
2017-06-20 13:34:27 +02:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
2018-01-08 12:18:07 +10:00
|
|
|
* src/core/layout/qgslayoutmanager.h *
|
2017-06-20 13:34:27 +02:00
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|