Quantum GIS API Documentation  1.8
Public Member Functions | Static Public Member Functions | Protected Attributes | Static Protected Attributes
QgsStyleV2 Class Reference

#include <qgsstylev2.h>

Collaboration diagram for QgsStyleV2:
Collaboration graph
[legend]

List of all members.

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
QgsSymbolV2symbol (QString name)
 return a NEW copy of symbol
const QgsSymbolV2symbolRef (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
QgsVectorColorRampV2colorRamp (QString name)
 return a NEW copy of color ramp
const QgsVectorColorRampV2colorRampRef (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 QgsStyleV2defaultStyle ()
 return default application-wide style

Protected Attributes

QgsSymbolV2Map mSymbols
QgsVectorColorRampV2Map mColorRamps
QString mErrorString
QString mFileName

Static Protected Attributes

static QgsStyleV2mDefaultStyle = NULL

Detailed Description

Definition at line 33 of file qgsstylev2.h.


Constructor & Destructor Documentation

Definition at line 36 of file qgsstylev2.cpp.

Referenced by defaultStyle().

Definition at line 40 of file qgsstylev2.cpp.

References clear().


Member Function Documentation

bool QgsStyleV2::addColorRamp ( QString  name,
QgsVectorColorRampV2 colorRamp 
)

add color ramp to style. takes ramp's ownership

Definition at line 123 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 75 of file qgsstylev2.cpp.

References mSymbols.

remove all contents of the style

Definition at line 64 of file qgsstylev2.cpp.

References mColorRamps, and mSymbols.

Referenced by ~QgsStyleV2().

return a NEW copy of color ramp

Definition at line 146 of file qgsstylev2.cpp.

References mColorRamps.

return count of color ramps

Definition at line 160 of file qgsstylev2.cpp.

References mColorRamps.

QStringList QgsStyleV2::colorRampNames ( )

return a list of names of color ramps

Definition at line 165 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 153 of file qgsstylev2.cpp.

References mColorRamps.

return default application-wide style

Definition at line 45 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 99 of file qgsstylev2.h.

QString QgsStyleV2::fileName ( ) [inline]

return current file name of the style

Definition at line 102 of file qgsstylev2.h.

bool QgsStyleV2::load ( QString  filename)
bool QgsStyleV2::removeColorRamp ( QString  name)

remove color ramp from style (and delete it)

Definition at line 136 of file qgsstylev2.cpp.

References mColorRamps.

bool QgsStyleV2::removeSymbol ( QString  name)

remove symbol from style (and delete it)

Definition at line 88 of file qgsstylev2.cpp.

References mSymbols.

bool QgsStyleV2::renameColorRamp ( QString  oldName,
QString  newName 
)

change ramp's name

Note:
added in v1.7

Definition at line 288 of file qgsstylev2.cpp.

References mColorRamps.

bool QgsStyleV2::renameSymbol ( QString  oldName,
QString  newName 
)

change symbol's name

Note:
added in v1.7

Definition at line 279 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 239 of file qgsstylev2.cpp.

References mColorRamps, mErrorString, mFileName, mSymbols, QgsSymbolLayerV2Utils::saveColorRamp(), QgsSymbolLayerV2Utils::saveSymbols(), and STYLE_CURRENT_VERSION.

QgsSymbolV2 * QgsStyleV2::symbol ( QString  name)

return a NEW copy of symbol

Definition at line 98 of file qgsstylev2.cpp.

References mSymbols.

return count of symbols in style

Definition at line 112 of file qgsstylev2.cpp.

References mSymbols.

QStringList QgsStyleV2::symbolNames ( )

return a list of names of symbols

Definition at line 117 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 105 of file qgsstylev2.cpp.

References mSymbols.


Member Data Documentation

QgsStyleV2 * QgsStyleV2::mDefaultStyle = NULL [static, protected]

Definition at line 112 of file qgsstylev2.h.

Referenced by defaultStyle().

QString QgsStyleV2::mErrorString [protected]

Definition at line 109 of file qgsstylev2.h.

Referenced by load(), and save().

QString QgsStyleV2::mFileName [protected]

Definition at line 110 of file qgsstylev2.h.

Referenced by load(), and save().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines