18#ifndef QGSSTOREDEXPRESSIONMANAGER_H
19#define QGSSTOREDEXPRESSIONMANAGER_H
70 :
id( QUuid::createUuid().toString() )
161 bool writeXml( QDomNode &layerNode )
const;
164 bool readXml(
const QDomNode &layerNode );
171 QList< QgsStoredExpression > mStoredExpressions;
void removeStoredExpression(const QString &id)
Removes an expression to the list.
QgsStoredExpression storedExpression(const QString &id) const
Returns an expression according to the id.
bool writeXml(QDomNode &layerNode) const
Writes the stored expressions out in XML format.
void clearStoredExpressions()
Clears list of stored expressions.
QgsStoredExpression findStoredExpressionByExpression(const QString &expression, const QgsStoredExpression::Category &tag=QgsStoredExpression::Category::All) const
Returns an expression according to the expression text.
QList< QgsStoredExpression > storedExpressions(const QgsStoredExpression::Category &tag=QgsStoredExpression::Category::All)
Returns the list of named expressions.
void addStoredExpressions(const QList< QgsStoredExpression > &storedExpressions)
Appends a list of expressions to the existing list.
QgsStoredExpressionManager()=default
void updateStoredExpression(const QString &id, const QString &name, const QString &expression, const QgsStoredExpression::Category &tag)
Updates an expression by id.
bool readXml(const QDomNode &layerNode)
Reads the stored expressions in in XML format.
QString addStoredExpression(const QString &name, const QString &expression, const QgsStoredExpression::Category &tag=QgsStoredExpression::Category::FilterExpression)
Adds an expression to the list.
Stored expression containing name, content (expression text) and a category tag.
QgsStoredExpression()=default
QString expression
expression text
Category
Categories of use cases FilterExpression for stored expressions to filter attribute table DefaultValu...
@ DefaultValueExpression
Expressions to determine default values (not yet used).
@ FilterExpression
Expressions to filter features.
QString id
generated uuid used for identification
QgsStoredExpression(const QString &name, const QString &expression, Category tag=Category::FilterExpression)
Create a new QgsStoredExpression with a generated uuid as id.
QString name
descriptive name of the expression
QgsStoredExpression::Category tag
category of the expression use case
#define SIP_ENUM_BASETYPE(type)