Quantum GIS API Documentation  1.7.4
src/core/symbology-ng/qgsstylev2.h
Go to the documentation of this file.
00001 
00002 #ifndef QGSSTYLEV2_H
00003 #define QGSSTYLEV2_H
00004 
00005 #include <QMap>
00006 #include <QString>
00007 
00008 #include "qgssymbollayerv2utils.h" // QgsStringMap
00009 
00010 class QgsSymbolV2;
00011 class QgsSymbolLayerV2;
00012 class QgsVectorColorRampV2;
00013 
00014 class QDomDocument;
00015 class QDomElement;
00016 
00017 typedef QMap<QString, QgsVectorColorRampV2* > QgsVectorColorRampV2Map;
00018 
00019 class CORE_EXPORT QgsStyleV2
00020 {
00021   public:
00022 
00023     QgsStyleV2();
00024     ~QgsStyleV2();
00025 
00027     static QgsStyleV2* defaultStyle();
00028 
00030     void clear();
00031 
00033     bool addSymbol( QString name, QgsSymbolV2* symbol );
00034 
00036     bool removeSymbol( QString name );
00037 
00040     bool renameSymbol( QString oldName, QString newName );
00041 
00043     QgsSymbolV2* symbol( QString name );
00044 
00046     const QgsSymbolV2* symbolRef( QString name ) const;
00047 
00049     int symbolCount();
00050 
00052     QStringList symbolNames();
00053 
00054 
00056     bool addColorRamp( QString name, QgsVectorColorRampV2* colorRamp );
00057 
00059     bool removeColorRamp( QString name );
00060 
00063     bool renameColorRamp( QString oldName, QString newName );
00064 
00066     QgsVectorColorRampV2* colorRamp( QString name );
00067 
00069     const QgsVectorColorRampV2* colorRampRef( QString name ) const;
00070 
00072     int colorRampCount();
00073 
00075     QStringList colorRampNames();
00076 
00077 
00079     bool load( QString filename );
00080 
00082     bool save( QString filename = QString() );
00083 
00085     QString errorString() { return mErrorString; }
00086 
00088     QString fileName() { return mFileName; }
00089 
00090   protected:
00091 
00092     QgsSymbolV2Map mSymbols;
00093     QgsVectorColorRampV2Map mColorRamps;
00094 
00095     QString mErrorString;
00096     QString mFileName;
00097 
00098     static QgsStyleV2* mDefaultStyle;
00099 };
00100 
00101 
00102 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines