|
Quantum GIS API Documentation
master-693a1fe
|
#include <qgsstylev2.h>
Collaboration diagram for QgsStyleV2:Public Types | |
| enum | StyleEntity { SymbolEntity, GroupEntity, TagEntity, ColorrampEntity, SmartgroupEntity } |
| Enum for Entities involved in a style. More... | |
Public Member Functions | |
| QgsStyleV2 () | |
| ~QgsStyleV2 () | |
| bool | addColorRamp (QString name, QgsVectorColorRampV2 *colorRamp, bool update=false) |
| add color ramp to style. takes ramp's ownership | |
| int | addGroup (QString groupName, int parent=0) |
| adds a new group and returns the group's id | |
| int | addSmartgroup (QString name, QString op, QgsSmartConditionMap conditions) |
| adds new smartgroup to the database and returns the id | |
| bool | addSymbol (QString name, QgsSymbolV2 *symbol, bool update=false) |
| add symbol to style. takes symbol's ownership | |
| int | addTag (QString tagName) |
| adds a new tag and returns the tag's id | |
| QgsSymbolGroupMap | childGroupNames (QString parent="") |
| return a map of groupid and names for the given parent group | |
| void | clear () |
| remove all contents of the style | |
| QgsVectorColorRampV2 * | colorRamp (QString name) |
| return a NEW copy of color ramp | |
| int | colorRampCount () |
| return count of color ramps | |
| int | colorrampId (QString name) |
| return the id in the style database for the given colorramp name returns 0 if not found | |
| QStringList | colorRampNames () |
| return a list of names of color ramps | |
| const QgsVectorColorRampV2 * | colorRampRef (QString name) const |
| return a const pointer to a symbol (doesn't create new instance) | |
| bool | detagSymbol (StyleEntity type, QString symbol, QStringList tags) |
| detags the symbol with the given list | |
| QString | errorString () |
| return last error from load/save operation | |
| bool | exportXML (QString filename) |
| Exports the style as a XML file. | |
| QString | fileName () |
| return current file name of the style | |
| QStringList | findSymbols (QString qword) |
| return the names of the symbols which have a matching 'substring' in its defintion | |
| bool | group (StyleEntity type, QString name, int groupid) |
| applies the specified group to the symbol or colorramp specified by StyleEntity | |
| int | groupId (QString group) |
| return the DB id for the given group name | |
| QStringList | groupNames () |
| return the all the groups in the style | |
| bool | importXML (QString filename) |
| Imports the symbols and colorramps into the default style database from the given XML file. | |
| bool | load (QString filename) |
| load a file into the style | |
| void | remove (StyleEntity type, int id) |
| remove the specified entity from the db | |
| bool | removeColorRamp (QString name) |
| remove color ramp from style (and delete it) | |
| bool | removeSymbol (QString name) |
| remove symbol from style (and delete it) | |
| void | rename (StyleEntity type, int id, QString newName) |
| rename the given entity with the specified id | |
| bool | renameColorRamp (QString oldName, QString newName) |
| change ramp's name | |
| bool | renameSymbol (QString oldName, QString newName) |
| change symbol's name | |
| bool | save (QString filename=QString()) |
| save style into a file (will use current filename if empty string is passed) | |
| bool | saveColorRamp (QString name, QgsVectorColorRampV2 *ramp, int groupid, QStringList tags) |
| add the colorramp to the DB | |
| bool | saveSymbol (QString name, QgsSymbolV2 *symbol, int groupid, QStringList tags) |
| add the symbol to the DB with the tags | |
| QgsSmartConditionMap | smartgroup (int id) |
| returns the QgsSmartConditionMap for the given id | |
| int | smartgroupId (QString smartgroup) |
| return the DB id for the given smartgroup name | |
| QStringList | smartgroupNames () |
| returns the smart groups list | |
| QString | smartgroupOperator (int id) |
| returns the operator for the smartgroup | |
| QgsSymbolGroupMap | smartgroupsListMap () |
| returns the smart groups map with id as key and name as value | |
| QgsSymbolV2 * | symbol (QString name) |
| return a NEW copy of symbol | |
| int | symbolCount () |
| return count of symbols in style | |
| int | symbolId (QString name) |
| return the id in the style database for the given symbol name returns 0 if not found | |
| QStringList | symbolNames () |
| return a list of names of symbols | |
| const QgsSymbolV2 * | symbolRef (QString name) const |
| return a const pointer to a symbol (doesn't create new instance) | |
| QStringList | symbolsOfGroup (StyleEntity type, int groupid) |
| returns the symbolnames of a given groupid | |
| QStringList | symbolsOfSmartgroup (StyleEntity type, int id) |
| returns the symbols for the smartgroup | |
| QStringList | symbolsWithTag (StyleEntity type, int tagid) |
| returns the symbol names with which have the given tag | |
| int | tagId (QString tag) |
| return the DB id for the given tag name | |
| QStringList | tagsOfSymbol (StyleEntity type, QString symbol) |
| return the tags associated with the symbol | |
| bool | tagSymbol (StyleEntity type, QString symbol, QStringList tags) |
| tags the symbol with the tags in the list | |
Static Public Member Functions | |
| static QgsStyleV2 * | defaultStyle () |
| return default application-wide style | |
Protected Member Functions | |
| char * | getGroupRemoveQuery (int id) |
| prepares the complex query for removing a group, so that the children are not abandoned | |
| int | getId (QString table, QString name) |
| gets the id from the table for the given name from the database, 0 if not found | |
| bool | openDB (QString filename) |
| convenience function to open the DB and return a sqlite3 object | |
| bool | runEmptyQuery (char *query, bool freeQuery=true) |
| convenience function that would run queries which don't generate return values | |
| bool | updateSymbol (StyleEntity type, QString name) |
| updates the properties of an existing symbol/colorramp | |
Protected Attributes | |
| QgsVectorColorRampV2Map | mColorRamps |
| sqlite3 * | mCurrentDB |
| QString | mErrorString |
| QString | mFileName |
| QgsSymbolV2Map | mSymbols |
Static Protected Attributes | |
| static QgsStyleV2 * | mDefaultStyle = 0 |
Definition at line 66 of file qgsstylev2.h.
Enum for Entities involved in a style.
The enumerator is used for identifying the entity being operated on when generic database functions are being run.
Definition at line 78 of file qgsstylev2.h.
Definition at line 46 of file qgsstylev2.cpp.
References clear().
| bool QgsStyleV2::addColorRamp | ( | QString | name, |
| QgsVectorColorRampV2 * | colorRamp, | ||
| bool | update = false |
||
| ) |
add color ramp to style. takes ramp's ownership
| name | is the name of the color ramp being added or updated |
| colorRamp | is the Vector color ramp |
| update | set to true when the style DB has to be updated, by default it is false |
Definition at line 185 of file qgsstylev2.cpp.
References ColorrampEntity, mColorRamps, saveColorRamp(), and updateSymbol().
Referenced by QgsStyleV2ManagerDialog::addColorRampStatic(), QgsStyleV2ManagerDialog::editColorRamp(), importXML(), and QgsStyleV2ExportImportDialog::moveStyles().
| int QgsStyleV2::addGroup | ( | QString | groupName, |
| int | parent = 0 |
||
| ) |
adds a new group and returns the group's id
| groupName | the name of the new group as QString |
| parent | is the id of the parent group when a subgrouo is to be created. By default it is 0 indicating it is not a sub-group |
Definition at line 596 of file qgsstylev2.cpp.
References mCurrentDB.
Referenced by QgsStyleV2ManagerDialog::groupRenamed(), and QgsStyleV2ExportImportDialog::moveStyles().
| int QgsStyleV2::addSmartgroup | ( | QString | name, |
| QString | op, | ||
| QgsSmartConditionMap | conditions | ||
| ) |
adds new smartgroup to the database and returns the id
| name | is the name of the new Smart Group to be added |
| op | is the operator between the conditions; AND/OR as QString |
| conditions | are the smart group conditions |
Definition at line 997 of file qgsstylev2.cpp.
References mCurrentDB, QgsDebugMsg, and runEmptyQuery().
Referenced by QgsStyleV2ManagerDialog::addGroup(), and QgsStyleV2ManagerDialog::editSmartgroupAction().
| bool QgsStyleV2::addSymbol | ( | QString | name, |
| QgsSymbolV2 * | symbol, | ||
| bool | update = false |
||
| ) |
add symbol to style. takes symbol's ownership
| name | is the name of the symbol being added or updated |
| symbol | is the Vector symbol |
| update | set to true when the style DB has to be updated, by default it is false |
Definition at line 83 of file qgsstylev2.cpp.
References mSymbols, saveSymbol(), SymbolEntity, and updateSymbol().
Referenced by QgsStyleV2ManagerDialog::addSymbol(), QgsSymbolsListWidget::addSymbolToStyle(), QgsStyleV2ManagerDialog::editSymbol(), importXML(), and QgsStyleV2ExportImportDialog::moveStyles().
| int QgsStyleV2::addTag | ( | QString | tagName | ) |
adds a new tag and returns the tag's id
| tagName | the name of the new tag to be created |
Definition at line 613 of file qgsstylev2.cpp.
References mCurrentDB.
Referenced by tagSymbol().
| QgsSymbolGroupMap QgsStyleV2::childGroupNames | ( | QString | parent = "" | ) |
return a map of groupid and names for the given parent group
Definition at line 463 of file qgsstylev2.cpp.
References group(), groupNames(), mCurrentDB, QgsDebugMsg, SymgroupId, and SymgroupName.
Referenced by QgsStyleV2ManagerDialog::buildGroupTree(), and QgsSymbolsListWidget::populateGroups().
| void QgsStyleV2::clear | ( | ) |
remove all contents of the style
Definition at line 70 of file qgsstylev2.cpp.
References mColorRamps, mCurrentDB, and mSymbols.
Referenced by QgsStyleV2ExportImportDialog::doExportImport(), and ~QgsStyleV2().
| QgsVectorColorRampV2 * QgsStyleV2::colorRamp | ( | QString | name | ) |
return a NEW copy of color ramp
Definition at line 256 of file qgsstylev2.cpp.
References QgsVectorColorRampV2::clone(), and colorRampRef().
Referenced by QgsColorRampComboBox::colorRampChanged(), QgsColorRampComboBox::currentColorRamp(), QgsStyleV2ManagerDialog::editColorRamp(), QgsStyleV2ExportImportDialog::moveStyles(), QgsColorRampComboBox::populate(), QgsStyleV2ManagerDialog::populateColorRamps(), QgsStyleV2ExportImportDialog::populateStyles(), and updateSymbol().
| int QgsStyleV2::colorRampCount | ( | ) |
return count of color ramps
Definition at line 267 of file qgsstylev2.cpp.
References mColorRamps.
Referenced by QgsStyleV2ManagerDialog::populateTypes().
| int QgsStyleV2::colorrampId | ( | QString | name | ) |
return the id in the style database for the given colorramp name returns 0 if not found
Definition at line 977 of file qgsstylev2.cpp.
References getId().
Referenced by tagsOfSymbol(), and tagSymbol().
| QStringList QgsStyleV2::colorRampNames | ( | ) |
return a list of names of color ramps
Definition at line 272 of file qgsstylev2.cpp.
References mColorRamps.
Referenced by QgsStyleV2ManagerDialog::addColorRampStatic(), QgsStyleV2ManagerDialog::groupChanged(), QgsStyleV2ExportImportDialog::moveStyles(), QgsColorRampComboBox::populate(), QgsStyleV2ExportImportDialog::populateStyles(), symbolsOfSmartgroup(), and updateSymbol().
| const QgsVectorColorRampV2 * QgsStyleV2::colorRampRef | ( | QString | name | ) | const |
return a const pointer to a symbol (doesn't create new instance)
Definition at line 262 of file qgsstylev2.cpp.
References mColorRamps.
Referenced by colorRamp(), and fcnRampColor().
| QgsStyleV2 * QgsStyleV2::defaultStyle | ( | ) | [static] |
return default application-wide style
Definition at line 51 of file qgsstylev2.cpp.
References QgsApplication::defaultStyleV2Path(), load(), mDefaultStyle, QgsStyleV2(), and QgsApplication::userStyleV2Path().
Referenced by QgsSymbolV2::defaultSymbol(), fcnRampColor(), QgsPointDisplacementRendererWidget::on_mCenterSymbolPushButton_clicked(), and QgsSingleBandPseudoColorRendererWidget::QgsSingleBandPseudoColorRendererWidget().
| bool QgsStyleV2::detagSymbol | ( | StyleEntity | type, |
| QString | symbol, | ||
| QStringList | tags | ||
| ) |
detags the symbol with the given list
Removes the given tags for the specified symbol or colorramp
| type | is either SymbolEntity or ColorrampEntity |
| symbol | is the name of the symbol or colorramp |
| tags | is the list of tags that are to be removed as QStringList |
Definition at line 862 of file qgsstylev2.cpp.
References mCurrentDB, QgsDebugMsg, runEmptyQuery(), and SymbolEntity.
Referenced by QgsStyleV2ManagerDialog::tagsChanged().
| QString QgsStyleV2::errorString | ( | ) | [inline] |
return last error from load/save operation
Definition at line 275 of file qgsstylev2.h.
Referenced by QgsStyleV2ExportImportDialog::doExportImport(), and QgsStyleV2ExportImportDialog::populateStyles().
| bool QgsStyleV2::exportXML | ( | QString | filename | ) |
Exports the style as a XML file.
Definition at line 1274 of file qgsstylev2.cpp.
References mColorRamps, mErrorString, mFileName, mSymbols, QgsDebugMsg, saveColorRamp(), QgsSymbolLayerV2Utils::saveSymbols(), and STYLE_CURRENT_VERSION.
Referenced by QgsStyleV2ExportImportDialog::doExportImport().
| QString QgsStyleV2::fileName | ( | ) | [inline] |
return current file name of the style
Definition at line 278 of file qgsstylev2.h.
| QStringList QgsStyleV2::findSymbols | ( | QString | qword | ) |
return the names of the symbols which have a matching 'substring' in its defintion
Definition at line 747 of file qgsstylev2.cpp.
References mCurrentDB, and QgsDebugMsg.
Referenced by QgsStyleV2ManagerDialog::filterSymbols(), and QgsSymbolsListWidget::on_groupsCombo_editTextChanged().
| char * QgsStyleV2::getGroupRemoveQuery | ( | int | id | ) | [protected] |
prepares the complex query for removing a group, so that the children are not abandoned
Definition at line 656 of file qgsstylev2.cpp.
References mCurrentDB.
Referenced by remove().
| int QgsStyleV2::getId | ( | QString | table, |
| QString | name | ||
| ) | [protected] |
gets the id from the table for the given name from the database, 0 if not found
Definition at line 954 of file qgsstylev2.cpp.
References mCurrentDB.
Referenced by colorrampId(), groupId(), smartgroupId(), symbolId(), and tagId().
| bool QgsStyleV2::group | ( | StyleEntity | type, |
| QString | name, | ||
| int | groupid | ||
| ) |
applies the specified group to the symbol or colorramp specified by StyleEntity
| type | is either SymbolEntity of ColorrampEntity |
| name | is the name of the symbol or coloramp whose group is to be set |
| groupid | is the id of the group to which the entity is assigned |
Definition at line 726 of file qgsstylev2.cpp.
References ColorrampEntity, QgsDebugMsg, runEmptyQuery(), and SymbolEntity.
Referenced by childGroupNames(), QgsStyleV2ManagerDialog::listitemsContextMenu(), QgsStyleV2ManagerDialog::regrouped(), and smartgroupsListMap().
| int QgsStyleV2::groupId | ( | QString | group | ) |
return the DB id for the given group name
Definition at line 982 of file qgsstylev2.cpp.
References getId().
Referenced by QgsStyleV2ManagerDialog::listitemsContextMenu(), QgsStyleV2ExportImportDialog::moveStyles(), and symbolsOfSmartgroup().
| QStringList QgsStyleV2::groupNames | ( | ) |
return the all the groups in the style
Definition at line 449 of file qgsstylev2.cpp.
References mCurrentDB, and SymgroupName.
Referenced by childGroupNames(), QgsStyleV2ManagerDialog::listitemsContextMenu(), QgsStyleV2ExportImportDialog::moveStyles(), QgsStyleV2ExportImportDialog::QgsStyleV2ExportImportDialog(), and smartgroupsListMap().
| bool QgsStyleV2::importXML | ( | QString | filename | ) |
Imports the symbols and colorramps into the default style database from the given XML file.
Definition at line 1317 of file qgsstylev2.cpp.
References addColorRamp(), addSymbol(), QgsSymbolLayerV2Utils::loadColorRamp(), QgsSymbolLayerV2Utils::loadSymbol(), QgsSymbolLayerV2Utils::loadSymbols(), mErrorString, mFileName, QgsDebugMsg, STYLE_CURRENT_VERSION, and symbol().
Referenced by QgsStyleV2ExportImportDialog::populateStyles().
| bool QgsStyleV2::load | ( | QString | filename | ) |
load a file into the style
Definition at line 290 of file qgsstylev2.cpp.
References ColorrampName, ColorrampXML, QgsSymbolLayerV2Utils::loadColorRamp(), QgsSymbolLayerV2Utils::loadSymbol(), mColorRamps, mCurrentDB, mErrorString, mFileName, mSymbols, openDB(), QgsDebugMsg, runEmptyQuery(), symbol(), SymbolName, and SymbolXML.
Referenced by defaultStyle().
| bool QgsStyleV2::openDB | ( | QString | filename | ) | [protected] |
convenience function to open the DB and return a sqlite3 object
Definition at line 277 of file qgsstylev2.cpp.
References mCurrentDB, and mErrorString.
Referenced by load().
| void QgsStyleV2::remove | ( | StyleEntity | type, |
| int | id | ||
| ) |
remove the specified entity from the db
| type | is any of the style entites. Refer enum StyleEntity. |
| id | is the DB id of the entity to be removed |
Definition at line 674 of file qgsstylev2.cpp.
References ColorrampEntity, getGroupRemoveQuery(), GroupEntity, QgsDebugMsg, runEmptyQuery(), SmartgroupEntity, SymbolEntity, and TagEntity.
Referenced by QgsStyleV2ManagerDialog::editSmartgroupAction(), and QgsStyleV2ManagerDialog::removeGroup().
| bool QgsStyleV2::removeColorRamp | ( | QString | name | ) |
remove color ramp from style (and delete it)
Definition at line 238 of file qgsstylev2.cpp.
References mColorRamps, QgsDebugMsg, and runEmptyQuery().
Referenced by QgsStyleV2ManagerDialog::removeColorRamp().
| bool QgsStyleV2::removeSymbol | ( | QString | name | ) |
remove symbol from style (and delete it)
Definition at line 135 of file qgsstylev2.cpp.
References mCurrentDB, mSymbols, QgsDebugMsg, symbol(), SymbolEntity, and symbolId().
Referenced by QgsStyleV2ManagerDialog::removeSymbol().
| void QgsStyleV2::rename | ( | StyleEntity | type, |
| int | id, | ||
| QString | newName | ||
| ) |
rename the given entity with the specified id
| type | is any of the style entites. Refer enum StyleEntity. |
| id | is the DB id of the entity which is to be renamed |
| newName | is the new name of the entity |
Definition at line 628 of file qgsstylev2.cpp.
References ColorrampEntity, GroupEntity, mErrorString, QgsDebugMsg, runEmptyQuery(), SmartgroupEntity, SymbolEntity, and TagEntity.
Referenced by QgsStyleV2ManagerDialog::groupRenamed(), renameColorRamp(), and renameSymbol().
| bool QgsStyleV2::renameColorRamp | ( | QString | oldName, |
| QString | newName | ||
| ) |
change ramp's name
Definition at line 427 of file qgsstylev2.cpp.
References ColorrampEntity, mColorRamps, mCurrentDB, and rename().
Referenced by QgsStyleV2ManagerDialog::itemChanged().
| bool QgsStyleV2::renameSymbol | ( | QString | oldName, |
| QString | newName | ||
| ) |
change symbol's name
Definition at line 401 of file qgsstylev2.cpp.
References mCurrentDB, mSymbols, QgsDebugMsg, rename(), symbol(), SymbolEntity, and symbolId().
Referenced by QgsStyleV2ManagerDialog::itemChanged().
| bool QgsStyleV2::runEmptyQuery | ( | char * | query, |
| bool | freeQuery = true |
||
| ) | [protected] |
convenience function that would run queries which don't generate return values
| query | query to run |
| freeQuery | release query memory |
Definition at line 705 of file qgsstylev2.cpp.
References mCurrentDB, and QgsDebugMsg.
Referenced by addSmartgroup(), detagSymbol(), group(), load(), remove(), removeColorRamp(), rename(), saveColorRamp(), saveSymbol(), and updateSymbol().
| bool QgsStyleV2::save | ( | QString | filename = QString() | ) |
save style into a file (will use current filename if empty string is passed)
Definition at line 356 of file qgsstylev2.cpp.
References mColorRamps, mErrorString, mFileName, mSymbols, saveColorRamp(), QgsSymbolLayerV2Utils::saveSymbols(), and STYLE_CURRENT_VERSION.
Referenced by QgsColorRampComboBox::colorRampChanged(), and QgsStyleV2ManagerDialog::onFinished().
| bool QgsStyleV2::saveColorRamp | ( | QString | name, |
| QgsVectorColorRampV2 * | ramp, | ||
| int | groupid, | ||
| QStringList | tags | ||
| ) |
add the colorramp to the DB
| name | is the name of the colorramp as QString |
| ramp | is the pointer to the new QgsVectorColorRampV2 being saved |
| groupid | is the id of the group to which the Color Ramp belongs. Pass 0 if it doesn't belong to any group or not known. |
| tags | is a list of tags that are associated with the color ramp as a QStringList. |
Definition at line 209 of file qgsstylev2.cpp.
References QgsDebugMsg, and runEmptyQuery().
Referenced by addColorRamp(), exportXML(), QgsStyleV2ExportImportDialog::moveStyles(), save(), and updateSymbol().
| bool QgsStyleV2::saveSymbol | ( | QString | name, |
| QgsSymbolV2 * | symbol, | ||
| int | groupid, | ||
| QStringList | tags | ||
| ) |
add the symbol to the DB with the tags
| name | is the name of the symbol as QString |
| symbol | is the pointer to the new QgsSymbolV2 being saved |
| groupid | is the id of the group to which the symbol belongs. Pass 0 if it doesn't belong to any group or not known. |
| tags | is a list of tags that are associated with the symbol as a QStringList. |
Definition at line 107 of file qgsstylev2.cpp.
References QgsDebugMsg, and runEmptyQuery().
Referenced by addSymbol(), QgsSymbolsListWidget::addSymbolToStyle(), QgsStyleV2ExportImportDialog::moveStyles(), and updateSymbol().
| QgsSmartConditionMap QgsStyleV2::smartgroup | ( | int | id | ) |
returns the QgsSmartConditionMap for the given id
Definition at line 1201 of file qgsstylev2.cpp.
References mCurrentDB, and QgsDebugMsg.
Referenced by QgsStyleV2ManagerDialog::editSmartgroupAction().
| int QgsStyleV2::smartgroupId | ( | QString | smartgroup | ) |
return the DB id for the given smartgroup name
Definition at line 992 of file qgsstylev2.cpp.
References getId().
Referenced by QgsSymbolsListWidget::on_groupsCombo_currentIndexChanged().
| QStringList QgsStyleV2::smartgroupNames | ( | ) |
returns the smart groups list
Definition at line 1062 of file qgsstylev2.cpp.
References mCurrentDB, and QgsDebugMsg.
Referenced by QgsSymbolsListWidget::QgsSymbolsListWidget().
| QString QgsStyleV2::smartgroupOperator | ( | int | id | ) |
returns the operator for the smartgroup
Definition at line 1243 of file qgsstylev2.cpp.
References mCurrentDB, and QgsDebugMsg.
Referenced by QgsStyleV2ManagerDialog::editSmartgroupAction().
returns the smart groups map with id as key and name as value
Definition at line 1036 of file qgsstylev2.cpp.
References group(), groupNames(), mCurrentDB, QgsDebugMsg, SmartgroupId, and SmartgroupName.
Referenced by QgsStyleV2ManagerDialog::populateGroups().
| QgsSymbolV2 * QgsStyleV2::symbol | ( | QString | name | ) |
return a NEW copy of symbol
Definition at line 163 of file qgsstylev2.cpp.
References QgsSymbolV2::clone(), and symbolRef().
Referenced by QgsSymbolV2::defaultSymbol(), QgsStyleV2ManagerDialog::editSymbol(), importXML(), load(), QgsStyleV2ExportImportDialog::moveStyles(), QgsStyleV2ExportImportDialog::populateStyles(), QgsSymbolsListWidget::populateSymbols(), QgsStyleV2ManagerDialog::populateSymbols(), removeSymbol(), renameSymbol(), QgsSymbolsListWidget::setSymbolFromStyle(), and updateSymbol().
| int QgsStyleV2::symbolCount | ( | ) |
return count of symbols in style
Definition at line 174 of file qgsstylev2.cpp.
References mSymbols.
| int QgsStyleV2::symbolId | ( | QString | name | ) |
return the id in the style database for the given symbol name returns 0 if not found
Definition at line 972 of file qgsstylev2.cpp.
References getId().
Referenced by removeSymbol(), renameSymbol(), symbolsWithTag(), tagsOfSymbol(), and tagSymbol().
| QStringList QgsStyleV2::symbolNames | ( | ) |
return a list of names of symbols
Definition at line 179 of file qgsstylev2.cpp.
References mSymbols.
Referenced by QgsStyleV2ManagerDialog::addSymbol(), QgsSymbolsListWidget::addSymbolToStyle(), QgsStyleV2ManagerDialog::groupChanged(), QgsStyleV2ExportImportDialog::moveStyles(), QgsSymbolsListWidget::on_groupsCombo_currentIndexChanged(), QgsStyleV2ExportImportDialog::populateStyles(), QgsSymbolsListWidget::populateSymbolView(), QgsStyleV2ManagerDialog::populateTypes(), symbolsOfSmartgroup(), and updateSymbol().
| const QgsSymbolV2 * QgsStyleV2::symbolRef | ( | QString | name | ) | const |
return a const pointer to a symbol (doesn't create new instance)
Definition at line 169 of file qgsstylev2.cpp.
References mSymbols.
Referenced by QgsStyleV2ManagerDialog::populateTypes(), and symbol().
| QStringList QgsStyleV2::symbolsOfGroup | ( | StyleEntity | type, |
| int | groupid | ||
| ) |
returns the symbolnames of a given groupid
| type | is either SymbolEntity or ColorampEntity |
| groupid | is id of the group to which the symbols belong to, as int |
Definition at line 510 of file qgsstylev2.cpp.
References ColorrampEntity, mCurrentDB, QgsDebugMsg, and SymbolEntity.
Referenced by QgsStyleV2ManagerDialog::groupChanged(), QgsSymbolsListWidget::on_groupsCombo_currentIndexChanged(), and symbolsOfSmartgroup().
| QStringList QgsStyleV2::symbolsOfSmartgroup | ( | StyleEntity | type, |
| int | id | ||
| ) |
returns the symbols for the smartgroup
Definition at line 1087 of file qgsstylev2.cpp.
References colorRampNames(), groupId(), mCurrentDB, QgsDebugMsg, SymbolEntity, symbolNames(), symbolsOfGroup(), symbolsWithTag(), and tagId().
Referenced by QgsStyleV2ManagerDialog::groupChanged(), and QgsSymbolsListWidget::on_groupsCombo_currentIndexChanged().
| QStringList QgsStyleV2::symbolsWithTag | ( | StyleEntity | type, |
| int | tagid | ||
| ) |
returns the symbol names with which have the given tag
| type | is either SymbolEntity or ColorampEntity |
| tagid | is id of the tag which has been applied over the symbol as int |
Definition at line 547 of file qgsstylev2.cpp.
References ColorrampEntity, mCurrentDB, QgsDebugMsg, SymbolEntity, and symbolId().
Referenced by symbolsOfSmartgroup().
| int QgsStyleV2::tagId | ( | QString | tag | ) |
return the DB id for the given tag name
Definition at line 987 of file qgsstylev2.cpp.
References getId().
Referenced by symbolsOfSmartgroup().
| QStringList QgsStyleV2::tagsOfSymbol | ( | StyleEntity | type, |
| QString | symbol | ||
| ) |
return the tags associated with the symbol
| type | is either SymbolEntity or ColorrampEntity |
| symbol | is the name of the symbol or color ramp |
Definition at line 915 of file qgsstylev2.cpp.
References colorrampId(), mCurrentDB, QgsDebugMsg, SymbolEntity, and symbolId().
Referenced by QgsStyleV2ManagerDialog::symbolSelected().
| bool QgsStyleV2::tagSymbol | ( | StyleEntity | type, |
| QString | symbol, | ||
| QStringList | tags | ||
| ) |
tags the symbol with the tags in the list
Applies the given tags to the given symbol or colorramp
| type | is either SymbolEntity or ColorrampEntity |
| symbol | is the name of the symbol or colorramp as QString |
| tags | is the list of the tags that are to be applied as QStringList |
Definition at line 810 of file qgsstylev2.cpp.
References addTag(), colorrampId(), mCurrentDB, QgsDebugMsg, SymbolEntity, and symbolId().
Referenced by QgsStyleV2ManagerDialog::tagsChanged().
| bool QgsStyleV2::updateSymbol | ( | StyleEntity | type, |
| QString | name | ||
| ) | [protected] |
updates the properties of an existing symbol/colorramp
| type | is either SymbolEntity or ColorrampEntity |
| name | is the name of an existing symbol or a color ramp |
Definition at line 1413 of file qgsstylev2.cpp.
References colorRamp(), ColorrampEntity, colorRampNames(), QgsDebugMsg, runEmptyQuery(), saveColorRamp(), saveSymbol(), symbol(), SymbolEntity, and symbolNames().
Referenced by addColorRamp(), and addSymbol().
QgsVectorColorRampV2Map QgsStyleV2::mColorRamps [protected] |
Definition at line 316 of file qgsstylev2.h.
Referenced by addColorRamp(), clear(), colorRampCount(), colorRampNames(), colorRampRef(), exportXML(), load(), removeColorRamp(), renameColorRamp(), and save().
sqlite3* QgsStyleV2::mCurrentDB [protected] |
Definition at line 321 of file qgsstylev2.h.
Referenced by addGroup(), addSmartgroup(), addTag(), childGroupNames(), clear(), detagSymbol(), findSymbols(), getGroupRemoveQuery(), getId(), groupNames(), load(), openDB(), QgsStyleV2(), removeSymbol(), renameColorRamp(), renameSymbol(), runEmptyQuery(), smartgroup(), smartgroupNames(), smartgroupOperator(), smartgroupsListMap(), symbolsOfGroup(), symbolsOfSmartgroup(), symbolsWithTag(), tagsOfSymbol(), and tagSymbol().
QgsStyleV2 * QgsStyleV2::mDefaultStyle = 0 [static, protected] |
Definition at line 323 of file qgsstylev2.h.
Referenced by defaultStyle().
QString QgsStyleV2::mErrorString [protected] |
Definition at line 318 of file qgsstylev2.h.
Referenced by exportXML(), importXML(), load(), openDB(), rename(), and save().
QString QgsStyleV2::mFileName [protected] |
Definition at line 319 of file qgsstylev2.h.
Referenced by exportXML(), importXML(), load(), and save().
QgsSymbolV2Map QgsStyleV2::mSymbols [protected] |
Definition at line 315 of file qgsstylev2.h.
Referenced by addSymbol(), clear(), exportXML(), load(), removeSymbol(), renameSymbol(), save(), symbolCount(), symbolNames(), and symbolRef().