16#ifndef QGSLAYOUTITEMGUIREGISTRY_H
17#define QGSLAYOUTITEMGUIREGISTRY_H
24#include <QGraphicsItem>
52 FlagNoCreationTools = 1 << 1,
54 Q_DECLARE_FLAGS( Flags, Flag )
68 , mIsNodeBased( isNodeBased )
69 , mName( visibleName )
78 int type()
const {
return mType; }
83 Flags
flags()
const {
return mFlags; }
88 QString
groupId()
const {
return mGroupId; }
156 bool mIsNodeBased =
false;
199 bool isNodeBased =
false,
200 QgsLayoutItemAbstractGuiMetadata::Flags flags = QgsLayoutItemAbstractGuiMetadata::Flags(),
203 , mIcon( creationIcon )
204 , mWidgetFunc( pfWidget )
205 , mRubberBandFunc( pfRubberBand )
206 , mCreateFunc( pfCreateFunc )
288 void newItemAddedToLayout(
QgsLayoutItem *item,
const QVariantMap &properties );
320 QgsLayoutItemGuiGroup(
const QString &
id = QString(),
const QString &name = QString(),
const QIcon &icon = QIcon() )
393 int metadataIdForItemType(
int type )
const;
446 void newItemAddedToLayout(
int metadataId,
QgsLayoutItem *item,
const QVariantMap &properties = QVariantMap() );
481 QAbstractGraphicsShapeItem *createNodeItemRubberBand(
int metadataId,
QgsLayoutView *view )
SIP_SKIP;
486 QList< int > itemMetadataIds()
const;
501 QMap< int, QgsLayoutItemAbstractGuiMetadata *> mMetadata;
503 QMap< QString, QgsLayoutItemGuiGroup > mItemGroups;
static QIcon getThemeIcon(const QString &name, const QColor &fillColor=QColor(), const QColor &strokeColor=QColor())
Helper to get a theme icon.
Stores GUI metadata about a group of layout item classes.
QString id
Unique (untranslated) group ID string.
QIcon icon
Icon for group.
QgsLayoutItemGuiGroup(const QString &id=QString(), const QString &name=QString(), const QIcon &icon=QIcon())
Constructor for QgsLayoutItemGuiGroup.
QString name
Translated group name.
Registry of available layout item GUI behavior.
QgsLayoutItemGuiRegistry & operator=(const QgsLayoutItemGuiRegistry &rh)=delete
QgsLayoutItemGuiRegistry cannot be copied.
QgsLayoutItemGuiRegistry(const QgsLayoutItemGuiRegistry &rh)=delete
QgsLayoutItemGuiRegistry cannot be copied.
void typeAdded(int metadataId)
Emitted whenever a new item type is added to the registry, with the specified metadataId.
Base class for graphical items within a QgsLayout.
QgsLayoutViewRubberBand is an abstract base class for temporary rubber band items in various shapes,...
A graphical widget to display and interact with QgsLayouts.
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
#define SIP_ENUM_BASETYPE(type)
std::function< void(QgsLayoutItem *, const QVariantMap &)> QgsLayoutItemAddedToLayoutFunc
Layout item added to layout callback.
std::function< QgsLayoutViewRubberBand *(QgsLayoutView *)> QgsLayoutItemRubberBandFunc
Layout rubber band creation function.
std::function< QAbstractGraphicsShapeItem *(QgsLayoutView *)> QgsLayoutNodeItemRubberBandFunc
Layout node based rubber band creation function.
std::function< QgsLayoutItemBaseWidget *(QgsLayoutItem *)> QgsLayoutItemWidgetFunc
Layout item configuration widget creation function.
std::function< QgsLayoutItem *(QgsLayout *)> QgsLayoutItemCreateFunc
Layout item creation function.