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 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386
|
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/layout/qgslayoutobject.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsLayoutObject: QObject, QgsExpressionContextGenerator
{
%Docstring(signature="appended")
A base class for objects which belong to a layout.
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgslayoutobject.h"
#include <qgslayoutitem.h>
#include "qgslayoutitemgroup.h"
#include "qgslayoutitemmap.h"
#include "qgslayoutitempicture.h"
#include "qgslayoutitemlabel.h"
#include "qgslayoutitemlegend.h"
#include "qgslayoutitempolygon.h"
#include "qgslayoutitempolyline.h"
#include "qgslayoutitemscalebar.h"
#include "qgslayoutframe.h"
#include "qgslayoutitemshape.h"
#include "qgslayoutitempage.h"
#include "qgslayoutitemmarker.h"
#include "qgslayoutitemelevationprofile.h"
%End
%ConvertToSubClassCode
if ( QgsLayoutItem *item = qobject_cast< QgsLayoutItem * >( sipCpp ) )
{
// the conversions have to be static, because they're using multiple inheritance
// (seen in PyQt4 .sip files for some QGraphicsItem classes)
switch ( item->type() )
{
// FREAKKKKIIN IMPORTANT!
// IF YOU PUT SOMETHING HERE, PUT IT IN QgsLayoutItem CASTING **ALSO**
// (it's not enough for it to be in only one of the places, as sip inconsistently
// decides which casting code to perform here)
// really, these *should* use the constants from QgsLayoutItemRegistry, but sip doesn't like that!
case QGraphicsItem::UserType + 101:
sipType = sipType_QgsLayoutItemGroup;
*sipCppRet = static_cast<QgsLayoutItemGroup *>( sipCpp );
break;
case QGraphicsItem::UserType + 102:
sipType = sipType_QgsLayoutItemPage;
*sipCppRet = static_cast<QgsLayoutItemPage *>( sipCpp );
break;
case QGraphicsItem::UserType + 103:
sipType = sipType_QgsLayoutItemMap;
*sipCppRet = static_cast<QgsLayoutItemMap *>( sipCpp );
break;
case QGraphicsItem::UserType + 104:
sipType = sipType_QgsLayoutItemPicture;
*sipCppRet = static_cast<QgsLayoutItemPicture *>( sipCpp );
break;
case QGraphicsItem::UserType + 105:
sipType = sipType_QgsLayoutItemLabel;
*sipCppRet = static_cast<QgsLayoutItemLabel *>( sipCpp );
break;
case QGraphicsItem::UserType + 106:
sipType = sipType_QgsLayoutItemLegend;
*sipCppRet = static_cast<QgsLayoutItemLegend *>( sipCpp );
break;
case QGraphicsItem::UserType + 107:
sipType = sipType_QgsLayoutItemShape;
*sipCppRet = static_cast<QgsLayoutItemShape *>( sipCpp );
break;
case QGraphicsItem::UserType + 108:
sipType = sipType_QgsLayoutItemPolygon;
*sipCppRet = static_cast<QgsLayoutItemPolygon *>( sipCpp );
break;
case QGraphicsItem::UserType + 109:
sipType = sipType_QgsLayoutItemPolyline;
*sipCppRet = static_cast<QgsLayoutItemPolyline *>( sipCpp );
break;
case QGraphicsItem::UserType + 110:
sipType = sipType_QgsLayoutItemScaleBar;
*sipCppRet = static_cast<QgsLayoutItemScaleBar *>( sipCpp );
break;
case QGraphicsItem::UserType + 111:
sipType = sipType_QgsLayoutFrame;
*sipCppRet = static_cast<QgsLayoutFrame *>( sipCpp );
break;
case QGraphicsItem::UserType + 117:
sipType = sipType_QgsLayoutItemMarker;
*sipCppRet = static_cast<QgsLayoutItemMarker *>( sipCpp );
break;
case QGraphicsItem::UserType + 118:
sipType = sipType_QgsLayoutItemElevationProfile;
*sipCppRet = static_cast<QgsLayoutItemElevationProfile *>( sipCpp );
break;
// did you read that comment above? NO? Go read it now. You're about to break stuff.
default:
sipType = sipType_QgsLayoutItem;
}
}
else
sipType = NULL;
%End
public:
enum DataDefinedProperty
{
NoProperty,
AllProperties,
TestProperty,
//composer page properties
PresetPaperSize,
PaperWidth,
PaperHeight,
NumPages,
PaperOrientation,
//general composer item properties
PageNumber,
PositionX,
PositionY,
ItemWidth,
ItemHeight,
ItemRotation,
Transparency,
Opacity,
BlendMode,
ExcludeFromExports,
FrameColor,
BackgroundColor,
MarginLeft,
MarginTop,
MarginRight,
MarginBottom,
//composer map
MapRotation,
MapScale,
MapXMin,
MapYMin,
MapXMax,
MapYMax,
MapAtlasMargin,
MapLayers,
MapStylePreset,
MapLabelMargin,
MapGridEnabled,
MapGridIntervalX,
MapGridIntervalY,
MapGridOffsetX,
MapGridOffsetY,
MapGridFrameSize,
MapGridFrameMargin,
MapGridLabelDistance,
MapGridCrossSize,
MapGridFrameLineThickness,
MapGridAnnotationDisplayLeft,
MapGridAnnotationDisplayRight,
MapGridAnnotationDisplayTop,
MapGridAnnotationDisplayBottom,
MapGridFrameDivisionsLeft,
MapGridFrameDivisionsRight,
MapGridFrameDivisionsTop,
MapGridFrameDivisionsBottom,
//composer picture
PictureSource,
PictureSvgBackgroundColor,
PictureSvgStrokeColor,
PictureSvgStrokeWidth,
//html item
SourceUrl,
//legend item
LegendTitle,
LegendColumnCount,
//scalebar item
ScalebarLeftSegments,
ScalebarRightSegments,
ScalebarSegmentWidth,
ScalebarMinimumWidth,
ScalebarMaximumWidth,
ScalebarHeight,
ScalebarRightSegmentSubdivisions,
ScalebarSubdivisionHeight,
ScalebarFillColor,
ScalebarFillColor2,
ScalebarLineColor,
ScalebarLineWidth,
//table item
AttributeTableSourceLayer,
MapCrs,
StartDateTime,
EndDateTime,
ElevationProfileTolerance,
ElevationProfileDistanceMajorInterval,
ElevationProfileDistanceMinorInterval,
ElevationProfileDistanceLabelInterval,
ElevationProfileElevationMajorInterval,
ElevationProfileElevationMinorInterval,
ElevationProfileElevationLabelInterval,
ElevationProfileMinimumDistance,
ElevationProfileMaximumDistance,
ElevationProfileMinimumElevation,
ElevationProfileMaximumElevation,
};
enum PropertyValueType
{
EvaluatedValue,
OriginalValue
};
static const QgsPropertiesDefinition &propertyDefinitions();
%Docstring
Returns the layout object property definitions.
%End
static bool propertyAssociatesWithParentMultiframe( DataDefinedProperty property );
%Docstring
Returns ``True`` if the specified ``property`` key is normally associated with the parent
:py:class:`QgsLayoutMultiFrame` object instead of a child :py:class:`QgsLayoutFrame` object.
While some properties like QgsLayoutObject.DataDefinedProperty.PositionX and QgsLayoutObject.DataDefinedProperty.ItemWidth
are typically associated with a direct :py:class:`QgsLayoutItem` subclass (including :py:class:`QgsLayoutFrame` objects), other properties
are instead associated with a :py:class:`QgsLayoutMultiFrame` object (such as :py:class:`QgsLayoutObject`.DataDefinedProperty.SourceUrl or :py:class:`QgsLayoutObject`.DataDefinedProperty.AttributeTableSourceLayer).
.. versionadded:: 3.18.1
%End
explicit QgsLayoutObject( QgsLayout *layout );
%Docstring
Constructor for QgsLayoutObject, with the specified parent ``layout``.
.. note::
While ownership of a QgsLayoutObject is not passed to the layout,
classes which are derived from QgsLayoutObject (such as QgsLayoutItem)
may transfer their ownership to a layout upon construction.
%End
QgsLayout *layout();
%Docstring
Returns the layout the object is attached to.
%End
QgsPropertyCollection &dataDefinedProperties();
%Docstring
Returns a reference to the object's property collection, used for data defined overrides.
.. seealso:: :py:func:`setDataDefinedProperties`
%End
void setDataDefinedProperties( const QgsPropertyCollection &collection );
%Docstring
Sets the objects's property collection, used for data defined overrides.
:param collection: property collection. Existing properties will be replaced.
.. seealso:: :py:func:`dataDefinedProperties`
.. seealso:: DataDefinedProperty
%End
void setCustomProperty( const QString &key, const QVariant &value );
%Docstring
Set a custom property for the object.
:param key: property key. If a property with the same key already exists it will be overwritten.
:param value: property value
.. seealso:: :py:func:`customProperty`
.. seealso:: :py:func:`removeCustomProperty`
.. seealso:: :py:func:`customProperties`
%End
QVariant customProperty( const QString &key, const QVariant &defaultValue = QVariant() ) const;
%Docstring
Read a custom property from the object.
:param key: property key
:param defaultValue: default value to return if property with matching key does not exist
:return: value of matching property
.. seealso:: :py:func:`setCustomProperty`
.. seealso:: :py:func:`removeCustomProperty`
.. seealso:: :py:func:`customProperties`
%End
void removeCustomProperty( const QString &key );
%Docstring
Remove a custom property from the object.
:param key: property key
.. seealso:: :py:func:`setCustomProperty`
.. seealso:: :py:func:`customProperty`
.. seealso:: :py:func:`customProperties`
%End
QStringList customProperties() const;
%Docstring
Returns list of keys stored in custom properties for the object.
.. seealso:: :py:func:`setCustomProperty`
.. seealso:: :py:func:`customProperty`
.. seealso:: :py:func:`removeCustomProperty`
%End
virtual QgsExpressionContext createExpressionContext() const;
%Docstring
Creates an expression context relating to the objects' current state. The context includes
scopes for global, project and layout properties.
%End
public slots:
virtual void refresh();
%Docstring
Refreshes the object, causing a recalculation of any property overrides.
%End
signals:
void changed();
%Docstring
Emitted when the object's properties change.
%End
protected:
bool writeObjectPropertiesToElement( QDomElement &parentElement, QDomDocument &document, const QgsReadWriteContext &context ) const;
%Docstring
Stores object properties within an XML DOM element.
:param parentElement: is the parent DOM element to store the object's properties in
:param document: DOM document
:param context: read write context
:return: ``True`` if write was successful
.. seealso:: :py:func:`readObjectPropertiesFromElement`
%End
bool readObjectPropertiesFromElement( const QDomElement &parentElement, const QDomDocument &document, const QgsReadWriteContext &context );
%Docstring
Sets object properties from a DOM element
:param parentElement: is the parent DOM element for the object
:param document: DOM document
:param context: read write context
:return: ``True`` if read was successful
.. seealso:: :py:func:`writeObjectPropertiesToElement`
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/layout/qgslayoutobject.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
|