QGIS/python/core/qgsconditionalstyle.sip

269 lines
7.8 KiB
Plaintext
Raw Normal View History

2017-04-02 11:29:03 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsconditionalstyle.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
typedef QList<QgsConditionalStyle> QgsConditionalStyles;
2015-10-19 23:53:15 +02:00
class QgsConditionalLayerStyles
{
2017-04-02 11:29:03 +02:00
%Docstring
The QgsConditionalLayerStyles class holds conditional style information
for a layer. This includes field styles and full row styles.
%End
%TypeHeaderCode
2017-04-02 11:29:03 +02:00
#include "qgsconditionalstyle.h"
%End
public:
QgsConditionalLayerStyles();
QList<QgsConditionalStyle> rowStyles();
%Docstring
:rtype: list of QgsConditionalStyle
%End
2017-04-02 11:29:03 +02:00
void setRowStyles( const QList<QgsConditionalStyle> &styles );
%Docstring
Set the conditional styles that apply to full rows of data in the attribute table.
Each row will check be checked against each rule.
2017-04-03 11:59:45 +10:00
\param styles The styles to assign to all the rows
2017-04-02 11:29:03 +02:00
.. versionadded:: 2.12
%End
void setFieldStyles( const QString &fieldName, const QList<QgsConditionalStyle> &styles );
%Docstring
Set the conditional styles for the field UI properties.
2017-04-03 11:59:45 +10:00
\param fieldName name of field
\param styles
2017-04-02 11:29:03 +02:00
%End
QList<QgsConditionalStyle> fieldStyles( const QString &fieldName );
%Docstring
Returns the conditional styles set for the field UI properties
:return: A list of conditional styles that have been set.
:rtype: list of QgsConditionalStyle
2017-04-02 11:29:03 +02:00
%End
bool readXml( const QDomNode &node, const QgsReadWriteContext &context );
2017-04-02 11:29:03 +02:00
%Docstring
Reads field ui properties specific state from Dom node.
:rtype: bool
2017-04-02 11:29:03 +02:00
%End
bool writeXml( QDomNode &node, QDomDocument &doc, const QgsReadWriteContext &context ) const;
2017-04-02 11:29:03 +02:00
%Docstring
Write field ui properties specific state from Dom node.
:rtype: bool
2017-04-02 11:29:03 +02:00
%End
};
class QgsConditionalStyle
{
2017-04-02 11:29:03 +02:00
%Docstring
Conditional styling for a rule.
%End
%TypeHeaderCode
2017-04-02 11:29:03 +02:00
#include "qgsconditionalstyle.h"
%End
public:
QgsConditionalStyle();
2017-04-02 11:29:03 +02:00
QgsConditionalStyle( const QgsConditionalStyle &other );
QgsConditionalStyle( const QString &rule );
2017-04-02 11:29:03 +02:00
bool matches( const QVariant &value, QgsExpressionContext &context ) const;
%Docstring
Check if the rule matches using the given value and feature
2017-04-03 11:59:45 +10:00
\param value The current value being checked. The "value" variable from the context is replaced with this value.
\param context Expression context for evaluating rule expression
:return: True of the rule matches against the given feature
:rtype: bool
2017-04-02 11:29:03 +02:00
%End
2015-10-19 23:53:15 +02:00
QPixmap renderPreview() const;
2017-04-02 11:29:03 +02:00
%Docstring
Render a preview icon of the rule.
:return: QPixmap preview of the style
:rtype: QPixmap
2017-04-02 11:29:03 +02:00
%End
void setName( const QString &value );
%Docstring
Set the name of the style. Names are optional but handy for display
2017-04-03 11:59:45 +10:00
\param value The name given to the style
2017-04-02 11:29:03 +02:00
%End
void setRule( const QString &value );
%Docstring
Set the rule for the style. Rules should be of QgsExpression syntax.
Special value of \@value is replaced at run time with the check value
2017-04-03 11:59:45 +10:00
\param value The QgsExpression style rule to use for this style
2017-04-02 11:29:03 +02:00
%End
void setBackgroundColor( const QColor &value );
%Docstring
Set the background color for the style
2017-04-03 11:59:45 +10:00
\param value QColor for background color
2017-04-02 11:29:03 +02:00
%End
void setTextColor( const QColor &value );
%Docstring
Set the text color for the style
2017-04-03 11:59:45 +10:00
\param value QColor for text color
2017-04-02 11:29:03 +02:00
%End
void setFont( const QFont &value );
%Docstring
Set the font for the the style
2017-04-03 11:59:45 +10:00
\param value QFont to be used for text
2017-04-02 11:29:03 +02:00
%End
void setSymbol( QgsSymbol *value );
%Docstring
Set the icon for the style. Icons are generated from symbols
2017-04-03 11:59:45 +10:00
\param value QgsSymbol to be used when generating the icon
2017-04-02 11:29:03 +02:00
%End
QString displayText() const;
2017-04-02 11:29:03 +02:00
%Docstring
The name of the style.
:return: The name of the style. Names are optional so might be empty.
:rtype: str
2017-04-02 11:29:03 +02:00
%End
QString name() const;
2017-04-02 11:29:03 +02:00
%Docstring
The name of the style.
:return: The name of the style. Names are optional so might be empty.
:rtype: str
2017-04-02 11:29:03 +02:00
%End
QPixmap icon() const;
2017-04-02 11:29:03 +02:00
%Docstring
The icon set for style generated from the set symbol
:return: A QPixmap that was set for the icon using the symbol
:rtype: QPixmap
2017-04-02 11:29:03 +02:00
%End
2017-04-02 11:29:03 +02:00
QgsSymbol *symbol() const;
%Docstring
The symbol used to generate the icon for the style
:return: The QgsSymbol used for the icon
:rtype: QgsSymbol
2017-04-02 11:29:03 +02:00
%End
QColor textColor() const;
2017-04-02 11:29:03 +02:00
%Docstring
The text color set for style
:return: QColor for text color
:rtype: QColor
2017-04-02 11:29:03 +02:00
%End
bool validTextColor() const;
2017-04-02 11:29:03 +02:00
%Docstring
Check if the text color is valid for render.
Valid colors are non invalid QColors and a color with a > 0 alpha
:return: True of the color set for text is valid.
:rtype: bool
2017-04-02 11:29:03 +02:00
%End
QColor backgroundColor() const;
2017-04-02 11:29:03 +02:00
%Docstring
The background color for style
:return: QColor for background color
:rtype: QColor
2017-04-02 11:29:03 +02:00
%End
bool validBackgroundColor() const;
2017-04-02 11:29:03 +02:00
%Docstring
Check if the background color is valid for render.
Valid colors are non invalid QColors and a color with a > 0 alpha
:return: True of the color set for background is valid.
:rtype: bool
2017-04-02 11:29:03 +02:00
%End
QFont font() const;
2017-04-02 11:29:03 +02:00
%Docstring
The font for the style
:return: QFont for the style
:rtype: QFont
2017-04-02 11:29:03 +02:00
%End
QString rule() const;
2017-04-02 11:29:03 +02:00
%Docstring
The condition rule set for the style. Rule may contain variable \@value
to represent the current value
:return: QString of the current set rule
:rtype: str
2017-04-02 11:29:03 +02:00
%End
2015-08-22 13:42:29 +02:00
bool isValid() const;
2017-04-02 11:29:03 +02:00
%Docstring
isValid Check if this rule is valid. A valid rule has one or more properties
set.
:return: True if the rule is valid.
:rtype: bool
2017-04-02 11:29:03 +02:00
%End
static QList<QgsConditionalStyle> matchingConditionalStyles( const QList<QgsConditionalStyle> &styles, const QVariant &value, QgsExpressionContext &context );
%Docstring
Find and return the matching styles for the value and feature.
If no match is found a invalid QgsConditionalStyle is return.
:return: A conditional style that matches the value and feature.
Check with QgsConditionalStyle.isValid()
:rtype: list of QgsConditionalStyle
2017-04-02 11:29:03 +02:00
%End
static QgsConditionalStyle matchingConditionalStyle( const QList<QgsConditionalStyle> &styles, const QVariant &value, QgsExpressionContext &context );
%Docstring
Find and return the matching style for the value and feature.
If no match is found a invalid QgsConditionalStyle is return.
:return: A conditional style that matches the value and feature.
Check with QgsConditionalStyle.isValid()
:rtype: QgsConditionalStyle
2017-04-02 11:29:03 +02:00
%End
static QgsConditionalStyle compressStyles( const QList<QgsConditionalStyle> &styles );
%Docstring
Compress a list of styles into a single style. This can be used to stack the elements of the
styles. The font of the last style is used in the output.
2017-04-03 11:59:45 +10:00
\param styles The list of styles to compress down
:return: A single style generated from joining each style property.
:rtype: QgsConditionalStyle
2017-04-02 11:29:03 +02:00
%End
bool readXml( const QDomNode &node, const QgsReadWriteContext &context );
2017-04-02 11:29:03 +02:00
%Docstring
Reads vector conditional style specific state from layer Dom node.
:rtype: bool
2017-04-02 11:29:03 +02:00
%End
bool writeXml( QDomNode &node, QDomDocument &doc, const QgsReadWriteContext &context ) const;
2017-04-02 11:29:03 +02:00
%Docstring
Write vector conditional style specific state from layer Dom node.
:rtype: bool
2017-04-02 11:29:03 +02:00
%End
};
2017-04-02 11:29:03 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsconditionalstyle.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/