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

420 lines
13 KiB
Plaintext
Raw Normal View History

2017-10-27 13:08:20 +10:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/layout/qgslayoutmultiframe.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
2017-10-31 17:20:02 +10:00
class QgsLayoutMultiFrame: QgsLayoutObject, QgsLayoutUndoObjectInterface
{
%Docstring
2017-12-15 10:36:55 -04:00
Abstract base class for layout items with the ability to distribute the content to
several frames (QgsLayoutFrame items).
2017-10-31 17:20:02 +10:00
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgslayoutmultiframe.h"
#include "qgslayoutitemhtml.h"
#include "qgslayoutitemattributetable.h"
#include "qgslayoutitemtexttable.h"
%End
%ConvertToSubClassCode
// the conversions have to be static, because they're using multiple inheritance
// (seen in PyQt4 .sip files for some QGraphicsItem classes)
if ( QgsLayoutMultiFrame *mf = qobject_cast< QgsLayoutMultiFrame *>( sipCpp ) )
{
switch ( mf->type() )
{
// really, these *should* use the constants from QgsLayoutItemRegistry, but sip doesn't like that!
case QGraphicsItem::UserType + 112:
sipType = sipType_QgsLayoutItemHtml;
*sipCppRet = static_cast<QgsLayoutItemHtml *>( sipCpp );
break;
case QGraphicsItem::UserType + 113:
sipType = sipType_QgsLayoutItemAttributeTable;
*sipCppRet = static_cast<QgsLayoutItemAttributeTable *>( sipCpp );
break;
case QGraphicsItem::UserType + 114:
sipType = sipType_QgsLayoutItemTextTable;
*sipCppRet = static_cast<QgsLayoutItemTextTable *>( sipCpp );
break;
default:
sipType = 0;
}
}
else
{
sipType = 0;
}
2017-10-31 17:20:02 +10:00
%End
public:
enum ResizeMode
{
UseExistingFrames,
ExtendToNextPage,
RepeatOnEveryPage,
RepeatUntilFinished
};
enum UndoCommand
{
2017-11-06 15:03:57 +10:00
UndoHtmlBreakDistance,
UndoHtmlSource,
UndoHtmlStylesheet,
2017-11-22 18:36:51 +10:00
UndoTableCellStyle,
UndoTableMaximumFeatures,
UndoTableMargin,
UndoTableHeaderFontColor,
UndoTableContentFontColor,
UndoTableGridStrokeWidth,
UndoTableGridColor,
UndoTableBackgroundColor,
2017-10-31 17:20:02 +10:00
UndoNone,
};
QgsLayoutMultiFrame( QgsLayout *layout /TransferThis/ );
%Docstring
2017-12-15 10:36:55 -04:00
Construct a new multiframe item, attached to the specified ``layout``.
2017-10-31 17:20:02 +10:00
%End
~QgsLayoutMultiFrame();
QString uuid() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the multiframe identification string. This is a unique random string set for the multiframe
upon creation.
2017-10-31 17:20:02 +10:00
.. note::
There is no corresponding setter for the uuid - it's created automatically.
%End
virtual QSizeF totalSize() const = 0;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the total size of the multiframe's content, in layout units.
2017-10-31 17:20:02 +10:00
%End
virtual int type() const = 0;
%Docstring
2017-12-15 10:36:55 -04:00
Returns unique multiframe type id.
%End
virtual QIcon icon() const;
%Docstring
Returns the item's icon.
2017-10-31 17:20:02 +10:00
%End
virtual QSizeF fixedFrameSize( int frameIndex = -1 ) const;
2017-10-31 17:20:02 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the fixed size for a frame, if desired. If the fixed frame size changes,
the sizes of all frames can be recalculated by calling recalculateFrameRects().
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param frameIndex: frame number
:return: fixed size for frame. If the size has a width or height of 0, then
the frame size is not fixed in that direction and frames can have variable width
or height accordingly.
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`minFrameSize`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`recalculateFrameRects`
2017-10-31 17:20:02 +10:00
%End
virtual QSizeF minFrameSize( int frameIndex = -1 ) const;
2017-10-31 17:20:02 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the minimum size for a frames, if desired. If the minimum
size changes, the sizes of all frames can be recalculated by calling
recalculateFrameRects().
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param frameIndex: frame number
:return: minimum size for frame. If the size has a width or height of 0, then
the frame size has no minimum in that direction.
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`fixedFrameSize`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`recalculateFrameRects`
2017-10-31 17:20:02 +10:00
%End
virtual void render( QgsLayoutItemRenderContext &context, const QRectF &renderExtent, int frameIndex ) = 0;
2017-10-31 17:20:02 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Renders a portion of the multiframe's content into a render ``context``.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param context: destination render painter
:param renderExtent: visible extent of content to render into the painter.
:param frameIndex: frame number for content
2017-10-31 17:20:02 +10:00
%End
virtual void addFrame( QgsLayoutFrame *frame /Transfer/, bool recalcFrameSizes = true );
%Docstring
2017-12-15 10:36:55 -04:00
Adds a ``frame`` to the multiframe.
2017-10-31 17:20:02 +10:00
2017-12-15 10:36:55 -04:00
If ``recalcFrameSizes`` is set to true, then a recalculation of all existing frame sizes will be forced.
2017-10-31 17:20:02 +10:00
.. seealso:: :py:func:`removeFrame`
2017-10-31 17:20:02 +10:00
%End
virtual double findNearbyPageBreak( double yPos );
%Docstring
2017-12-15 10:36:55 -04:00
Finds the optimal position to break a frame at.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param yPos: maximum vertical position for break, in layout units.
:return: the optimal breakable position which occurs in the multi frame close
to and before the specified yPos
2017-10-31 17:20:02 +10:00
%End
void removeFrame( int index, bool removeEmptyPages = false );
%Docstring
2017-12-15 10:36:55 -04:00
Removes a frame by ``index`` from the multiframe. This method automatically removes the frame from the
layout too.
2017-10-31 17:20:02 +10:00
2017-12-15 10:36:55 -04:00
If ``removeEmptyPages`` is set to true, then pages which are empty after the frame is removed will
also be removed from the layout.
2017-10-31 17:20:02 +10:00
.. seealso:: :py:func:`addFrame`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`deleteFrames`
2017-10-31 17:20:02 +10:00
%End
void deleteFrames();
%Docstring
2017-12-15 10:36:55 -04:00
Removes and deletes all child frames.
.. seealso:: :py:func:`removeFrame`
2017-10-31 17:20:02 +10:00
%End
void setResizeMode( ResizeMode mode );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the resize ``mode`` for the multiframe, and recalculates frame sizes to match.
.. seealso:: :py:func:`resizeMode`
2017-10-31 17:20:02 +10:00
%End
ResizeMode resizeMode() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the resize mode for the multiframe.
.. seealso:: :py:func:`setResizeMode`
2017-10-31 17:20:02 +10:00
%End
bool writeXml( QDomElement &parentElement, QDomDocument &document, const QgsReadWriteContext &context, bool includeFrames = false ) const;
2017-10-31 17:20:02 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Stores the multiframe state in a DOM element.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param parentElement: parent DOM element (e.g. 'Layout' element)
:param document: DOM document
:param context: read write context
:param includeFrames: set to true to write state information about child frames into DOM
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`readXml`
2017-10-31 17:20:02 +10:00
%End
bool readXml( const QDomElement &itemElement, const QDomDocument &document, const QgsReadWriteContext &context, bool includeFrames = false );
2017-10-31 17:20:02 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets the item state from a DOM element.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param itemElement: is the DOM node corresponding to item (e.g. 'LayoutItem' element)
:param document: DOM document
:param context: read write context
:param includeFrames: set to true to read state information about child frames from DOM
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`writeXml`
2017-10-31 17:20:02 +10:00
%End
2017-11-20 15:13:26 +10:00
QList<QgsLayoutFrame *> frames() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns a list of all child frames for this multiframe.
.. seealso:: :py:func:`frameCount`
2017-11-20 15:13:26 +10:00
%End
2017-11-20 13:38:28 +10:00
int frameCount() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the number of frames associated with this multiframe.
.. seealso:: :py:func:`frames`
2017-11-20 13:38:28 +10:00
%End
QgsLayoutFrame *frame( int index ) const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the child frame at a specified ``index`` from the multiframe.
.. seealso:: :py:func:`frameIndex`
2017-11-20 13:38:28 +10:00
%End
2017-11-20 15:13:26 +10:00
int frameIndex( QgsLayoutFrame *frame ) const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the index of a ``frame`` within the multiframe.
:return: index for frame if found, -1 if frame not found in multiframe
.. seealso:: :py:func:`frame`
2017-11-20 15:13:26 +10:00
%End
2017-10-31 17:20:02 +10:00
QgsLayoutFrame *createNewFrame( QgsLayoutFrame *currentFrame, QPointF pos, QSizeF size );
%Docstring
2017-12-15 10:36:55 -04:00
Creates a new frame and adds it to the multi frame and layout.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param currentFrame: an existing QgsLayoutFrame from which to copy the size
and general frame properties (e.g., frame style, background, rendering settings).
2017-12-15 10:36:55 -04:00
:param pos: position of top-left corner of the new frame, in layout units
:param size: size of the new frame, in layout units
2017-10-31 17:20:02 +10:00
%End
virtual QString displayName() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the multiframe display name.
2017-10-31 17:20:02 +10:00
%End
virtual QgsAbstractLayoutUndoCommand *createCommand( const QString &text, int id, QUndoCommand *parent = 0 ) /Factory/;
void beginCommand( const QString &commandText, UndoCommand command = UndoNone );
%Docstring
2017-12-15 10:36:55 -04:00
Starts new undo command for this item.
The ``commandText`` should be a capitalized, imperative tense description (e.g. "Add Map Item").
If specified, multiple consecutive commands for this item with the same ``command`` will
be collapsed into a single undo command in the layout history.
.. seealso:: :py:func:`endCommand`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`cancelCommand`
2017-10-31 17:20:02 +10:00
%End
void endCommand();
%Docstring
2017-12-15 10:36:55 -04:00
Completes the current item command and push it onto the layout's undo stack.
.. seealso:: :py:func:`beginCommand`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`cancelCommand`
2017-10-31 17:20:02 +10:00
%End
void cancelCommand();
%Docstring
2017-12-15 10:36:55 -04:00
Cancels the current item command and discards it.
.. seealso:: :py:func:`beginCommand`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`endCommand`
2017-12-05 15:27:49 +10:00
%End
virtual void finalizeRestoreFromXml();
%Docstring
2017-12-15 10:36:55 -04:00
Called after all pending items have been restored from XML. Multiframes can use
this method to run steps which must take place after all items have been restored to the layout,
such as connecting to signals emitted by other items, which may not have existed in the layout
at the time readXml() was called. E.g. a scalebar can use this to connect to its linked
map item after restoration from XML.
.. seealso:: :py:func:`readXml`
2017-10-31 17:20:02 +10:00
%End
public slots:
2017-11-24 14:57:39 +10:00
virtual void refresh();
%Docstring
2017-12-15 10:36:55 -04:00
Refreshes the multiframe, causing a recalculation of any property overrides.
2017-11-24 14:57:39 +10:00
%End
2017-10-31 17:20:02 +10:00
void update();
%Docstring
2017-12-15 10:36:55 -04:00
Forces a redraw of all child frames.
2017-10-31 17:20:02 +10:00
%End
virtual void recalculateFrameSizes();
%Docstring
2017-12-15 10:36:55 -04:00
Recalculates the portion of the multiframe item which is shown in each of its
component frames. If the resize mode is set to anything but UseExistingFrames then
this may cause new frames to be added or frames to be removed, in order to fit
the current size of the multiframe's content.
.. seealso:: :py:func:`recalculateFrameRects`
2017-10-31 17:20:02 +10:00
%End
void recalculateFrameRects();
%Docstring
2017-12-15 10:36:55 -04:00
Forces a recalculation of all the associated frame's scene rectangles. This
method is useful for multiframes which implement a minFrameSize() or
fixedFrameSize() method.
.. seealso:: :py:func:`minFrameSize`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`fixedFrameSize`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`recalculateFrameSizes`
2017-10-31 17:20:02 +10:00
%End
virtual void refreshDataDefinedProperty( QgsLayoutObject::DataDefinedProperty property = QgsLayoutObject::AllProperties );
2017-11-24 14:57:39 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Refreshes a data defined ``property`` for the multi frame by reevaluating the property's value
and redrawing the item with this new value. If ``property`` is set to
QgsLayoutObject.AllProperties then all data defined properties for the item will be
refreshed.
2017-11-24 14:57:39 +10:00
%End
2017-10-31 17:20:02 +10:00
signals:
void contentsChanged();
%Docstring
2017-12-15 10:36:55 -04:00
Emitted when the contents of the multi frame have changed and the frames
must be redrawn.
2017-10-31 17:20:02 +10:00
%End
protected:
virtual bool writePropertiesToElement( QDomElement &element, QDomDocument &document, const QgsReadWriteContext &context ) const;
%Docstring
2017-12-15 10:36:55 -04:00
Stores multiframe state within an XML DOM element.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param element: is the DOM element to store the multiframe's properties in
:param document: DOM document
:param context: read write context
.. seealso:: :py:func:`writeXml`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`readPropertiesFromElement`
2017-10-31 17:20:02 +10:00
%End
virtual bool readPropertiesFromElement( const QDomElement &element, const QDomDocument &document, const QgsReadWriteContext &context );
%Docstring
2017-12-15 10:36:55 -04:00
Sets multiframe state from a DOM element.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param element: is the DOM element for the multiframe
:param document: DOM document
:param context: read write context
.. seealso:: :py:func:`writePropertiesToElement`
2017-12-05 15:27:49 +10:00
2017-12-15 10:36:55 -04:00
Note that item subclasses should not rely on all other items being present in the
layout at the time this method is called. Instead, any connections and links to
other items must be made in the finalizeRestoreFromXml() method. E.g. when restoring
a scalebar, the connection to the linked map's signals should be implemented
in finalizeRestoreFromXml(), not readPropertiesFromElement().
2017-12-05 15:27:49 +10:00
.. seealso:: :py:func:`readXml`
2017-10-31 17:20:02 +10:00
%End
};
2017-10-27 13:08:20 +10:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/layout/qgslayoutmultiframe.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/