16 #ifndef QGSMAPLAYERSTYLEMANAGER_H 17 #define QGSMAPLAYERSTYLEMANAGER_H 19 #include "qgis_core.h" 25 #include <QStringList> 56 QString xmlData()
const;
64 void readXml(
const QDomElement &styleElement );
66 void writeXml( QDomElement &styleElement )
const;
113 void readXml(
const QDomElement &mgrElement );
115 void writeXml( QDomElement &mgrElement )
const;
118 QStringList styles()
const;
125 QMap<QString, QgsMapLayerStyle> mapLayerStyles()
const;
140 bool addStyleFromLayer(
const QString &name );
146 bool removeStyle(
const QString &name );
152 bool renameStyle(
const QString &name,
const QString &newName );
155 QString currentStyle()
const;
161 bool setCurrentStyle(
const QString &name );
168 bool setOverrideStyle(
const QString &styleDef );
170 bool restoreOverrideStyle();
177 bool isDefault(
const QString &styleName )
const;
181 void styleAdded(
const QString &name );
183 void styleRemoved(
const QString &name );
185 void styleRenamed(
const QString &oldName,
const QString &newName );
187 void currentStyleChanged(
const QString ¤tName );
191 QMap<QString, QgsMapLayerStyle> mStyles;
192 QString mCurrentStyle;
194 QString defaultStyleName()
const;
219 if ( mLayer && mStyleOverridden )
220 mLayer->styleManager()->restoreOverrideStyle();
231 if ( mStyleOverridden )
232 mLayer->styleManager()->restoreOverrideStyle();
234 mLayer->styleManager()->setOverrideStyle( style );
235 mStyleOverridden =
true;
242 bool mStyleOverridden =
false;
244 #endif // QGSMAPLAYERSTYLEMANAGER_H Base class for all map layer types.
Restore overridden layer style on destruction.
Stores style information (renderer, opacity, labeling, diagrams etc.) applicable to a map layer...
QgsMapLayer * layer() const
Gets pointer to the associated map layer.
~QgsMapLayerStyleOverride()
void setOverrideStyle(const QString &style)
Temporarily apply a different style to the layer.
Management of styles for use with one map layer.
QgsMapLayerStyleOverride(QgsMapLayer *layer)
Construct a style override object associated with a map layer.