Quantum GIS API Documentation
1.7.4
|
#include <qgsstylev2.h>
Public Member Functions | |
QgsStyleV2 () | |
~QgsStyleV2 () | |
void | clear () |
remove all contents of the style | |
bool | addSymbol (QString name, QgsSymbolV2 *symbol) |
add symbol to style. takes symbol's ownership | |
bool | removeSymbol (QString name) |
remove symbol from style (and delete it) | |
bool | renameSymbol (QString oldName, QString newName) |
change symbol's name | |
QgsSymbolV2 * | symbol (QString name) |
return a NEW copy of symbol | |
const QgsSymbolV2 * | symbolRef (QString name) const |
return a const pointer to a symbol (doesn't create new instance) | |
int | symbolCount () |
return count of symbols in style | |
QStringList | symbolNames () |
return a list of names of symbols | |
bool | addColorRamp (QString name, QgsVectorColorRampV2 *colorRamp) |
add color ramp to style. takes ramp's ownership | |
bool | removeColorRamp (QString name) |
remove color ramp from style (and delete it) | |
bool | renameColorRamp (QString oldName, QString newName) |
change ramp's name | |
QgsVectorColorRampV2 * | colorRamp (QString name) |
return a NEW copy of color ramp | |
const QgsVectorColorRampV2 * | colorRampRef (QString name) const |
return a const pointer to a symbol (doesn't create new instance) | |
int | colorRampCount () |
return count of color ramps | |
QStringList | colorRampNames () |
return a list of names of color ramps | |
bool | load (QString filename) |
load a file into the style | |
bool | save (QString filename=QString()) |
save style into a file (will use current filename if empty string is passed) | |
QString | errorString () |
return last error from load/save operation | |
QString | fileName () |
return current file name of the style | |
Static Public Member Functions | |
static QgsStyleV2 * | defaultStyle () |
return default application-wide style | |
Protected Attributes | |
QgsSymbolV2Map | mSymbols |
QgsVectorColorRampV2Map | mColorRamps |
QString | mErrorString |
QString | mFileName |
Static Protected Attributes | |
static QgsStyleV2 * | mDefaultStyle = NULL |
Definition at line 19 of file qgsstylev2.h.
Definition at line 22 of file qgsstylev2.cpp.
Referenced by defaultStyle().
Definition at line 26 of file qgsstylev2.cpp.
References clear().
bool QgsStyleV2::addColorRamp | ( | QString | name, |
QgsVectorColorRampV2 * | colorRamp | ||
) |
add color ramp to style. takes ramp's ownership
Definition at line 109 of file qgsstylev2.cpp.
References mColorRamps.
Referenced by load().
bool QgsStyleV2::addSymbol | ( | QString | name, |
QgsSymbolV2 * | symbol | ||
) |
add symbol to style. takes symbol's ownership
Definition at line 61 of file qgsstylev2.cpp.
References mSymbols.
void QgsStyleV2::clear | ( | ) |
remove all contents of the style
Definition at line 50 of file qgsstylev2.cpp.
References mColorRamps, and mSymbols.
Referenced by ~QgsStyleV2().
QgsVectorColorRampV2 * QgsStyleV2::colorRamp | ( | QString | name | ) |
return a NEW copy of color ramp
Definition at line 132 of file qgsstylev2.cpp.
References mColorRamps.
int QgsStyleV2::colorRampCount | ( | ) |
QStringList QgsStyleV2::colorRampNames | ( | ) |
return a list of names of color ramps
Definition at line 151 of file qgsstylev2.cpp.
References mColorRamps.
const QgsVectorColorRampV2 * QgsStyleV2::colorRampRef | ( | QString | name | ) | const |
return a const pointer to a symbol (doesn't create new instance)
Definition at line 139 of file qgsstylev2.cpp.
References mColorRamps.
QgsStyleV2 * QgsStyleV2::defaultStyle | ( | ) | [static] |
return default application-wide style
Definition at line 31 of file qgsstylev2.cpp.
References QgsApplication::defaultStyleV2Path(), load(), mDefaultStyle, QgsStyleV2(), and QgsApplication::userStyleV2Path().
QString QgsStyleV2::errorString | ( | ) | [inline] |
return last error from load/save operation
Definition at line 85 of file qgsstylev2.h.
QString QgsStyleV2::fileName | ( | ) | [inline] |
return current file name of the style
Definition at line 88 of file qgsstylev2.h.
bool QgsStyleV2::load | ( | QString | filename | ) |
load a file into the style
Definition at line 157 of file qgsstylev2.cpp.
References addColorRamp(), QgsSymbolLayerV2Utils::loadColorRamp(), QgsSymbolLayerV2Utils::loadSymbols(), mErrorString, mFileName, mSymbols, QgsDebugMsg, and STYLE_CURRENT_VERSION.
Referenced by defaultStyle().
bool QgsStyleV2::removeColorRamp | ( | QString | name | ) |
remove color ramp from style (and delete it)
Definition at line 122 of file qgsstylev2.cpp.
References mColorRamps.
bool QgsStyleV2::removeSymbol | ( | QString | name | ) |
remove symbol from style (and delete it)
Definition at line 74 of file qgsstylev2.cpp.
References mSymbols.
bool QgsStyleV2::renameColorRamp | ( | QString | oldName, |
QString | newName | ||
) |
change ramp's name
Definition at line 274 of file qgsstylev2.cpp.
References mColorRamps.
bool QgsStyleV2::renameSymbol | ( | QString | oldName, |
QString | newName | ||
) |
change symbol's name
Definition at line 265 of file qgsstylev2.cpp.
References mSymbols.
bool QgsStyleV2::save | ( | QString | filename = QString() | ) |
save style into a file (will use current filename if empty string is passed)
Definition at line 225 of file qgsstylev2.cpp.
References mColorRamps, mErrorString, mFileName, mSymbols, QgsSymbolLayerV2Utils::saveColorRamp(), QgsSymbolLayerV2Utils::saveSymbols(), and STYLE_CURRENT_VERSION.
QgsSymbolV2 * QgsStyleV2::symbol | ( | QString | name | ) |
int QgsStyleV2::symbolCount | ( | ) |
QStringList QgsStyleV2::symbolNames | ( | ) |
return a list of names of symbols
Definition at line 103 of file qgsstylev2.cpp.
References mSymbols.
const QgsSymbolV2 * QgsStyleV2::symbolRef | ( | QString | name | ) | const |
return a const pointer to a symbol (doesn't create new instance)
Definition at line 91 of file qgsstylev2.cpp.
References mSymbols.
QgsVectorColorRampV2Map QgsStyleV2::mColorRamps [protected] |
Definition at line 93 of file qgsstylev2.h.
Referenced by addColorRamp(), clear(), colorRamp(), colorRampCount(), colorRampNames(), colorRampRef(), removeColorRamp(), renameColorRamp(), and save().
QgsStyleV2 * QgsStyleV2::mDefaultStyle = NULL [static, protected] |
Definition at line 98 of file qgsstylev2.h.
Referenced by defaultStyle().
QString QgsStyleV2::mErrorString [protected] |
Definition at line 95 of file qgsstylev2.h.
QString QgsStyleV2::mFileName [protected] |
Definition at line 96 of file qgsstylev2.h.
QgsSymbolV2Map QgsStyleV2::mSymbols [protected] |
Definition at line 92 of file qgsstylev2.h.
Referenced by addSymbol(), clear(), load(), removeSymbol(), renameSymbol(), save(), symbol(), symbolCount(), symbolNames(), and symbolRef().