18#ifndef QGSCOLORSCHEME_H
19#define QGSCOLORSCHEME_H
53 sipType = sipType_QgsUserColorScheme;
55 sipType = sipType_QgsRecentColorScheme;
57 sipType = sipType_QgsCustomColorScheme;
59 sipType = sipType_QgsProjectColorScheme;
61 sipType = sipType_QgsGplColorScheme;
63 sipType = sipType_QgsColorScheme;
124 virtual bool setColors(
const QgsNamedColorList &colors,
const QString &context = QString(),
const QColor &baseColor = QColor() );
147 bool setColors(
const QgsNamedColorList &colors,
const QString &context = QString(),
const QColor &baseColor = QColor() )
override;
196 void setShowSchemeInMenu(
bool show );
222 QString
schemeName()
const override {
return QObject::tr(
"Recent colors" ); }
226 QgsNamedColorList fetchColors(
const QString &context = QString(),
const QColor &baseColor = QColor() )
override;
235 static
void addRecentColor( const QColor &color );
241 static QColor lastUsedColor();
258 QString
schemeName()
const override {
return QObject::tr(
"Standard colors" ); }
262 QgsNamedColorList fetchColors(
const QString &context = QString(),
const QColor &baseColor = QColor() )
override;
266 bool setColors(
const QgsNamedColorList &colors,
const QString &context = QString(),
const QColor &baseColor = QColor() )
override;
298 QString
schemeName()
const override {
return QObject::tr(
"Project colors" ); }
302 QgsNamedColorList fetchColors(
const QString &context = QString(),
const QColor &baseColor = QColor() )
override;
306 bool setColors(
const QgsNamedColorList &colors,
const QString &context = QString(),
const QColor &baseColor = QColor() )
override;
SchemeFlag
Flags for controlling behavior of color scheme.
@ ShowInAllContexts
Show scheme in all contexts.
@ ShowInColorButtonMenu
Show scheme in color button drop-down menu.
@ ShowInColorDialog
Show scheme in color picker dialog.
virtual QgsColorScheme * clone() const =0
Clones a color scheme.
virtual QString schemeName() const =0
Gets the name for the color scheme.
virtual SchemeFlags flags() const
Returns the current flags for the 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
static const QgsSettingsEntryVariant * settingsPaletteLabels
static const QgsSettingsEntryVariant * settingsPaletteColors
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.
QgsNamedColorList fetchColors(const QString &context=QString(), const QColor &baseColor=QColor()) override
Gets a list of colors from the scheme.
bool setColors(const QgsNamedColorList &colors, const QString &context=QString(), const QColor &baseColor=QColor()) override
Sets the colors for the scheme.
QgsGplColorScheme()=default
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.
bool isEditable() const override
Returns whether the color scheme is editable.
QString schemeName() const override
Gets the name for the color scheme.
Q_DECL_DEPRECATED QgsProjectColorScheme()
Constructor for a project color scheme bound to the current QgsProject instance().
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
A color scheme which contains the most recently used colors.
QgsRecentColorScheme()=default
static const QgsSettingsEntryVariant * settingsRecentColors
QString schemeName() const override
Gets the name for the color scheme.
SchemeFlags flags() const override
Returns the current flags for the color scheme.
A string list settings entry.
A variant settings entry.
A color scheme which stores its colors in a gpl palette file within the "palettes" subfolder off the ...
QString schemeName() const override
Gets the name for the color scheme.
void setName(const QString &name)
Sets the name for the scheme.
QgsUserColorScheme(const QString &filename)
Constructs a new user color scheme, using a specified gpl palette file.
QString gplFilePath() override
Returns the file path for the associated gpl palette file.
static const QgsSettingsEntryStringList * settingsShowInMenuList
bool isEditable() const override
Returns whether the color scheme is editable.
QgsUserColorScheme * clone() const override
Clones a color scheme.
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)