15 #ifndef QGSCONDITIONALSTYLE_H
16 #define QGSCONDITIONALSTYLE_H
18 #include "qgis_core.h"
23 #include <QDomDocument>
72 void setFieldStyles(
const QString &fieldName,
const QList<QgsConditionalStyle> &styles );
79 QList<QgsConditionalStyle> fieldStyles(
const QString &fieldName )
const;
93 bool writeXml( QDomNode &node, QDomDocument &doc,
const QgsReadWriteContext &context )
const;
99 bool rulesNeedGeometry()
const;
111 QHash<QString, QgsConditionalStyles> mFieldStyles;
145 QPixmap renderPreview(
const QSize &size = QSize() )
const;
151 void setName(
const QString &value ) { mName = value; mValid =
true; }
158 void setRule(
const QString &value ) { mRule = value; mValid =
true; }
170 void setTextColor(
const QColor &value ) { mTextColor = value; mValid =
true; }
176 void setFont(
const QFont &value ) { mFont = value; mValid =
true; }
188 QString displayText()
const;
194 QString
name()
const {
return mName; }
200 QPixmap
icon()
const {
return mIcon; }
219 bool validTextColor()
const;
232 bool validBackgroundColor()
const;
238 QFont
font()
const {
return mFont; }
245 QString
rule()
const {
return mRule; }
261 static QList<QgsConditionalStyle> matchingConditionalStyles(
const QList<QgsConditionalStyle> &styles,
const QVariant &value,
QgsExpressionContext &context );
288 bool writeXml( QDomNode &node, QDomDocument &doc,
const QgsReadWriteContext &context )
const;
294 SIP_PYOBJECT __repr__();
297 if ( !sipCpp->name().isEmpty() )
298 str = QStringLiteral(
"<QgsConditionalStyle: '%1' (%2)>" ).arg( sipCpp->name(), sipCpp->rule() );
300 str = QStringLiteral(
"<QgsConditionalStyle: %2>" ).arg( sipCpp->rule() );
301 sipRes = PyUnicode_FromString(
str.toUtf8().constData() );
310 std::unique_ptr<QgsSymbol> mSymbol;
317 #endif // QGSCONDITIONALSTYLE_H