16#ifndef QGSLAYOUTITEMREGISTRY_H
17#define QGSLAYOUTITEMREGISTRY_H
27#include <QGraphicsItem>
66 int type()
const {
return mType; }
109 Q_UNUSED( properties )
110 Q_UNUSED( pathResolver )
117 QString mVisibleName;
118 QString mVisibleNamePlural;
205 int type()
const {
return mType; }
246 Q_UNUSED( properties )
247 Q_UNUSED( pathResolver )
254 QString mVisibleName;
531 QMap<int, QgsLayoutItemAbstractMetadata *> mMetadata;
532 QMap<int, QgsLayoutMultiFrameAbstractMetadata *> mMultiFrameMetadata;
553 ~TestLayoutItem() =
default;
557 void draw( QgsRenderContext &context,
const QStyleOptionGraphicsItem *itemStyle =
nullptr )
override;
561 QgsFillSymbol *mShapeStyleSymbol =
nullptr;
static QIcon getThemeIcon(const QString &name, const QColor &fillColor=QColor(), const QColor &strokeColor=QColor())
Helper to get a theme icon.
A fill symbol type, for rendering Polygon and MultiPolygon geometries.
Registry of available layout item types.
QgsLayoutItemRegistry(QObject *parent=nullptr)
Creates a new empty item registry.
void resolvePaths(int type, QVariantMap &properties, const QgsPathResolver &pathResolver, bool saving) const
Resolve paths in properties of a particular symbol layer.
bool addLayoutItemType(QgsLayoutItemAbstractMetadata *metadata)
Registers a new layout item type.
bool removeLayoutMultiFrameType(int typeId)
Unregisters a layout multiframe type.
bool removeLayoutItemType(int typeId)
Unregisters a layout item type.
void multiFrameTypeRemoved(int type)
Emitted whenever an multiframe type is removed from the registry with the specified type.
void typeAdded(int type, const QString &name)
Emitted whenever a new item type is added to the registry, with the specified type and visible name.
QgsLayoutItemAbstractMetadata * itemMetadata(int type) const
Returns the metadata for the specified item type.
bool addLayoutMultiFrameType(QgsLayoutMultiFrameAbstractMetadata *metadata)
Registers a new layout multiframe type.
@ LayoutManualTable
Manual (fixed) table.
@ LayoutElevationProfile
Elevation profile item.
@ LayoutPicture
Picture item.
@ LayoutGroup
Grouped item.
@ LayoutAttributeTable
Attribute table.
@ LayoutPolyline
Polyline shape item.
@ LayoutScaleBar
Scale bar item.
@ LayoutItem
Base class for items.
@ LayoutLegend
Legend item.
@ LayoutMarker
Marker item.
@ LayoutHtml
Html multiframe item.
@ PluginItem
Starting point for plugin item types.
@ LayoutTextTable
Preset text table.
@ LayoutFrame
Frame item, part of a QgsLayoutMultiFrame object.
@ LayoutPolygon
Polygon shape item.
QgsLayoutMultiFrameAbstractMetadata * multiFrameMetadata(int type) const
Returns the metadata for the specified multiframe type.
void multiFrameTypeAdded(int type, const QString &name)
Emitted whenever a new multiframe type is added to the registry, with the specified type and visible ...
QgsLayoutItem * createItem(int type, QgsLayout *layout) const
Creates a new instance of a layout item given the item type, and target layout.
void typeRemoved(int type)
Emitted whenever an item type is removed from the registry with the specified type.
QgsLayoutItemRegistry(const QgsLayoutItemRegistry &rh)=delete
QMap< int, QString > itemTypes() const
Returns a map of available item types to translated name.
QgsLayoutItemRegistry & operator=(const QgsLayoutItemRegistry &rh)=delete
QgsLayoutMultiFrame * createMultiFrame(int type, QgsLayout *layout) const
Creates a new instance of a layout multiframe given the multiframe type, and target layout.
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...
A graphical widget to display and interact with QgsLayouts.
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
Resolves relative paths into absolute paths and vice versa.
std::function< QgsLayoutMultiFrame *(QgsLayout *)> QgsLayoutMultiFrameCreateFunc
Layout multiframe creation function.
std::function< QgsLayoutItem *(QgsLayout *)> QgsLayoutItemCreateFunc
Layout item creation function.
std::function< void(QVariantMap &, const QgsPathResolver &, bool)> QgsLayoutMultiFramePathResolverFunc
Layout multiframe path resolver function.
std::function< void(QVariantMap &, const QgsPathResolver &, bool)> QgsLayoutItemPathResolverFunc
Layout item path resolver function.