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 387 388 389 390 391 392 393 394 395 396
|
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/expression/qgsexpressioncontextutils.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
class QgsExpressionContextUtils
{
%Docstring(signature="appended")
Contains utilities for working with :py:class:`QgsExpressionContext`
objects, including methods for creating scopes for specific uses (e.g.,
project scopes, layer scopes).
%End
%TypeHeaderCode
#include "qgsexpressioncontextutils.h"
%End
public:
static QgsExpressionContextScope *globalScope() /Factory/;
%Docstring
Creates a new scope which contains variables and functions relating to
the global QGIS context. For instance, QGIS version numbers and
variables specified through QGIS options.
.. seealso:: :py:func:`setGlobalVariable`
%End
static QgsExpressionContextScope *formScope( const QgsFeature &formFeature = QgsFeature( ), const QString &formMode = QString() ) /Factory/;
%Docstring
Creates a new scope which contains functions and variables from the
current attribute form/table ``formFeature``. The variables and values
in this scope will reflect the current state of the form/row being
edited. The ``formMode`` (SingleEditMode etc.) is passed as text
.. versionadded:: 3.2
%End
static QgsExpressionContextScope *parentFormScope( const QgsFeature &formFeature = QgsFeature( ), const QString &formMode = QString() ) /Factory/;
%Docstring
Creates a new scope which contains functions and variables from the
current parent attribute form/table ``formFeature``. The variables and
values in this scope will reflect the current state of the parent
form/row being edited. The ``formMode`` (SingleEditMode etc.) is passed
as text
.. versionadded:: 3.14
%End
static void setGlobalVariable( const QString &name, const QVariant &value );
%Docstring
Sets a global context variable. This variable will be contained within
scopes retrieved via :py:func:`~QgsExpressionContextUtils.globalScope`.
:param name: variable name
:param value: variable value
.. seealso:: :py:func:`setGlobalVariable`
.. seealso:: :py:func:`globalScope`
.. seealso:: :py:func:`removeGlobalVariable`
%End
static void setGlobalVariables( const QVariantMap &variables );
%Docstring
Sets all global context variables. Existing global variables will be
removed and replaced with the variables specified.
:param variables: new set of global variables
.. seealso:: :py:func:`setGlobalVariable`
.. seealso:: :py:func:`globalScope`
.. seealso:: :py:func:`removeGlobalVariable`
%End
static void removeGlobalVariable( const QString &name );
%Docstring
Remove a global context variable.
:param name: variable name
.. seealso:: :py:func:`setGlobalVariable`
.. seealso:: :py:func:`setGlobalVariables`
.. seealso:: :py:func:`globalScope`
%End
static QgsExpressionContextScope *projectScope( const QgsProject *project ) /Factory/;
%Docstring
Creates a new scope which contains variables and functions relating to a
QGIS project. For instance, project path and title, and variables
specified through the project properties.
:param project: What project to use
.. seealso:: :py:func:`setProjectVariable`
%End
static void setProjectVariable( QgsProject *project, const QString &name, const QVariant &value );
%Docstring
Sets a project context variable. This variable will be contained within
scopes retrieved via :py:func:`~QgsExpressionContextUtils.projectScope`.
:param project: Project to apply changes to
:param name: variable name
:param value: variable value
.. seealso:: :py:func:`setProjectVariables`
.. seealso:: :py:func:`removeProjectVariable`
.. seealso:: :py:func:`projectScope`
%End
static void setProjectVariables( QgsProject *project, const QVariantMap &variables );
%Docstring
Sets all project context variables. Existing project variables will be
removed and replaced with the variables specified.
:param project: Project to apply changes to
:param variables: new set of project variables
.. seealso:: :py:func:`setProjectVariable`
.. seealso:: :py:func:`removeProjectVariable`
.. seealso:: :py:func:`projectScope`
%End
static void removeProjectVariable( QgsProject *project, const QString &name );
%Docstring
Remove project context variable.
:param project: Project to apply changes to
:param name: variable name
.. seealso:: :py:func:`setProjectVariable`
.. seealso:: :py:func:`setProjectVariables`
.. seealso:: :py:func:`projectScope`
%End
static QgsExpressionContextScope *layerScope( const QgsMapLayer *layer ) /Factory/;
%Docstring
Creates a new scope which contains variables and functions relating to a
:py:class:`QgsMapLayer`. For instance, layer name, id and fields.
%End
static QList<QgsExpressionContextScope *> globalProjectLayerScopes( const QgsMapLayer *layer ) /Factory/;
%Docstring
Creates a list of three scopes: global, layer's project and layer.
%End
static void setLayerVariable( QgsMapLayer *layer, const QString &name, const QVariant &value );
%Docstring
Sets a layer context variable. This variable will be contained within
scopes retrieved via :py:func:`~QgsExpressionContextUtils.layerScope`.
:param layer: map layer
:param name: variable name
:param value: variable value
.. seealso:: :py:func:`setLayerVariables`
.. seealso:: :py:func:`layerScope`
%End
static void setLayerVariables( QgsMapLayer *layer, const QVariantMap &variables );
%Docstring
Sets all layer context variables. Existing layer variables will be
removed and replaced with the variables specified.
:param layer: map layer
:param variables: new set of layer variables
.. seealso:: :py:func:`setLayerVariable`
.. seealso:: :py:func:`layerScope`
%End
static QgsExpressionContextScope *mapSettingsScope( const QgsMapSettings &mapSettings ) /Factory/;
%Docstring
Creates a new scope which contains variables and functions relating to a
:py:class:`QgsMapSettings` object. For instance, map scale and rotation.
%End
static QgsExpressionContextScope *mapToolCaptureScope( const QList<QgsPointLocator::Match> &matches ) /Factory/;
%Docstring
Sets the expression context variables which are available for
expressions triggered by a map tool capture like add feature.
%End
static QgsExpressionContextScope *mapLayerPositionScope( const QgsPointXY &position ) /Factory/;
%Docstring
Sets the expression context variables which are available for
expressions triggered by moving the mouse over a feature of the
currently selected layer.
:param position: map coordinates of the current pointer position in the
CRS of the layer which triggered the action.
.. versionadded:: 3.30
%End
static QgsExpressionContextScope *updateSymbolScope( const QgsSymbol *symbol, QgsExpressionContextScope *symbolScope = 0 );
%Docstring
Updates a symbol scope related to a :py:class:`QgsSymbol` to an
expression context.
:param symbol: symbol to extract properties from
:param symbolScope: pointer to an existing scope to update
%End
static QgsExpressionContextScope *layoutScope( const QgsLayout *layout ) /Factory/;
%Docstring
Creates a new scope which contains variables and functions relating to a
:py:class:`QgsLayout` ``layout``. For instance, number of pages and page
sizes.
%End
static void setLayoutVariable( QgsLayout *layout, const QString &name, const QVariant &value );
%Docstring
Sets a layout context variable. This variable will be contained within
scopes retrieved via :py:func:`~QgsExpressionContextUtils.layoutScope`.
:param layout: target layout
:param name: variable name
:param value: variable value
.. seealso:: :py:func:`setLayoutVariables`
.. seealso:: :py:func:`layoutScope`
%End
static void setLayoutVariables( QgsLayout *layout, const QVariantMap &variables );
%Docstring
Sets all layout context variables. Existing layout variables will be
removed and replaced with the variables specified.
:param layout: target layout
:param variables: new set of layer variables
.. seealso:: :py:func:`setLayoutVariable`
.. seealso:: :py:func:`layoutScope`
%End
static QgsExpressionContextScope *atlasScope( const QgsLayoutAtlas *atlas ) /Factory/;
%Docstring
Creates a new scope which contains variables and functions relating to a
:py:class:`QgsLayoutAtlas`. For instance, current page name and number.
:param atlas: source atlas. If ``None``, a set of default atlas
variables will be added to the scope.
%End
static QgsExpressionContextScope *layoutItemScope( const QgsLayoutItem *item ) /Factory/;
%Docstring
Creates a new scope which contains variables and functions relating to a
:py:class:`QgsLayoutItem`. For instance, item size and position.
.. seealso:: :py:func:`setLayoutItemVariable`
.. seealso:: :py:func:`setLayoutItemVariables`
%End
static void setLayoutItemVariable( QgsLayoutItem *item, const QString &name, const QVariant &value );
%Docstring
Sets a layout ``item`` context variable, with the given ``name`` and
``value``. This variable will be contained within scopes retrieved via
:py:func:`~QgsExpressionContextUtils.layoutItemScope`.
.. seealso:: :py:func:`setLayoutItemVariables`
.. seealso:: :py:func:`layoutItemScope`
%End
static void setLayoutItemVariables( QgsLayoutItem *item, const QVariantMap &variables );
%Docstring
Sets all layout item context variables for an ``item``. Existing
variables will be removed and replaced with the ``variables`` specified.
.. seealso:: :py:func:`setLayoutItemVariable`
.. seealso:: :py:func:`layoutItemScope`
%End
static QgsExpressionContextScope *multiFrameScope( const QgsLayoutMultiFrame *frame ) /Factory/;
%Docstring
Creates a new scope which contains variables and functions relating to a
:py:class:`QgsLayoutMultiFrame`.
.. seealso:: :py:func:`setLayoutMultiFrameVariable`
.. seealso:: :py:func:`setLayoutMultiFrameVariables`
.. versionadded:: 3.10
%End
static void setLayoutMultiFrameVariable( QgsLayoutMultiFrame *frame, const QString &name, const QVariant &value );
%Docstring
Sets a layout multi ``frame`` context variable, with the given ``name``
and ``value``. This variable will be contained within scopes retrieved
via :py:func:`~QgsExpressionContextUtils.multiFrameScope`.
.. seealso:: :py:func:`setLayoutItemVariables`
.. seealso:: :py:func:`multiFrameScope`
.. versionadded:: 3.10
%End
static void setLayoutMultiFrameVariables( QgsLayoutMultiFrame *frame, const QVariantMap &variables );
%Docstring
Sets all layout multiframe context variables for an ``frame``. Existing
variables will be removed and replaced with the ``variables`` specified.
.. seealso:: :py:func:`setLayoutMultiFrameVariable`
.. seealso:: :py:func:`multiFrameScope`
.. versionadded:: 3.10
%End
static QgsExpressionContext createFeatureBasedContext( const QgsFeature &feature, const QgsFields &fields );
%Docstring
Helper function for creating an expression context which contains just a
feature and fields collection. Generally this method should not be used
as the created context does not include standard scopes such as the
global and project scopes.
%End
static QgsExpressionContextScope *processingAlgorithmScope( const QgsProcessingAlgorithm *algorithm, const QVariantMap ¶meters, QgsProcessingContext &context ) /Factory/;
%Docstring
Creates a new scope which contains variables and functions relating to a
processing ``algorithm``, when used with the specified ``parameters``
and ``context``. For instance, algorithm name and parameter functions.
.. seealso:: :py:func:`processingModelAlgorithmScope`
%End
static QgsExpressionContextScope *processingModelAlgorithmScope( const QgsProcessingModelAlgorithm *model, const QVariantMap ¶meters, QgsProcessingContext &context ) /Factory/;
%Docstring
Creates a new scope which contains variables and functions relating to a
processing ``model`` algorithm, when used with the specified
``parameters`` and ``context``. For instance, model name and path
variables.
.. versionadded:: 3.6
%End
static QgsExpressionContextScope *notificationScope( const QString &message = QString() ) /Factory/;
%Docstring
Creates a new scope which contains variables and functions relating to
provider notifications
:param message: the notification message
%End
static void registerContextFunctions();
%Docstring
Registers all known core functions provided by
:py:class:`QgsExpressionContextScope` objects.
%End
static QgsExpressionContextScope *meshExpressionScope( QgsMesh::ElementType elementType ) /Factory/;
%Docstring
Creates a new scope which contains functions relating to mesh layer
element ``elementType``
.. versionadded:: 3.22
%End
public:
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/expression/qgsexpressioncontextutils.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
|