QGIS API Documentation  2.5.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Types | Public Slots | Signals | Public Member Functions | Protected Slots | Protected Attributes | List of all members
QgsComposerMultiFrame Class Referenceabstract

Abstract base class for composer entries with the ability to distribute the content to several frames (items) More...

#include <qgscomposermultiframe.h>

Inheritance diagram for QgsComposerMultiFrame:
Inheritance graph
[legend]

Public Types

enum  ResizeMode { UseExistingFrames = 0, ExtendToNextPage, RepeatOnEveryPage, RepeatUntilFinished }
 
- Public Types inherited from QgsComposerObject
enum  DataDefinedProperty {
  NoProperty = 0, AllProperties, TestProperty, PresetPaperSize,
  PaperWidth, PaperHeight, NumPages, PaperOrientation,
  PageNumber, PositionX, PositionY, ItemWidth,
  ItemHeight, ItemRotation, Transparency, BlendMode,
  MapRotation, MapScale, MapXMin, MapYMin,
  MapXMax, MapYMax, PictureSource, SourceUrl
}
 Data defined properties for different item types. More...
 
enum  PropertyValueType { EvaluatedValue = 0, OriginalValue }
 Specifies whether the value returned by a function should be the original, user set value, or the current evaluated value for the property. More...
 

Public Slots

void recalculateFrameSizes ()
 Recalculates the portion of the multiframe item which is shown in each of it's component frames. More...
 
- Public Slots inherited from QgsComposerObject
virtual void repaint ()
 Triggers a redraw for the item. More...
 
virtual void refreshDataDefinedProperty (const DataDefinedProperty property=AllProperties)
 Refreshes a data defined property for the item by reevaluating the property's value and redrawing the item with this new value. More...
 

Signals

void changed ()
 
void contentsChanged ()
 Emitted when the contents of the multi frame have changed and the frames must be redrawn. More...
 
- Signals inherited from QgsComposerObject
void itemChanged ()
 Emitted when the item changes. More...
 

Public Member Functions

 QgsComposerMultiFrame (QgsComposition *c, bool createUndoCommands)
 
virtual ~QgsComposerMultiFrame ()
 
virtual QSizeF totalSize () const =0
 
virtual void render (QPainter *p, const QRectF &renderExtent)=0
 
virtual void addFrame (QgsComposerFrame *frame, bool recalcFrameSizes=true)=0
 
virtual double findNearbyPageBreak (double yPos)
 Finds the optimal position to break a frame at. More...
 
void removeFrame (int i)
 
void update ()
 
void setResizeMode (ResizeMode mode)
 
ResizeMode resizeMode () const
 
virtual bool writeXML (QDomElement &elem, QDomDocument &doc, bool ignoreFrames=false) const =0
 
bool _writeXML (QDomElement &elem, QDomDocument &doc, bool ignoreFrames=false) const
 
virtual bool readXML (const QDomElement &itemElem, const QDomDocument &doc, bool ignoreFrames=false)=0
 
bool _readXML (const QDomElement &itemElem, const QDomDocument &doc, bool ignoreFrames=false)
 
QgsCompositioncomposition ()
 
bool createUndoCommands () const
 
void setCreateUndoCommands (bool enabled)
 
void deleteFrames ()
 Removes and deletes all frames from mComposition. More...
 
int frameCount () const
 Return the number of frames associated with this multiframeset. More...
 
QgsComposerFrameframe (int i) const
 
QgsComposerFramecreateNewFrame (QgsComposerFrame *currentFrame, QPointF pos, QSizeF size)
 Creates a new frame and adds it to the multi frame and composition. More...
 
virtual QString displayName () const
 Get multiframe display name. More...
 
- Public Member Functions inherited from QgsComposerObject
 QgsComposerObject (QgsComposition *composition)
 Constructor. More...
 
virtual ~QgsComposerObject ()
 
const QgsCompositioncomposition () const
 Returns the composition the item is attached to. More...
 
QgsCompositioncomposition ()
 
virtual bool writeXML (QDomElement &elem, QDomDocument &doc) const
 Stores item state in DOM element. More...
 
virtual bool readXML (const QDomElement &itemElem, const QDomDocument &doc)
 Sets item state from DOM element. More...
 
QgsDataDefineddataDefinedProperty (const DataDefinedProperty property) const
 Returns a reference to the data defined settings for one of the item's data defined properties. More...
 
void setDataDefinedProperty (const DataDefinedProperty property, const bool active, const bool useExpression, const QString &expression, const QString &field)
 Sets parameters for a data defined property for the item. More...
 

Protected Slots

void handleFrameRemoval (QgsComposerItem *item)
 Called before a frame is going to be removed (update frame list) More...
 
void handlePageChange ()
 Adapts to changed number of pages if resize type is RepeatOnEveryPage. More...
 

Protected Attributes

QList< QgsComposerFrame * > mFrameItems
 
ResizeMode mResizeMode
 
