1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266
|
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/annotations/qgsannotationitemguiregistry.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
class QgsAnnotationItemAbstractGuiMetadata
{
%Docstring(signature="appended")
Stores GUI metadata about one annotation item class.
This is a companion to :py:class:`QgsAnnotationItemAbstractMetadata`,
storing only the components related to the GUI behavior of an annotation
item.
.. note::
In C++ you can use :py:class:`QgsAnnotationItemGuiMetadata` convenience class.
.. versionadded:: 3.22
%End
%TypeHeaderCode
#include "qgsannotationitemguiregistry.h"
%End
public:
QgsAnnotationItemAbstractGuiMetadata( const QString &type, const QString &visibleName, const QString &groupId = QString(), Qgis::AnnotationItemGuiFlags flags = Qgis::AnnotationItemGuiFlags() );
%Docstring
Constructor for QgsAnnotationItemAbstractGuiMetadata with the specified
class ``type``.
``visibleName`` should be set to a translated, user visible name
identifying the corresponding annotation item.
An optional ``groupId`` can be set, which allows grouping of related
annotation item classes. See :py:class:`QgsAnnotationItemGuiMetadata`
for details.
%End
virtual ~QgsAnnotationItemAbstractGuiMetadata();
QString type() const;
%Docstring
Returns the unique item type code for the annotation item class.
%End
Qgis::AnnotationItemGuiFlags flags() const;
%Docstring
Returns item flags.
%End
QString groupId() const;
%Docstring
Returns the item group ID, if set.
%End
QString visibleName() const;
%Docstring
Returns a translated, user visible name identifying the corresponding
annotation item.
%End
virtual QIcon creationIcon() const;
%Docstring
Returns an icon representing creation of the annotation item type.
%End
virtual QgsAnnotationItemBaseWidget *createItemWidget( QgsAnnotationItem *item ) /TransferBack/;
%Docstring
Creates a configuration widget for an ``item`` of this type. Can return
``None`` if no configuration GUI is required.
%End
virtual QgsCreateAnnotationItemMapToolInterface *createMapTool( QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget ) /TransferBack/;
%Docstring
Creates a map tool for a creating a new item of this type.
May return ``None`` if no map tool is available for creating the item.
%End
virtual QgsAnnotationItem *createItem() /TransferBack/;
%Docstring
Creates an instance of the corresponding item type.
%End
virtual void newItemAddedToLayer( QgsAnnotationItem *item, QgsAnnotationLayer *layer );
%Docstring
Called when a newly created item of the associated type has been added
to a ``layer``.
This is only called for additions which result from GUI operations -
i.e. it is not called for items added programmatically.
%End
};
class QgsAnnotationItemGuiGroup
{
%Docstring(signature="appended")
Stores GUI metadata about a group of annotation item classes.
:py:class:`QgsAnnotationItemGuiGroup` stores settings about groups of
related annotation item classes which should be presented to users
grouped together.
For instance, the various basic shape creation tools would use
:py:class:`QgsAnnotationItemGuiGroup` to display grouped within
toolbars.
.. versionadded:: 3.22
%End
%TypeHeaderCode
#include "qgsannotationitemguiregistry.h"
%End
public:
QgsAnnotationItemGuiGroup( const QString &id = QString(), const QString &name = QString(), const QIcon &icon = QIcon() );
%Docstring
Constructor for QgsAnnotationItemGuiGroup.
%End
QString id;
QString name;
QIcon icon;
};
class QgsAnnotationItemGuiRegistry : QObject
{
%Docstring(signature="appended")
Registry of available annotation item GUI behavior.
:py:class:`QgsAnnotationItemGuiRegistry` is not usually directly
created, but rather accessed through
:py:func:`QgsGui.annotationItemGuiRegistry()`.
This acts as a companion to :py:class:`QgsAnnotationItemRegistry`,
handling only the components related to the GUI behavior of annotation
items.
.. versionadded:: 3.22
%End
%TypeHeaderCode
#include "qgsannotationitemguiregistry.h"
%End
public:
QgsAnnotationItemGuiRegistry( QObject *parent = 0 );
%Docstring
Creates a new empty item GUI registry.
QgsAnnotationItemGuiRegistry is not usually directly created, but rather
accessed through :py:func:`QgsGui.annotationItemGuiRegistry()`.
%End
~QgsAnnotationItemGuiRegistry();
QgsAnnotationItemAbstractGuiMetadata *itemMetadata( int metadataId ) const;
%Docstring
Returns the metadata for the specified item ``metadataId``. Returns
``None`` if a corresponding ``metadataId`` was not found in the
registry.
%End
int metadataIdForItemType( const QString &type ) const;
%Docstring
Returns the GUI item metadata ID which corresponds to the specified
annotation item ``type``.
In the case that multiple GUI metadata classes exist for a single
annotation item ``type`` then only the first encountered GUI metadata ID
will be returned.
Returns -1 if no matching metadata is found in the GUI registry.
%End
bool addAnnotationItemGuiMetadata( QgsAnnotationItemAbstractGuiMetadata *metadata /Transfer/ );
%Docstring
Registers the gui metadata for a new annotation item type. Takes
ownership of the metadata instance.
%End
bool addItemGroup( const QgsAnnotationItemGuiGroup &group );
%Docstring
Registers a new item group with the registry. This must be done before
calling
:py:func:`~QgsAnnotationItemGuiRegistry.addAnnotationItemGuiMetadata`
for any item types associated with the group.
Returns ``True`` if group was added, or ``False`` if group could not be
added (e.g. due to duplicate id value).
.. seealso:: :py:func:`itemGroup`
%End
const QgsAnnotationItemGuiGroup &itemGroup( const QString &id );
%Docstring
Returns a reference to the item group with matching ``id``.
.. seealso:: :py:func:`addItemGroup`
%End
QgsAnnotationItem *createItem( int metadataId ) const /TransferBack/;
%Docstring
Creates a new instance of an annotation item given the item metadata
``metadataId``.
%End
void newItemAddedToLayer( int metadataId, QgsAnnotationItem *item, QgsAnnotationLayer *layer );
%Docstring
Called when a newly created item of the associated metadata
``metadataId`` has been added to a ``layer``.
This is only called for additions which result from GUI operations -
i.e. it is not called for items added programmatically.
%End
QgsAnnotationItemBaseWidget *createItemWidget( QgsAnnotationItem *item ) const /TransferBack/;
%Docstring
Creates a new instance of an annotation item configuration widget for
the specified ``item``.
%End
QList<int> itemMetadataIds() const;
%Docstring
Returns a list of available item metadata ids handled by the registry.
%End
void addDefaultItems();
%Docstring
Populates the registry with default items.
%End
signals:
void typeAdded( int metadataId );
%Docstring
Emitted whenever a new item type is added to the registry, with the
specified ``metadataId``.
%End
private:
QgsAnnotationItemGuiRegistry( const QgsAnnotationItemGuiRegistry &rh );
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/annotations/qgsannotationitemguiregistry.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
|