Quantum GIS API Documentation  1.7.5-Wroclaw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
qgsstylev2.h
Go to the documentation of this file.
1 
2 #ifndef QGSSTYLEV2_H
3 #define QGSSTYLEV2_H
4 
5 #include <QMap>
6 #include <QString>
7 
8 #include "qgssymbollayerv2utils.h" // QgsStringMap
9 
10 class QgsSymbolV2;
11 class QgsSymbolLayerV2;
13 
14 class QDomDocument;
15 class QDomElement;
16 
17 typedef QMap<QString, QgsVectorColorRampV2* > QgsVectorColorRampV2Map;
18 
19 class CORE_EXPORT QgsStyleV2
20 {
21  public:
22 
23  QgsStyleV2();
24  ~QgsStyleV2();
25 
27  static QgsStyleV2* defaultStyle();
28 
30  void clear();
31 
33  bool addSymbol( QString name, QgsSymbolV2* symbol );
34 
36  bool removeSymbol( QString name );
37 
40  bool renameSymbol( QString oldName, QString newName );
41 
43  QgsSymbolV2* symbol( QString name );
44 
46  const QgsSymbolV2* symbolRef( QString name ) const;
47 
49  int symbolCount();
50 
52  QStringList symbolNames();
53 
54 
56  bool addColorRamp( QString name, QgsVectorColorRampV2* colorRamp );
57 
59  bool removeColorRamp( QString name );
60 
63  bool renameColorRamp( QString oldName, QString newName );
64 
66  QgsVectorColorRampV2* colorRamp( QString name );
67 
69  const QgsVectorColorRampV2* colorRampRef( QString name ) const;
70 
72  int colorRampCount();
73 
75  QStringList colorRampNames();
76 
77 
79  bool load( QString filename );
80 
82  bool save( QString filename = QString() );
83 
85  QString errorString() { return mErrorString; }
86 
88  QString fileName() { return mFileName; }
89 
90  protected:
91 
94 
95  QString mErrorString;
96  QString mFileName;
97 
99 };
100 
101 
102 #endif