bool mCreateUndoCommands
 True: creates QgsMultiFrameCommands on internal changes (e.g. More...
 
- Protected Attributes inherited from QgsComposerObject
QgsCompositionmComposition
 
QMap
< QgsComposerObject::DataDefinedProperty,
QString > 
mDataDefinedNames
 Map of data defined properties for the item to string name to use when exporting item to xml. More...
 

Additional Inherited Members

- Protected Member Functions inherited from QgsComposerObject
bool dataDefinedEvaluate (const QgsComposerObject::DataDefinedProperty property, QVariant &expressionValue)
 Evaluate a data defined property and return the calculated value. More...
 

Detailed Description

Abstract base class for composer entries with the ability to distribute the content to several frames (items)

Member Enumeration Documentation

Enumerator
UseExistingFrames 
ExtendToNextPage 
RepeatOnEveryPage 
RepeatUntilFinished 

Constructor & Destructor Documentation

QgsComposerMultiFrame::QgsComposerMultiFrame ( QgsComposition c,
bool  createUndoCommands 
)
QgsComposerMultiFrame::~QgsComposerMultiFrame ( )
virtual

Member Function Documentation

bool QgsComposerMultiFrame::_readXML ( const QDomElement &  itemElem,
const QDomDocument &  doc,
bool  ignoreFrames = false 
)
bool QgsComposerMultiFrame::_writeXML ( QDomElement &  elem,
QDomDocument &  doc,
bool  ignoreFrames = false 
) const
virtual void QgsComposerMultiFrame::addFrame ( QgsComposerFrame frame,
bool  recalcFrameSizes = true 
)
pure virtual

Implemented in QgsComposerHtml.

void QgsComposerMultiFrame::changed ( )
signal
QgsComposition* QgsComposerMultiFrame::composition ( )
inline
void QgsComposerMultiFrame::contentsChanged ( )
signal

Emitted when the contents of the multi frame have changed and the frames must be redrawn.

QgsComposerFrame * QgsComposerMultiFrame::createNewFrame ( QgsComposerFrame currentFrame,
QPointF  pos,
QSizeF  size 
)

Creates a new frame and adds it to the multi frame and composition.

Parameters
currentFramean existing QgsComposerFrame from which to copy the size and general frame properties (eg frame style, background, rendering settings).
posposition of top-left corner of the new frame
sizesize of the new frame
Returns
new QgsComposerFrame
Note
added in version 2.3
bool QgsComposerMultiFrame::createUndoCommands ( ) const
inline
void QgsComposerMultiFrame::deleteFrames ( )

Removes and deletes all frames from mComposition.

QString QgsComposerMultiFrame::displayName ( ) const
virtual

Get multiframe display name.

Returns
display name for item
Note
added in version 2.5

Reimplemented in QgsComposerHtml.

virtual double QgsComposerMultiFrame::findNearbyPageBreak ( double  yPos)
inlinevirtual

Finds the optimal position to break a frame at.

Parameters
yPosmaximum vertical position for break
Returns
the optimal breakable position which occurs in the multi frame close to and before the specified yPos
Note
added in version 2.3

Reimplemented in QgsComposerHtml.

QgsComposerFrame * QgsComposerMultiFrame::frame ( int  i) const
int QgsComposerMultiFrame::frameCount ( ) const
inline

Return the number of frames associated with this multiframeset.

Note
added in 2.0, replaces nFrames
void QgsComposerMultiFrame::handleFrameRemoval ( QgsComposerItem item)
protectedslot

Called before a frame is going to be removed (update frame list)

void QgsComposerMultiFrame::handlePageChange ( )
protectedslot

Adapts to changed number of pages if resize type is RepeatOnEveryPage.

virtual bool QgsComposerMultiFrame::readXML ( const QDomElement &  itemElem,
const QDomDocument &  doc,
bool  ignoreFrames = false 
)
pure virtual

Implemented in QgsComposerHtml.

void QgsComposerMultiFrame::recalculateFrameSizes ( )
slot

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.

void QgsComposerMultiFrame::removeFrame ( int  i)
virtual void QgsComposerMultiFrame::render ( QPainter *  p,
const QRectF &  renderExtent 
)
pure virtual

Implemented in QgsComposerHtml.

ResizeMode QgsComposerMultiFrame::resizeMode ( ) const
inline
void QgsComposerMultiFrame::setCreateUndoCommands ( bool  enabled)
inline
void QgsComposerMultiFrame::setResizeMode ( ResizeMode  mode)
virtual QSizeF QgsComposerMultiFrame::totalSize ( ) const
pure virtual

Implemented in QgsComposerHtml.

void QgsComposerMultiFrame::update ( )
virtual bool QgsComposerMultiFrame::writeXML ( QDomElement &  elem,
QDomDocument &  doc,
bool  ignoreFrames = false 
) const
pure virtual

Implemented in QgsComposerHtml.

Member Data Documentation

bool QgsComposerMultiFrame::mCreateUndoCommands
protected

True: creates QgsMultiFrameCommands on internal changes (e.g.

changing frames )

QList<QgsComposerFrame*> QgsComposerMultiFrame::mFrameItems
protected
ResizeMode QgsComposerMultiFrame::mResizeMode
protected

The documentation for this class was generated from the following files: