8
#include "qgssymbollayerv2utils.h" // QgsStringMap
11
class QgsSymbolLayerV2;
12
class QgsVectorColorRampV2;
17
typedef QMap<QString, QgsVectorColorRampV2* > QgsVectorColorRampV2Map;
19
class CORE_EXPORT QgsStyleV2
26
//! return default application-wide style
27
static QgsStyleV2* defaultStyle();
29
//! remove all contents of the style
32
//! add symbol to style. takes symbol's ownership
33
bool addSymbol( QString name, QgsSymbolV2* symbol );
35
//! remove symbol from style (and delete it)
36
bool removeSymbol( QString name );
38
//! return a NEW copy of symbol
39
QgsSymbolV2* symbol( QString name );
41
//! return a const pointer to a symbol (doesn't create new instance)
42
const QgsSymbolV2* symbolRef( QString name ) const;
44
//! return count of symbols in style
47
//! return a list of names of symbols
48
QStringList symbolNames();
51
//! add color ramp to style. takes ramp's ownership
52
bool addColorRamp( QString name, QgsVectorColorRampV2* colorRamp );
54
//! remove color ramp from style (and delete it)
55
bool removeColorRamp( QString name );
57
//! return a NEW copy of color ramp
58
QgsVectorColorRampV2* colorRamp( QString name );
60
//! return a const pointer to a symbol (doesn't create new instance)
61
const QgsVectorColorRampV2* colorRampRef( QString name ) const;
63
//! return count of color ramps
66
//! return a list of names of color ramps
67
QStringList colorRampNames();
70
//! load a file into the style
71
bool load( QString filename );
73
//! save style into a file (will use current filename if empty string is passed)
74
bool save( QString filename = QString() );
76
//! return last error from load/save operation
77
QString errorString() { return mErrorString; }
79
//! return current file name of the style
80
QString fileName() { return mFileName; }
84
QgsSymbolV2Map mSymbols;
85
QgsVectorColorRampV2Map mColorRamps;
90
static QgsStyleV2* mDefaultStyle;