16#ifndef QGSLAYOUTITEMGUIREGISTRY_H
17#define QGSLAYOUTITEMGUIREGISTRY_H
24#include <QGraphicsItem>
51 FlagNoCreationTools = 1 << 1,
67 , mIsNodeBased( isNodeBased )
68 , mName( visibleName )
77 int type()
const {
return mType; }
87 QString
groupId()
const {
return mGroupId; }
167 bool mIsNodeBased =
false;
210 , mIcon( creationIcon )
211 , mWidgetFunc( pfWidget )
212 , mRubberBandFunc( pfRubberBand )
213 , mCreateFunc( pfCreateFunc )
309 void newItemAddedToLayout(
QgsLayoutItem *item,
const QVariantMap &properties );
340 QgsLayoutItemGuiGroup(
const QString &
id = QString(),
const QString &name = QString(),
const QIcon &icon = QIcon() )
409 int metadataIdForItemType(
int type )
const;
421 bool removeLayoutItemGuiMetadata(
int type );
451 bool removeItemGroup(
const QString &
id );
488 void newItemAddedToLayout(
int metadataId,
QgsLayoutItem *item,
const QVariantMap &properties = QVariantMap() );
528 QList<int> itemMetadataIds()
const;
558 QMap<int, QgsLayoutItemAbstractGuiMetadata *> mMetadata;
560 QMap<QString, QgsLayoutItemGuiGroup> mItemGroups;
MouseHandlesAction
Action to be performed by the mouse handles.
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
void typeRemoved(int metadataId)
Emitted whenever an item type is removed from the registry, with the specified metadataId.
void groupRemoved(QString groupId)
Emitted whenever an item group is removed from the registry.
QgsLayoutItemGuiRegistry(const QgsLayoutItemGuiRegistry &rh)=delete
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.
An abstract base class for temporary rubber band items in various shapes, for use within QgsLayoutVie...
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< void(QgsLayoutItem *, Qgis::MouseHandlesAction action)> QgsLayoutItemDoubleClickedFunc
Layout item double clicked.
std::function< QgsLayoutViewRubberBand *(QgsLayoutView *)> QgsLayoutItemRubberBandFunc
Layout rubber band creation function.
std::function< QGraphicsItem *(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.