18 #ifndef QGSCOLORSCHEME_H
19 #define QGSCOLORSCHEME_H
26 #include "qgis_core.h"
52 sipType = sipType_QgsUserColorScheme;
54 sipType = sipType_QgsRecentColorScheme;
56 sipType = sipType_QgsCustomColorScheme;
58 sipType = sipType_QgsProjectColorScheme;
60 sipType = sipType_QgsGplColorScheme;
62 sipType = sipType_QgsColorScheme;
73 ShowInColorDialog = 0x01,
74 ShowInColorButtonMenu = 0x02,
75 ShowInAllContexts = ShowInColorDialog | ShowInColorButtonMenu
77 Q_DECLARE_FLAGS( SchemeFlags, SchemeFlag )
90 virtual QString schemeName()
const = 0;
96 virtual SchemeFlags
flags()
const {
return ShowInColorDialog; }
110 const QColor &baseColor = QColor() ) = 0;
127 virtual bool setColors(
const QgsNamedColorList &colors,
const QString &context = QString(),
const QColor &baseColor = QColor() );
136 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsColorScheme::SchemeFlags )
154 const QColor &baseColor = QColor() )
override;
156 bool setColors(
const QgsNamedColorList &colors,
const QString &context = QString(),
const QColor &baseColor = QColor() )
override;
164 virtual QString gplFilePath() = 0;
191 QgsColorScheme::SchemeFlags
flags()
const override;
197 void setName(
const QString &name ) { mName = name; }
210 void setShowSchemeInMenu(
bool show );
218 bool mEditable =
false;
239 QString
schemeName()
const override {
return QObject::tr(
"Recent colors" ); }
244 const QColor &baseColor = QColor() )
override;
254 static
void addRecentColor( const QColor &color );
261 static QColor lastUsedColor();
279 QString
schemeName()
const override {
return QObject::tr(
"Standard colors" ); }
284 const QColor &baseColor = QColor() )
override;
288 bool setColors(
const QgsNamedColorList &colors,
const QString &context = QString(),
const QColor &baseColor = QColor() )
override;
308 QString
schemeName()
const override {
return QObject::tr(
"Project colors" ); }
313 const QColor &baseColor = QColor() )
override;
317 bool setColors(
const QgsNamedColorList &colors,
const QString &context = QString(),
const QColor &baseColor = QColor() )
override;