2017-06-20 11:14:25 +02:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/composer/qgscomposermultiframe.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-20 22:36:36 +11:00
|
|
|
%ModuleHeaderCode
|
|
|
|
#include <qgscomposerhtml.h>
|
|
|
|
#include <qgscomposertablev2.h>
|
|
|
|
#include <qgscomposerattributetablev2.h>
|
|
|
|
%End
|
2012-08-09 11:10:55 +02:00
|
|
|
|
2014-11-13 23:13:13 +01:00
|
|
|
|
2014-07-10 20:17:42 +10:00
|
|
|
class QgsComposerMultiFrame: QgsComposerObject
|
2012-08-09 11:10:55 +02:00
|
|
|
{
|
2017-06-20 11:14:25 +02:00
|
|
|
%Docstring
|
|
|
|
Abstract base class for composer items with the ability to distribute the content to several frames
|
|
|
|
(QgsComposerFrame items).
|
|
|
|
%End
|
|
|
|
|
2012-08-09 11:10:55 +02:00
|
|
|
%TypeHeaderCode
|
2017-06-20 11:14:25 +02:00
|
|
|
#include "qgscomposermultiframe.h"
|
2015-01-20 22:36:36 +11:00
|
|
|
%End
|
|
|
|
|
|
|
|
%ConvertToSubClassCode
|
2017-06-20 11:14:25 +02:00
|
|
|
if ( dynamic_cast<QgsComposerHtml *>( sipCpp ) != NULL )
|
|
|
|
sipType = sipType_QgsComposerHtml;
|
|
|
|
else if ( dynamic_cast<QgsComposerAttributeTableV2 *>( sipCpp ) != NULL )
|
|
|
|
sipType = sipType_QgsComposerAttributeTableV2;
|
|
|
|
else if ( dynamic_cast<QgsComposerTableV2 *>( sipCpp ) != NULL )
|
|
|
|
sipType = sipType_QgsComposerTableV2;
|
|
|
|
else if ( dynamic_cast<QgsComposerMultiFrame *>( sipCpp ) != NULL )
|
|
|
|
sipType = sipType_QgsComposerMultiFrame;
|
|
|
|
else
|
|
|
|
sipType = NULL;
|
2012-08-09 11:10:55 +02:00
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
public:
|
2012-08-09 11:10:55 +02:00
|
|
|
|
|
|
|
enum ResizeMode
|
|
|
|
{
|
2017-06-20 11:14:25 +02:00
|
|
|
UseExistingFrames,
|
|
|
|
ExtendToNextPage,
|
|
|
|
RepeatOnEveryPage,
|
|
|
|
RepeatUntilFinished
|
2012-08-09 11:10:55 +02:00
|
|
|
};
|
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
QgsComposerMultiFrame( QgsComposition *c /TransferThis/, bool createUndoCommands );
|
2017-06-20 11:14:25 +02:00
|
|
|
%Docstring
|
|
|
|
Construct a new multiframe item.
|
|
|
|
\param c parent composition
|
|
|
|
\param createUndoCommands
|
|
|
|
%End
|
2014-09-17 21:52:19 +10:00
|
|
|
|
2012-08-09 11:10:55 +02:00
|
|
|
virtual ~QgsComposerMultiFrame();
|
2014-09-17 21:52:19 +10:00
|
|
|
|
2012-08-09 11:10:55 +02:00
|
|
|
virtual QSizeF totalSize() const = 0;
|
2017-06-20 11:14:25 +02:00
|
|
|
%Docstring
|
|
|
|
Returns the total size of the multiframe's content.
|
|
|
|
:return: total size required for content
|
|
|
|
:rtype: QSizeF
|
|
|
|
%End
|
2014-11-13 23:13:13 +01:00
|
|
|
|
2014-09-17 21:52:19 +10:00
|
|
|
virtual QSizeF fixedFrameSize( const int frameIndex = -1 ) const;
|
2017-06-20 11:14:25 +02:00
|
|
|
%Docstring
|
|
|
|
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().
|
|
|
|
\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.
|
|
|
|
.. versionadded:: 2.5
|
|
|
|
.. seealso:: minFrameSize
|
|
|
|
.. seealso:: recalculateFrameRects
|
|
|
|
:rtype: QSizeF
|
|
|
|
%End
|
2014-11-13 23:13:13 +01:00
|
|
|
|
2014-09-17 21:52:19 +10:00
|
|
|
virtual QSizeF minFrameSize( const int frameIndex = -1 ) const;
|
2017-06-20 11:14:25 +02:00
|
|
|
%Docstring
|
|
|
|
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().
|
|
|
|
\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.
|
|
|
|
.. versionadded:: 2.5
|
|
|
|
.. seealso:: fixedFrameSize
|
|
|
|
.. seealso:: recalculateFrameRects
|
|
|
|
:rtype: QSizeF
|
|
|
|
%End
|
2014-11-13 23:13:13 +01:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual void render( QPainter *painter, const QRectF &renderExtent, const int frameIndex ) = 0;
|
2017-06-20 11:14:25 +02:00
|
|
|
%Docstring
|
|
|
|
Renders a portion of the multiframe's content into a painter.
|
|
|
|
\param painter destination painter
|
|
|
|
\param renderExtent visible extent of content to render into the painter.
|
|
|
|
\param frameIndex frame number for content
|
|
|
|
.. versionadded:: 2.5
|
|
|
|
%End
|
2012-08-09 11:10:55 +02:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual void addFrame( QgsComposerFrame *frame /Transfer/, bool recalcFrameSizes = true ) = 0;
|
2017-06-20 11:14:25 +02:00
|
|
|
%Docstring
|
|
|
|
Adds a frame to the multiframe.
|
|
|
|
\param frame frame to add
|
|
|
|
\param recalcFrameSizes set to true to force recalculation of all existing frame sizes
|
|
|
|
.. seealso:: removeFrame
|
|
|
|
%End
|
2012-08-09 11:10:55 +02:00
|
|
|
|
2014-05-07 07:54:07 +10:00
|
|
|
virtual double findNearbyPageBreak( double yPos );
|
2017-06-20 11:14:25 +02:00
|
|
|
%Docstring
|
|
|
|
Finds the optimal position to break a frame at.
|
|
|
|
\param yPos maximum vertical position for break
|
|
|
|
:return: the optimal breakable position which occurs in the multi frame close
|
|
|
|
to and before the specified yPos
|
|
|
|
.. versionadded:: 2.3
|
|
|
|
:rtype: float
|
|
|
|
%End
|
2014-05-27 23:22:50 +02:00
|
|
|
|
2014-09-29 22:19:02 +10:00
|
|
|
void removeFrame( int i, const bool removeEmptyPages = false );
|
2017-06-20 11:14:25 +02:00
|
|
|
%Docstring
|
|
|
|
Removes a frame from the multiframe. This method automatically removes the frame from the
|
|
|
|
composition.
|
|
|
|
\param i index of frame to remove
|
|
|
|
\param removeEmptyPages set to true to remove pages which are empty after the frame is removed
|
|
|
|
.. seealso:: addFrame
|
|
|
|
.. seealso:: deleteFrames
|
|
|
|
%End
|
2014-11-13 23:13:13 +01:00
|
|
|
|
2014-09-17 21:52:19 +10:00
|
|
|
void deleteFrames();
|
2017-06-20 11:14:25 +02:00
|
|
|
%Docstring
|
|
|
|
Removes and deletes all child frames.
|
|
|
|
.. seealso:: removeFrame
|
|
|
|
%End
|
2012-08-09 11:10:55 +02:00
|
|
|
|
|
|
|
void setResizeMode( ResizeMode mode );
|
2017-06-20 11:14:25 +02:00
|
|
|
%Docstring
|
|
|
|
Sets the resize mode for the multiframe, and recalculates frame sizes to match.
|
|
|
|
\param mode resize mode
|
|
|
|
.. seealso:: resizeMode
|
|
|
|
%End
|
2014-11-13 23:13:13 +01:00
|
|
|
|
2012-08-09 11:10:55 +02:00
|
|
|
ResizeMode resizeMode() const;
|
2017-06-20 11:14:25 +02:00
|
|
|
%Docstring
|
|
|
|
Returns the resize mode for the multiframe.
|
|
|
|
:return: resize mode
|
|
|
|
.. seealso:: setResizeMode
|
|
|
|
:rtype: ResizeMode
|
|
|
|
%End
|
2012-08-09 11:10:55 +02:00
|
|
|
|
2017-05-03 07:45:22 +02:00
|
|
|
virtual bool writeXml( QDomElement &elem, QDomDocument &doc, bool ignoreFrames = false ) const = 0;
|
2017-06-20 11:14:25 +02:00
|
|
|
%Docstring
|
|
|
|
Stores state information about multiframe in DOM element. Implementations of writeXml
|
|
|
|
should also call the _writeXML method to save general multiframe properties.
|
|
|
|
\param elem is DOM element
|
|
|
|
\param doc is the DOM document
|
|
|
|
\param ignoreFrames set to false to avoid writing state information about child frames into DOM
|
|
|
|
.. seealso:: _writeXML
|
|
|
|
:rtype: bool
|
|
|
|
%End
|
2014-11-13 23:13:13 +01:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
bool _writeXml( QDomElement &elem, QDomDocument &doc, bool ignoreFrames = false ) const;
|
2017-06-20 11:14:25 +02:00
|
|
|
%Docstring
|
|
|
|
Stores state information about base multiframe object in DOM element. Implementations of writeXml
|
|
|
|
should call this method.
|
|
|
|
\param elem is DOM element
|
|
|
|
\param doc is the DOM document
|
|
|
|
\param ignoreFrames set to false to avoid writing state information about child frames into DOM
|
|
|
|
.. seealso:: writeXml
|
|
|
|
:rtype: bool
|
|
|
|
%End
|
2012-08-09 11:10:55 +02:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual bool readXml( const QDomElement &itemElem, const QDomDocument &doc, bool ignoreFrames = false ) = 0;
|
2017-06-20 11:14:25 +02:00
|
|
|
%Docstring
|
|
|
|
Reads multiframe state information from a DOM element. Implementations of readXml
|
|
|
|
should also call the _readXML method to restore general multiframe properties.
|
|
|
|
\param itemElem is DOM element
|
|
|
|
\param doc is the DOM document
|
|
|
|
\param ignoreFrames set to false to avoid read state information about child frames from DOM
|
|
|
|
.. seealso:: _readXML
|
|
|
|
:rtype: bool
|
|
|
|
%End
|
2014-11-13 23:13:13 +01:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
bool _readXml( const QDomElement &itemElem, const QDomDocument &doc, bool ignoreFrames = false );
|
2017-06-20 11:14:25 +02:00
|
|
|
%Docstring
|
|
|
|
Restores state information about base multiframe object from a DOM element. Implementations of readXml
|
|
|
|
should call this method.
|
|
|
|
\param itemElem is DOM element
|
|
|
|
\param doc is the DOM document
|
|
|
|
\param ignoreFrames set to false to avoid reading state information about child frames from DOM
|
|
|
|
.. seealso:: readXml
|
|
|
|
:rtype: bool
|
|
|
|
%End
|
2012-08-09 11:10:55 +02:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
QgsComposition *composition();
|
2017-06-20 11:14:25 +02:00
|
|
|
%Docstring
|
|
|
|
Returns the parent composition for the multiframe.
|
|
|
|
:return: composition
|
|
|
|
:rtype: QgsComposition
|
|
|
|
%End
|
2012-08-09 11:10:55 +02:00
|
|
|
|
|
|
|
bool createUndoCommands() const;
|
2017-06-20 11:14:25 +02:00
|
|
|
%Docstring
|
|
|
|
Returns whether undo commands should be created for interactions with the multiframe.
|
|
|
|
:return: true if undo commands should be created
|
|
|
|
.. seealso:: setCreateUndoCommands
|
|
|
|
:rtype: bool
|
|
|
|
%End
|
2014-11-13 23:13:13 +01:00
|
|
|
|
2012-08-09 11:10:55 +02:00
|
|
|
void setCreateUndoCommands( bool enabled );
|
2017-06-20 11:14:25 +02:00
|
|
|
%Docstring
|
|
|
|
Sets whether undo commands should be created for interactions with the multiframe.
|
|
|
|
\param enabled set to true if undo commands should be created
|
|
|
|
.. seealso:: createUndoCommands
|
|
|
|
%End
|
2012-08-09 11:10:55 +02:00
|
|
|
|
2012-09-19 17:15:39 +02:00
|
|
|
int frameCount() const;
|
2017-06-20 11:14:25 +02:00
|
|
|
%Docstring
|
|
|
|
Returns the number of frames associated with this multiframe.
|
|
|
|
:return: number of child frames
|
|
|
|
*
|
|
|
|
:rtype: int
|
|
|
|
%End
|
|
|
|
|
|
|
|
QgsComposerFrame *frame( int i ) const;
|
|
|
|
%Docstring
|
|
|
|
Returns a child frame from the multiframe.
|
|
|
|
\param i index of frame
|
|
|
|
:return: child frame if found
|
|
|
|
.. seealso:: frameIndex
|
|
|
|
:rtype: QgsComposerFrame
|
|
|
|
%End
|
2014-11-13 23:13:13 +01:00
|
|
|
|
|
|
|
int frameIndex( QgsComposerFrame *frame ) const;
|
2017-06-20 11:14:25 +02:00
|
|
|
%Docstring
|
|
|
|
Returns the index of a frame within the multiframe
|
|
|
|
\param frame frame to find index of
|
|
|
|
:return: index for frame if found, -1 if frame not found in multiframe
|
|
|
|
.. versionadded:: 2.5
|
|
|
|
.. seealso:: frame
|
|
|
|
:rtype: int
|
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
QgsComposerFrame *createNewFrame( QgsComposerFrame *currentFrame, QPointF pos, QSizeF size );
|
2017-06-20 11:14:25 +02:00
|
|
|
%Docstring
|
|
|
|
Creates a new frame and adds it to the multi frame and composition.
|
|
|
|
\param currentFrame an existing QgsComposerFrame from which to copy the size
|
|
|
|
and general frame properties (e.g., frame style, background, rendering settings).
|
|
|
|
\param pos position of top-left corner of the new frame
|
|
|
|
\param size size of the new frame
|
|
|
|
:return: new QgsComposerFrame
|
|
|
|
.. versionadded:: 2.3
|
|
|
|
:rtype: QgsComposerFrame
|
|
|
|
%End
|
2014-05-07 07:54:07 +10:00
|
|
|
|
2014-07-29 21:28:39 +10:00
|
|
|
virtual QString displayName() const;
|
2017-06-20 11:14:25 +02:00
|
|
|
%Docstring
|
|
|
|
Get multiframe display name.
|
|
|
|
:return: display name for item
|
|
|
|
.. versionadded:: 2.5
|
|
|
|
:rtype: str
|
|
|
|
%End
|
2014-08-17 13:37:26 +02:00
|
|
|
|
2014-05-07 07:54:07 +10:00
|
|
|
public slots:
|
|
|
|
|
2014-09-17 21:52:19 +10:00
|
|
|
void update();
|
2017-06-20 11:14:25 +02:00
|
|
|
%Docstring
|
|
|
|
Forces a redraw of all child frames.
|
|
|
|
%End
|
2014-09-17 21:52:19 +10:00
|
|
|
|
|
|
|
virtual void recalculateFrameSizes();
|
2017-06-20 11:14:25 +02:00
|
|
|
%Docstring
|
|
|
|
Recalculates the portion of the multiframe item which is shown in each of it's
|
|
|
|
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:: recalculateFrameRects
|
|
|
|
%End
|
2014-05-07 07:54:07 +10:00
|
|
|
|
2014-09-17 21:52:19 +10:00
|
|
|
void recalculateFrameRects();
|
2017-06-20 11:14:25 +02:00
|
|
|
%Docstring
|
|
|
|
Forces a recalculation of all the associated frame's scene rectangles. This
|
|
|
|
method is useful for multiframes which implement a minFrameSize() or
|
|
|
|
fixedFrameSize() method.
|
|
|
|
.. versionadded:: 2.5
|
|
|
|
.. seealso:: minFrameSize()
|
|
|
|
.. seealso:: fixedFrameSize()
|
|
|
|
.. seealso:: recalculateFrameSizes
|
|
|
|
%End
|
|
|
|
|
|
|
|
void handleFrameRemoval( QgsComposerItem *item );
|
|
|
|
%Docstring
|
|
|
|
Called before a frame is going to be removed. Updates frame list and recalculates
|
|
|
|
content of remaining frames.
|
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
|
|
|
signals:
|
2014-09-17 21:52:19 +10:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
void changed();
|
2017-06-20 11:14:25 +02:00
|
|
|
%Docstring
|
|
|
|
Emitted when the properties of a multi frame have changed, and the GUI item widget
|
|
|
|
must be updated.
|
|
|
|
%End
|
2014-08-17 13:37:26 +02:00
|
|
|
|
2014-07-10 19:16:28 +10:00
|
|
|
void contentsChanged();
|
2017-06-20 11:14:25 +02:00
|
|
|
%Docstring
|
|
|
|
Emitted when the contents of the multi frame have changed and the frames
|
|
|
|
must be redrawn.
|
|
|
|
%End
|
2014-11-13 23:13:13 +01:00
|
|
|
|
2017-06-20 11:14:25 +02:00
|
|
|
protected:
|
2014-09-17 21:52:19 +10:00
|
|
|
|
|
|
|
|
2017-06-20 11:14:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
protected slots:
|
|
|
|
|
2014-11-13 23:13:13 +01:00
|
|
|
void handlePageChange();
|
2017-06-20 11:14:25 +02:00
|
|
|
%Docstring
|
|
|
|
Adapts to changed number of composition pages if resize type is RepeatOnEveryPage.
|
|
|
|
%End
|
2014-11-13 23:13:13 +01:00
|
|
|
|
2012-08-17 13:47:03 +02:00
|
|
|
};
|
2017-06-20 11:14:25 +02:00
|
|
|
|
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/composer/qgscomposermultiframe.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|