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 | List of all members
QgsStyleV2 Class Reference

#include <qgsstylev2.h>

Collaboration diagram for QgsStyleV2:
Collaboration graph
[legend]

Public Member Functions

 QgsStyleV2 ()
 
 ~QgsStyleV2 ()
 
void clear ()
 remove all contents of the style More...
 
bool addSymbol (QString name, QgsSymbolV2 *symbol)
 add symbol to style. takes symbol's ownership More...
 
bool removeSymbol (QString name)
 remove symbol from style (and delete it) More...
 
bool renameSymbol (QString oldName, QString newName)
 change symbol's name More...
 
QgsSymbolV2symbol (QString name)
 return a NEW copy of symbol More...
 
const QgsSymbolV2symbolRef (QString name) const
 return a const pointer to a symbol (doesn't create new instance) More...
 
int symbolCount ()
 return count of symbols in style More...
 
QStringList symbolNames ()
 return a list of names of symbols More...
 
bool addColorRamp (QString name, QgsVectorColorRampV2 *colorRamp)
 add color ramp to style. takes ramp's ownership More...
 
bool removeColorRamp (QString name)
 remove color ramp from style (and delete it) More...
 
bool renameColorRamp (QString oldName, QString newName)
 change ramp's name More...
 
QgsVectorColorRampV2colorRamp (QString name)
 return a NEW copy of color ramp More...
 
const QgsVectorColorRampV2colorRampRef (QString name) const
 return a const pointer to a symbol (doesn't create new instance) More...
 
int colorRampCount ()
 return count of color ramps More...
 
QStringList colorRampNames ()
 return a list of names of color ramps More...
 
bool load (QString filename)
 load a file into the style More...
 
bool save (QString filename=QString())
 save style into a file (will use current filename if empty string is passed) More...
 
QString errorString ()
 return last error from load/save operation More...
 
QString fileName ()
 return current file name of the style More...
 

Static Public Member Functions

static QgsStyleV2defaultStyle ()
 return default application-wide style More...
 

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.

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: