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)
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)
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 19 of file qgsstylev2.h.


Constructor & Destructor Documentation

QgsStyleV2::QgsStyleV2 (  ) 

Definition at line 22 of file qgsstylev2.cpp.

QgsStyleV2::~QgsStyleV2 (  ) 

Definition at line 26 of file qgsstylev2.cpp.

References clear().


Member Function Documentation

QgsStyleV2 * QgsStyleV2::defaultStyle (  )  [static]

return default application-wide style

Definition at line 31 of file qgsstylev2.cpp.

References QgsApplication::defaultStyleV2Path(), load(), mDefaultStyle, and QgsApplication::userStyleV2Path().

void QgsStyleV2::clear (  ) 

remove all contents of the style

Definition at line 50 of file qgsstylev2.cpp.

References mColorRamps, and mSymbols.

Referenced by ~QgsStyleV2().

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.

bool QgsStyleV2::removeSymbol ( QString  name  ) 

remove symbol from style (and delete it)

Definition at line 74 of file qgsstylev2.cpp.

References mSymbols.

QgsSymbolV2 * QgsStyleV2::symbol ( QString  name  ) 

return a NEW copy of symbol

Definition at line 84 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.

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.

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::removeColorRamp ( QString  name  ) 

remove color ramp from style (and delete it)

Definition at line 122 of file qgsstylev2.cpp.

References mColorRamps.

QgsVectorColorRampV2 * QgsStyleV2::colorRamp ( QString  name  ) 

return a NEW copy of color ramp

Definition at line 132 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.

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.

bool QgsStyleV2::load ( QString  filename  ) 

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.

QString QgsStyleV2::errorString (  )  [inline]

return last error from load/save operation

Definition at line 77 of file qgsstylev2.h.

QString QgsStyleV2::fileName (  )  [inline]

return current file name of the style

Definition at line 80 of file qgsstylev2.h.


Member Data Documentation

QString QgsStyleV2::mErrorString [protected]

Definition at line 87 of file qgsstylev2.h.

Referenced by load(), and save().

QString QgsStyleV2::mFileName [protected]

Definition at line 88 of file qgsstylev2.h.

Referenced by load(), and save().

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

Definition at line 90 of file qgsstylev2.h.

Referenced by defaultStyle().


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

Generated on Sat Feb 4 19:17:53 2012 for Quantum GIS API Documentation by  doxygen 1.5.6