/usr/include/qgis/qgsdatadefined.h is in libqgis-dev 2.8.6+dfsg-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | /***************************************************************************
qgsdatadefined.h - Data defined container class
--------------------------------------
Date : 9-May-2013
Copyright : (C) 2013 by Larry Shaffer
Email : larrys at dakcarto dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef QGSDATADEFINED_H
#define QGSDATADEFINED_H
#include "qgsfield.h"
#include "qgsvectorlayer.h"
#include <QStringList>
class QgsExpression;
/** \ingroup core
* \class QgsDataDefined
* A container class for data source field mapping or expression.
*/
class CORE_EXPORT QgsDataDefined
{
public:
/**
* Construct a new data defined object
*
* @param active Whether the current data defined is active
* @param useexpr Whether to use expression instead of field
* @param expr Expression string
* @param field Field name string
*/
QgsDataDefined( bool active = false,
bool useexpr = false,
const QString& expr = QString(),
const QString& field = QString() );
/**
* Construct a new data defined object, analyse the expression to determine
* if it's a simple field
*
* @param expression can be null
*/
explicit QgsDataDefined( const QgsExpression * expression );
~QgsDataDefined();
/**Returns whether the data defined container is set to all the default
* values, ie, disabled, with empty expression and no assigned field
* @returns true if data defined container is set to default values
* @note added in QGIS 2.7
*/
bool hasDefaultValues() const;
bool isActive() const { return mActive; }
void setActive( bool active ) { mActive = active; }
bool useExpression() const { return mUseExpression; }
void setUseExpression( bool use ) { mUseExpression = use; }
QString expressionString() const { return mExpressionString; }
void setExpressionString( const QString& expr );
// @note not available in python bindings
QMap<QString, QVariant> expressionParams() const { return mExpressionParams; }
// @note not available in python bindings
void setExpressionParams( QMap<QString, QVariant> params ) { mExpressionParams = params; }
void insertExpressionParam( QString key, QVariant param );
bool prepareExpression( QgsVectorLayer* layer );
bool expressionIsPrepared() const { return mExpressionPrepared; }
QgsExpression* expression() { return mExpression; }
QStringList referencedColumns( QgsVectorLayer* layer );
QString field() const { return mField; }
void setField( const QString& field ) { mField = field; }
// @note not available in python bindings
QMap< QString, QString > toMap();
/**Returns a DOM element containing the properties of the data defined container.
* @param document DOM document
* @param elementName name for DOM element
* @returns DOM element corresponding to data defined container
* @note added in QGIS 2.7
* @see setFromXmlElement
*/
QDomElement toXmlElement( QDomDocument &document, const QString &elementName ) const;
/**Sets the properties of the data defined container from an XML element. Calling
* this will overwrite all the current properties of the container.
* @param element DOM element
* @returns true if properties were successfully read from element
* @note added in QGIS 2.7
* @see toXmlElement
*/
bool setFromXmlElement( const QDomElement& element );
bool operator==( const QgsDataDefined &other ) const;
bool operator!=( const QgsDataDefined &other ) const;
private:
QgsExpression* mExpression;
bool mActive;
bool mUseExpression;
QString mExpressionString;
QString mField;
QMap<QString, QVariant> mExpressionParams;
bool mExpressionPrepared;
QStringList mExprRefColmuns;
};
#endif // QGSDATADEFINED_H
|