|
| 1 | +/************************************************************************ |
| 2 | + * This file has been generated automatically from * |
| 3 | + * * |
| 4 | + * src/gui/layout/qgslayoutitemguiregistry.h * |
| 5 | + * * |
| 6 | + * Do not edit manually ! Edit header and run scripts/sipify.pl again * |
| 7 | + ************************************************************************/ |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | +class QgsLayoutItemAbstractGuiMetadata |
| 13 | +{ |
| 14 | +%Docstring |
| 15 | + Stores GUI metadata about one layout item class. |
| 16 | + |
| 17 | + This is a companion to QgsLayoutItemAbstractMetadata, storing only |
| 18 | + the components related to the GUI behavior of a layout item. |
| 19 | + |
| 20 | +.. note:: |
| 21 | + |
| 22 | + In C++ you can use QgsLayoutItemGuiMetadata convenience class. |
| 23 | +.. versionadded:: 3.0 |
| 24 | +%End |
| 25 | + |
| 26 | +%TypeHeaderCode |
| 27 | +#include "qgslayoutitemguiregistry.h" |
| 28 | +%End |
| 29 | + public: |
| 30 | + |
| 31 | + QgsLayoutItemAbstractGuiMetadata( int type ); |
| 32 | +%Docstring |
| 33 | + Constructor for QgsLayoutItemAbstractGuiMetadata with the specified class ``type``. |
| 34 | +%End |
| 35 | + |
| 36 | + virtual ~QgsLayoutItemAbstractGuiMetadata(); |
| 37 | + |
| 38 | + int type() const; |
| 39 | +%Docstring |
| 40 | + Returns the unique item type code for the layout item class. |
| 41 | + :rtype: int |
| 42 | +%End |
| 43 | + |
| 44 | + virtual QIcon creationIcon() const; |
| 45 | +%Docstring |
| 46 | + Returns an icon representing creation of the layout item type. |
| 47 | + :rtype: QIcon |
| 48 | +%End |
| 49 | + |
| 50 | + virtual QWidget *createItemWidget() /Factory/; |
| 51 | +%Docstring |
| 52 | + Creates a configuration widget for layout items of this type. Can return None if no configuration GUI is required. |
| 53 | + :rtype: QWidget |
| 54 | +%End |
| 55 | + |
| 56 | + virtual QgsLayoutViewRubberBand *createRubberBand( QgsLayoutView *view ) /Factory/; |
| 57 | +%Docstring |
| 58 | + Creates a rubber band for use when creating layout items of this type. Can return None if no rubber band |
| 59 | + should be created. The default behavior is to create a rectangular rubber band. |
| 60 | + :rtype: QgsLayoutViewRubberBand |
| 61 | +%End |
| 62 | + |
| 63 | +}; |
| 64 | + |
| 65 | + |
| 66 | + |
| 67 | + |
| 68 | +class QgsLayoutItemGuiRegistry : QObject |
| 69 | +{ |
| 70 | +%Docstring |
| 71 | + Registry of available layout item GUI behavior. |
| 72 | + |
| 73 | + QgsLayoutItemGuiRegistry is not usually directly created, but rather accessed through |
| 74 | + QgsGui.layoutItemGuiRegistry(). |
| 75 | + |
| 76 | + This acts as a companion to QgsLayoutItemRegistry, handling only |
| 77 | + the components related to the GUI behavior of layout items. |
| 78 | + |
| 79 | +.. versionadded:: 3.0 |
| 80 | +%End |
| 81 | + |
| 82 | +%TypeHeaderCode |
| 83 | +#include "qgslayoutitemguiregistry.h" |
| 84 | +%End |
| 85 | + public: |
| 86 | + |
| 87 | + QgsLayoutItemGuiRegistry( QObject *parent = 0 ); |
| 88 | +%Docstring |
| 89 | + Creates a new empty item GUI registry. |
| 90 | + |
| 91 | + QgsLayoutItemGuiRegistry is not usually directly created, but rather accessed through |
| 92 | + QgsGui.layoutItemGuiRegistry(). |
| 93 | + |
| 94 | +.. seealso:: populate() |
| 95 | +%End |
| 96 | + |
| 97 | + ~QgsLayoutItemGuiRegistry(); |
| 98 | + |
| 99 | + bool populate(); |
| 100 | +%Docstring |
| 101 | + Populates the registry with standard item types. If called on a non-empty registry |
| 102 | + then this will have no effect and will return false. |
| 103 | + :rtype: bool |
| 104 | +%End |
| 105 | + |
| 106 | + |
| 107 | + QgsLayoutItemAbstractGuiMetadata *itemMetadata( int type ) const; |
| 108 | +%Docstring |
| 109 | + Returns the metadata for the specified item ``type``. Returns None if |
| 110 | + a corresponding type was not found in the registry. |
| 111 | + :rtype: QgsLayoutItemAbstractGuiMetadata |
| 112 | +%End |
| 113 | + |
| 114 | + bool addLayoutItemGuiMetadata( QgsLayoutItemAbstractGuiMetadata *metadata /Transfer/ ); |
| 115 | +%Docstring |
| 116 | + Registers the gui metadata for a new layout item type. Takes ownership of the metadata instance. |
| 117 | + :rtype: bool |
| 118 | +%End |
| 119 | + |
| 120 | + QWidget *createItemWidget( int type ) const /Factory/; |
| 121 | +%Docstring |
| 122 | + Creates a new instance of a layout item configuration widget for the specified item ``type``. |
| 123 | + :rtype: QWidget |
| 124 | +%End |
| 125 | + |
| 126 | + |
| 127 | + QList< int > itemTypes() const; |
| 128 | +%Docstring |
| 129 | + Returns a list of available item types handled by the registry. |
| 130 | + :rtype: list of int |
| 131 | +%End |
| 132 | + |
| 133 | + signals: |
| 134 | + |
| 135 | + void typeAdded( int type ); |
| 136 | +%Docstring |
| 137 | + Emitted whenever a new item type is added to the registry, with the specified |
| 138 | + ``type``. |
| 139 | +%End |
| 140 | + |
| 141 | + private: |
| 142 | + QgsLayoutItemGuiRegistry( const QgsLayoutItemGuiRegistry &rh ); |
| 143 | +}; |
| 144 | + |
| 145 | + |
| 146 | + |
| 147 | + |
| 148 | +/************************************************************************ |
| 149 | + * This file has been generated automatically from * |
| 150 | + * * |
| 151 | + * src/gui/layout/qgslayoutitemguiregistry.h * |
| 152 | + * * |
| 153 | + * Do not edit manually ! Edit header and run scripts/sipify.pl again * |
| 154 | + ************************************************************************/ |
0 commit comments