19 #include "qgis_core.h" 43 #define QGSCLIPBOARD_STYLE_MIME "application/qgis.style" 130 int addTag(
const QString &tagName );
155 int addSmartgroup(
const QString &name,
const QString &op,
const QStringList &matchTag,
const QStringList &noMatchTag,
156 const QStringList &matchName,
const QStringList &noMatchName );
164 QStringList tags()
const;
176 int colorRampCount();
179 QStringList colorRampNames();
182 const QgsColorRamp *colorRampRef(
const QString &name )
const;
188 int colorrampId(
const QString &name );
194 static void cleanDefaultStyle() SIP_SKIP;
205 bool tagSymbol(
StyleEntity type, const QString &symbol, const QStringList &tags );
216 bool detagSymbol(
StyleEntity type, const QString &symbol, const QStringList &tags );
226 bool detagSymbol(
StyleEntity type, const QString &symbol );
229 bool removeSymbol( const QString &name );
236 bool renameSymbol( const QString &oldName, const QString &newName );
239 QgsSymbol *symbol( const QString &name ) SIP_FACTORY;
242 const
QgsSymbol *symbolRef( const QString &name ) const;
248 QStringList symbolNames();
254 int symbolId( const QString &name );
256 int tagId( const QString &tag );
258 int smartgroupId( const QString &smartgroup );
266 QStringList symbolsOfFavorite(
StyleEntity type ) const;
275 QStringList symbolsWithTag(
StyleEntity type,
int tagid ) const;
284 bool addFavorite(
StyleEntity type, const QString &name );
293 bool removeFavorite(
StyleEntity type, const QString &name );
302 bool rename(
StyleEntity type,
int id, const QString &newName );
321 bool saveSymbol( const QString &name,
QgsSymbol *symbol,
bool favorite, const QStringList &tags );
332 bool saveColorRamp( const QString &name,
QgsColorRamp *ramp,
bool favorite, const QStringList &tags );
335 bool removeColorRamp( const QString &name );
338 bool renameColorRamp( const QString &oldName, const QString &newName );
348 bool createDatabase( const QString &filename );
358 bool createMemoryDatabase();
378 bool load( const QString &filename );
381 bool save( QString filename = QString() );
384 QString errorString() {
return mErrorString; }
396 QStringList findSymbols(
StyleEntity type,
const QString &qword );
405 QStringList tagsOfSymbol(
StyleEntity type,
const QString &symbol );
415 bool symbolHasTag(
StyleEntity type,
const QString &symbol,
const QString &tag );
418 QString tag(
int id )
const;
424 QStringList smartgroupNames();
433 QString smartgroupOperator(
int id );
436 QStringList symbolsOfSmartgroup(
StyleEntity type,
int id );
439 bool exportXml(
const QString &filename );
442 bool importXml(
const QString &filename );
452 static bool isXmlStyleFile(
const QString &path );
464 void symbolSaved(
const QString &name,
QgsSymbol *symbol );
474 void symbolChanged(
const QString &name );
477 void groupsModified();
484 void entityTagsChanged(
QgsStyle::StyleEntity entity,
const QString &name,
const QStringList &newTags );
500 void symbolRemoved(
const QString &name );
507 void symbolRenamed(
const QString &oldName,
const QString &newName );
514 void rampRenamed(
const QString &oldName,
const QString &newName );
523 void rampAdded(
const QString &name );
532 void rampRemoved(
const QString &name );
542 void rampChanged(
const QString &name );
549 QHash< QString, QStringList > mCachedSymbolTags;
550 QHash< QString, QStringList > mCachedColorRampTags;
552 QString mErrorString;
560 bool openDatabase(
const QString &filename );
568 bool runEmptyQuery(
const QString &query );
571 int getId(
const QString &table,
const QString &name );
574 QString getName(
const QString &table,
int id )
const;
584 bool updateSymbol(
StyleEntity type,
const QString &name );
586 void clearCachedTags(
StyleEntity type,
const QString &name );
Abstract base class for all rendered symbols.
Abstract base class for color ramps.
QMap< int, QString > QgsSymbolGroupMap
StyleEntity
Enum for Entities involved in a style.
Unique pointer for sqlite3 databases, which automatically closes the database when the pointer goes o...
QMap< QString, QgsColorRamp *> QgsVectorColorRampMap
QString fileName()
Returns current file name of the style.
QMap< QString, QgsSymbol *> QgsSymbolMap
QMultiMap< QString, QString > QgsSmartConditionMap
A multimap to hold the smart group conditions as constraint and parameter pairs.