15 #ifndef QGSEXPRESSIONCONTEXT_H 16 #define QGSEXPRESSIONCONTEXT_H 21 #include <QStringList> 48 bool usesGeometry =
false,
50 bool lazyEval =
false,
51 bool handlesNull =
false,
52 bool isContextual =
true )
53 :
QgsExpression::Function( fnname, params, group, helpText, usesGeometry, referencedColumns, lazyEval, handlesNull, isContextual )
95 , readOnly( readOnly )
146 bool removeVariable(
const QString& name );
154 bool hasVariable(
const QString& name )
const;
182 bool isReadOnly(
const QString& name )
const;
194 bool hasFunction(
const QString &name )
const;
228 void setFields(
const QgsFields& fields );
270 bool hasVariable(
const QString& name )
const;
288 bool isHighlightedVariable(
const QString& name )
const;
295 void setHighlightedVariables(
const QStringList& variableNames );
342 int indexOfScope(
const QString& scopeName )
const;
365 bool isReadOnly(
const QString& name )
const;
372 bool hasFunction(
const QString& name )
const;
391 int scopeCount()
const;
430 void setFields(
const QgsFields& fields );
442 void setOriginalValueVariable(
const QVariant& value );
454 void setCachedValue(
const QString& key,
const QVariant& value )
const;
463 bool hasCachedValue(
const QString& key )
const;
482 void clearCachedValues()
const;
537 static void setGlobalVariable(
const QString& name,
const QVariant& value );
545 static void setGlobalVariables(
const QgsStringMap& variables );
560 static void setProjectVariable(
const QString& name,
const QVariant& value );
568 static void setProjectVariables(
const QgsStringMap& variables );
671 static void registerContextFunctions();
675 #endif // QGSEXPRESSIONCONTEXT_H static const QString EXPR_ORIGINAL_VALUE
Inbuilt variable name for value original value variable.
Class for parsing and evaluation of expressions (formerly called "search strings").
Single variable definition for use within a QgsExpressionContextScope.
Base class for all map layer types.
static const QString EXPR_GEOMETRY_POINT_COUNT
Inbuilt variable name for point count variable.
A abstract base class for defining QgsExpression functions.
QList< QgsExpressionContextScope *> scopes()
Returns a list of scopes contained within the stack.
A item that forms part of a map composition.
QgsScopedExpressionFunction(const QString &fnname, int params, const QString &group, const QString &helpText=QString(), bool usesGeometry=false, const QStringList &referencedColumns=QStringList(), bool lazyEval=false, bool handlesNull=false, bool isContextual=true)
Container of fields for a vector layer.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
The QgsMapSettings class contains configuration for rendering of the map.
int variableCount() const
Returns the count of variables contained within the scope.
static const QString EXPR_SYMBOL_ANGLE
Inbuilt variable name for symbol angle variable.
virtual ~QgsScopedExpressionFunction()
virtual Q_DECL_DEPRECATED QVariant func(const QVariantList &, const QgsFeature *, QgsExpression *)
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
bool readOnly
True if variable should not be editable by users.
static const QString EXPR_SYMBOL_COLOR
Inbuilt variable name for symbol color variable.
std::ostream & operator<<(std::ostream &os, const QgsCoordinateReferenceSystem &r)
Output stream operator.
static const QString EXPR_FIELDS
Inbuilt variable name for fields storage.
Single scope for storing variables and functions for use within a QgsExpressionContext.
Graphics scene for map printing.
Contains utilities for working with QgsExpressionContext objects, including methods for creating scop...
static const QString EXPR_FEATURE
Inbuilt variable name for feature storage.
StaticVariable(const QString &name=QString(), const QVariant &value=QVariant(), bool readOnly=false)
Constructor for StaticVariable.
static const QString EXPR_GEOMETRY_POINT_NUM
Inbuilt variable name for point number variable.
Class used to render an Atlas, iterating over geometry features.
QString name() const
Returns the friendly display name of the context scope.
static const QString EXPR_GEOMETRY_PART_NUM
Inbuilt variable name for geometry part number variable.
static const QString EXPR_GEOMETRY_PART_COUNT
Inbuilt variable name for geometry part count variable.
Expression function for use within a QgsExpressionContextScope.
QString name
Variable name.
QVariant value
Variable value.