QGIS/python/core/auto_generated/layout/qgslayoutmanager.sip.in

302 lines
8.1 KiB
Plaintext
Raw Normal View History

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 *
************************************************************************/
class QgsLayoutManager : QObject
{
2021-03-22 21:13:52 +01:00
%Docstring(signature="appended")
2017-12-15 10:36:55 -04:00
Manages storage of a set of layouts.
2017-06-20 13:34:27 +02:00
:py:class:`QgsLayoutManager` handles the storage, serializing and deserializing
of print layouts and reports. Usually this class is not constructed directly, but
rather accessed through a :py:class:`QgsProject` via :py:func:`QgsProject.layoutManager()`.
2017-06-20 13:34:27 +02:00
:py:class:`QgsLayoutManager` retains ownership of all the layouts contained
2017-12-15 10:36:55 -04:00
in the manager.
.. versionadded:: 3.0
2017-06-20 13:34:27 +02:00
%End
%TypeHeaderCode
2017-06-20 13:34:27 +02:00
#include "qgslayoutmanager.h"
%End
public:
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
~QgsLayoutManager();
2017-06-20 13:34:27 +02: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.
2019-02-26 19:54:09 +10:00
Returns ``True`` if the addition was successful, or ``False`` if the layout could not be added (eg
2017-12-15 10:36:55 -04:00
as a result of a duplicate layout name).
.. seealso:: :py:func:`removeLayout`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`layoutAdded`
2017-12-05 15:27:49 +10:00
%End
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.
2019-02-26 19:54:09 +10:00
Returns ``True`` if the removal was successful, or ``False`` if the removal failed (eg as a result
2017-12-15 10:36:55 -04:00
of removing a layout which is not contained in the manager).
.. seealso:: :py:func:`addLayout`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`layoutRemoved`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`layoutAboutToBeRemoved`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`clear`
2017-06-20 13:34:27 +02:00
%End
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.
.. seealso:: :py:func:`removeLayout`
2017-06-20 13:34:27 +02:00
%End
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
QList< QgsPrintLayout * > printLayouts() const;
%Docstring
Returns a list of all print layouts contained in the manager.
%End
QgsMasterLayoutInterface *layoutByName( const QString &name ) const;
2017-12-05 15:27:49 +10:00
%Docstring
Returns the layout with a matching name, or ``None`` if no matching layouts
2017-12-15 10:36:55 -04:00
were found.
2017-12-05 15:27:49 +10:00
%End
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.
.. seealso:: :py:func:`writeXml`
2017-06-20 13:34:27 +02:00
%End
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.
.. seealso:: :py:func:`readXml`
2017-06-20 13:34:27 +02:00
%End
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 the new layout if duplication was successful.
2017-06-20 13:34:27 +02:00
%End
QString generateUniqueTitle( QgsMasterLayoutInterface::Type type = QgsMasterLayoutInterface::PrintLayout ) const;
2017-12-05 15:27:49 +10:00
%Docstring
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.
%End
bool accept( QgsStyleEntityVisitorInterface *visitor ) const;
%Docstring
Accepts the specified style entity ``visitor``, causing it to visit all style entities associated
within the contained layouts.
Returns ``True`` if the visitor should continue visiting other objects, or ``False`` if visiting
should be canceled.
.. versionadded:: 3.10
2017-12-05 15:27:49 +10:00
%End
signals:
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
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
};
class QgsLayoutManagerModel : QAbstractListModel
{
2021-03-22 21:13:52 +01:00
%Docstring(signature="appended")
List model representing the print layouts and reports available in a
layout manager.
.. versionadded:: 3.8
%End
%TypeHeaderCode
#include "qgslayoutmanager.h"
%End
public:
enum Role
{
LayoutRole,
};
explicit QgsLayoutManagerModel( QgsLayoutManager *manager, QObject *parent /TransferThis/ = 0 );
%Docstring
Constructor for QgsLayoutManagerModel, showing the layouts from the specified ``manager``.
%End
virtual int rowCount( const QModelIndex &parent ) const;
virtual QVariant data( const QModelIndex &index, int role ) const;
virtual bool setData( const QModelIndex &index, const QVariant &value, int role = Qt::EditRole );
virtual Qt::ItemFlags flags( const QModelIndex &index ) const;
QgsMasterLayoutInterface *layoutFromIndex( const QModelIndex &index ) const;
%Docstring
Returns the layout at the corresponding ``index``.
.. seealso:: :py:func:`indexFromLayout`
%End
QModelIndex indexFromLayout( QgsMasterLayoutInterface *layout ) const;
%Docstring
Returns the model index corresponding to a ``layout``.
.. seealso:: :py:func:`layoutFromIndex`
%End
void setAllowEmptyLayout( bool allowEmpty );
%Docstring
Sets whether an optional empty layout ("not set") option is present in the model.
.. seealso:: :py:func:`allowEmptyLayout`
%End
bool allowEmptyLayout() const;
%Docstring
Returns ``True`` if the model allows the empty layout ("not set") choice.
.. seealso:: :py:func:`setAllowEmptyLayout`
%End
};
class QgsLayoutManagerProxyModel : QSortFilterProxyModel
{
2021-03-22 21:13:52 +01:00
%Docstring(signature="appended")
QSortFilterProxyModel subclass for QgsLayoutManagerModel
.. versionadded:: 3.8
%End
%TypeHeaderCode
#include "qgslayoutmanager.h"
%End
public:
enum Filter
{
FilterPrintLayouts,
FilterReports,
};
typedef QFlags<QgsLayoutManagerProxyModel::Filter> Filters;
explicit QgsLayoutManagerProxyModel( QObject *parent /TransferThis/ = 0 );
%Docstring
Constructor for QgsLayoutManagerProxyModel.
%End
virtual bool lessThan( const QModelIndex &left, const QModelIndex &right ) const;
virtual bool filterAcceptsRow( int sourceRow, const QModelIndex &sourceParent ) const;
QgsLayoutManagerProxyModel::Filters filters() const;
%Docstring
Returns the current filters used for filtering available layouts.
.. seealso:: :py:func:`setFilters`
%End
void setFilters( QgsLayoutManagerProxyModel::Filters filters );
%Docstring
Sets the current ``filters`` used for filtering available layouts.
.. seealso:: :py:func:`filters`
%End
QString filterString() const;
%Docstring
Returns the current filter string, if set.
.. seealso:: :py:func:`setFilterString`
.. versionadded:: 3.12
%End
public slots:
void setFilterString( const QString &filter );
%Docstring
Sets a ``filter`` string, such that only layouts with names containing the
specified string will be shown.
.. seealso:: :py:func:`filterString`
.. versionadded:: 3.12
%End
};
QFlags<QgsLayoutManagerProxyModel::Filter> operator|(QgsLayoutManagerProxyModel::Filter f1, QFlags<QgsLayoutManagerProxyModel::Filter> f2);
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 *
************************************************************************/