Quantum GIS API Documentation  1.7.5-Wroclaw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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
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

Detailed Description

Definition at line 19 of file qgsstylev2.h.


Constructor & Destructor Documentation

QgsStyleV2::QgsStyleV2 ( )

Definition at line 22 of file qgsstylev2.cpp.

Referenced by defaultStyle().

QgsStyleV2::~QgsStyleV2 ( )

Definition at line 26 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 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 ( )

return count of color ramps

Definition at line 146 of file qgsstylev2.cpp.

References mColorRamps.

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)
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

Note:
added in v1.7

Definition at line 274 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 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)

return a NEW copy of symbol

Definition at line 84 of file qgsstylev2.cpp.

References mSymbols.

int QgsStyleV2::symbolCount ( )

return count of symbols in style

Definition at line 98 of file qgsstylev2.cpp.

References mSymbols.

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.


Member Data Documentation

QgsVectorColorRampV2Map QgsStyleV2::mColorRamps
protected
QgsStyleV2 * QgsStyleV2::mDefaultStyle = NULL
staticprotected

Definition at line 98 of file qgsstylev2.h.

Referenced by defaultStyle().

QString QgsStyleV2::mErrorString
protected

Definition at line 95 of file qgsstylev2.h.

Referenced by load(), and save().

QString QgsStyleV2::mFileName
protected

Definition at line 96 of file qgsstylev2.h.

Referenced by load(), and save().

QgsSymbolV2Map QgsStyleV2::mSymbols
protected

The documentation for this class was generated from the following files: