18#ifndef QGSCOLORSCHEME_H
19#define QGSCOLORSCHEME_H
50 sipType = sipType_QgsUserColorScheme;
52 sipType = sipType_QgsRecentColorScheme;
54 sipType = sipType_QgsCustomColorScheme;
56 sipType = sipType_QgsProjectColorScheme;
58 sipType = sipType_QgsGplColorScheme;
60 sipType = sipType_QgsColorScheme;
71 ShowInColorDialog = 0x01,
72 ShowInColorButtonMenu = 0x02,
73 ShowInAllContexts = ShowInColorDialog | ShowInColorButtonMenu
88 virtual QString schemeName() const = 0;
94 virtual
SchemeFlags flags()
const {
return ShowInColorDialog; }
108 const QColor &baseColor = QColor() ) = 0;
125 virtual bool setColors(
const QgsNamedColorList &colors,
const QString &context = QString(),
const QColor &baseColor = QColor() );
151 const QColor &baseColor = QColor() )
override;
153 bool setColors(
const QgsNamedColorList &colors,
const QString &context = QString(),
const QColor &baseColor = QColor() )
override;
181 QString schemeName()
const override;
193 void setName(
const QString &name ) { mName = name; }
205 void setShowSchemeInMenu(
bool show );
213 bool mEditable =
false;
215 QString gplFilePath()
override;
233 QString
schemeName()
const override {
return QObject::tr(
"Recent colors" ); }
238 const QColor &baseColor = QColor() )
override;
247 static
void addRecentColor( const QColor &color );
253 static QColor lastUsedColor();
270 QString
schemeName()
const override {
return QObject::tr(
"Standard colors" ); }
275 const QColor &baseColor = QColor() )
override;
279 bool setColors(
const QgsNamedColorList &colors,
const QString &context = QString(),
const QColor &baseColor = QColor() )
override;
298 QString
schemeName()
const override {
return QObject::tr(
"Project colors" ); }
303 const QColor &baseColor = QColor() )
override;
307 bool setColors(
const QgsNamedColorList &colors,
const QString &context = QString(),
const QColor &baseColor = QColor() )
override;
Abstract base class for color schemes.
SchemeFlag
Flags for controlling behavior of color scheme.
virtual QgsColorScheme * clone() const =0
Clones a color scheme.
QFlags< SchemeFlag > SchemeFlags
virtual QgsNamedColorList fetchColors(const QString &context=QString(), const QColor &baseColor=QColor())=0
Gets a list of colors from the scheme.
virtual bool isEditable() const
Returns whether the color scheme is editable.
A color scheme which contains custom colors set through QGIS app options dialog.
SchemeFlags flags() const override
Returns the current flags for the color scheme.
bool isEditable() const override
Returns whether the color scheme is editable.
QString schemeName() const override
Gets the name for the color scheme.
QgsCustomColorScheme()=default
Constructor for QgsCustomColorScheme.
A color scheme which stores its colors in a gpl palette file.
virtual QString gplFilePath()=0
Returns the file path for the associated gpl palette file.
QgsGplColorScheme()=default
Constructor for QgsGplColorScheme.
A color scheme which contains project specific colors set through project properties dialog.
SchemeFlags flags() const override
Returns the current flags for the color scheme.
QgsProjectColorScheme()=default
Constructor for QgsProjectColorScheme.
bool isEditable() const override
Returns whether the color scheme is editable.
QString schemeName() const override
Gets the name for the color scheme.
A color scheme which contains the most recently used colors.
QgsRecentColorScheme()=default
Constructor for QgsRecentColorScheme.
QString schemeName() const override
Gets the name for the color scheme.
SchemeFlags flags() const override
Returns the current flags for the color scheme.
A color scheme which stores its colors in a gpl palette file within the "palettes" subfolder off the ...
void setName(const QString &name)
Sets the name for the scheme.
bool isEditable() const override
Returns whether the color scheme is editable.
QList< QPair< QColor, QString > > QgsNamedColorList
List of colors paired with a friendly display name identifying the color.
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
#define SIP_ENUM_BASETYPE(type)
Q_DECLARE_OPERATORS_FOR_FLAGS(QgsTextRendererUtils::CurvedTextFlags)