16#ifndef QGSLAYOUTMULTIFRAME_H
17#define QGSLAYOUTMULTIFRAME_H
37class QStyleOptionGraphicsItem;
64 case QGraphicsItem::UserType + 112:
65 sipType = sipType_QgsLayoutItemHtml;
68 case QGraphicsItem::UserType + 113:
69 sipType = sipType_QgsLayoutItemAttributeTable;
72 case QGraphicsItem::UserType + 114:
73 sipType = sipType_QgsLayoutItemTextTable;
76 case QGraphicsItem::UserType + 116:
77 sipType = sipType_QgsLayoutItemManualTable;
136 QString
uuid()
const {
return mUuid; }
163 virtual QSizeF fixedFrameSize(
int frameIndex = -1 )
const;
175 virtual QSizeF minFrameSize(
int frameIndex = -1 )
const;
212 void removeFrame(
int index,
bool removeEmptyPages =
false );
240 bool writeXml( QDomElement &parentElement, QDomDocument &document,
const QgsReadWriteContext &context,
bool includeFrames =
false )
const;
250 bool readXml(
const QDomElement &itemElement,
const QDomDocument &document,
const QgsReadWriteContext &context,
bool includeFrames =
false );
256 QList<QgsLayoutFrame *> frames()
const;
289 virtual QString displayName()
const;
303 void beginCommand( const QString &commandText, UndoCommand command = UndoNone );
317 void cancelCommand();
327 virtual
void finalizeRestoreFromXml();
334 void refresh() override;
348 virtual
void recalculateFrameSizes();
358 void recalculateFrameRects();
414 void handlePageChange();
426 bool mIsRecalculatingSize = false;
428 bool mBlockUpdates = false;
429 bool mBlockUndoCommands = false;
431 QList< QString > mFrameUuids;
432 QList< QString > mFrameTemplateUuids;
436 QString mTemplateUuid;
Base class for commands to undo/redo layout and layout object changes.
static QIcon getThemeIcon(const QString &name, const QColor &fillColor=QColor(), const QColor &strokeColor=QColor())
Helper to get a theme icon.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Base class for frame items, which form a layout multiframe item.
A layout table subclass that displays attributes from a vector layer.
A layout multiframe subclass for HTML content.
A layout table subclass that displays manually entered (and formatted) content.
Contains settings and helpers relating to a render of a QgsLayoutItem.
A text table item that reads text from string lists.
Base class for graphical items within a QgsLayout.
Abstract base class for layout items with the ability to distribute the content to several frames (Qg...
virtual bool writePropertiesToElement(QDomElement &element, QDomDocument &document, const QgsReadWriteContext &context) const
Stores multiframe state within an XML DOM element.
void setResizeMode(ResizeMode mode)
Sets the resize mode for the multiframe, and recalculates frame sizes to match.
virtual QSizeF totalSize() const =0
Returns the total size of the multiframe's content, in layout units.
int frameCount() const
Returns the number of frames associated with this multiframe.
virtual void addFrame(QgsLayoutFrame *frame, bool recalcFrameSizes=true)
Adds a frame to the multiframe.
QgsLayoutMultiFrame(QgsLayout *layout)
Construct a new multiframe item, attached to the specified layout.
void contentsChanged()
Emitted when the contents of the multi frame have changed and the frames must be redrawn.
void deleteFrames()
Removes and deletes all child frames.
QgsLayoutFrame * frame(int index) const
Returns the child frame at a specified index from the multiframe.
void removeFrame(int index, bool removeEmptyPages=false)
Removes a frame by index from the multiframe.
QList< QgsLayoutFrame * > mFrameItems
friend class QgsLayoutFrame
virtual int type() const =0
Returns unique multiframe type id.
virtual QIcon icon() const
Returns the item's icon.
ResizeMode resizeMode() const
Returns the resize mode for the multiframe.
virtual double findNearbyPageBreak(double yPos)
Finds the optimal position to break a frame at.
QString uuid() const
Returns the multiframe identification string.
ResizeMode
Specifies the behavior for creating new frames to fit the multiframe's content.
@ UseExistingFrames
Don't automatically create new frames, just use existing frames.
@ RepeatOnEveryPage
Repeats the same frame on every page.
@ ExtendToNextPage
Creates new full page frames on the following page(s) until the entire multiframe content is visible.
int frameIndex(QgsLayoutFrame *frame) const
Returns the index of a frame within the multiframe.
virtual bool readPropertiesFromElement(const QDomElement &element, const QDomDocument &document, const QgsReadWriteContext &context)
Sets multiframe state from a DOM element.
UndoCommand
Multiframe item undo commands, used for collapsing undo commands.
@ UndoTableMaximumFeatures
Maximum features in table.
@ UndoTableBackgroundColor
Table background color.
@ UndoTableContentFontColor
Table content font color.
@ UndoHtmlBreakDistance
HTML page break distance.
@ UndoTableCellStyle
Table cell style.
@ UndoHtmlStylesheet
HTML stylesheet.
@ UndoTableGridStrokeWidth
Table grid stroke width.
@ UndoTableGridColor
Table grid color.
@ UndoTableHeaderFontColor
Table header font color.
@ UndoNone
No command suppression.
@ UndoTableMargin
Table margins.
@ UndoHtmlSource
HTML source.
virtual void render(QgsLayoutItemRenderContext &context, const QRectF &renderExtent, int frameIndex)=0
Renders a portion of the multiframe's content into a render context.
A base class for objects which belong to a layout.
QgsLayoutObject(QgsLayout *layout)
Constructor for QgsLayoutObject, with the specified parent layout.
Interface for layout objects which support undo/redo commands.
virtual QgsAbstractLayoutUndoCommand * createCommand(const QString &text, int id=0, QUndoCommand *parent=nullptr)=0
Creates a new layout undo command with the specified text and parent.
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
A container for the context for various read/write operations on objects.
Contains information about the context of a rendering operation.
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)