QGIS API Documentation 3.41.0-Master (fda2aa46e9a)
Loading...
Searching...
No Matches
qgscodeeditorcolorscheme.h
Go to the documentation of this file.
1/***************************************************************************
2 qgscodeeditorcolorscheme.h
3 --------------------------------------
4 Date : October 2020
5 Copyright : (C) 2020 by Nyall Dawson
6 Email : nyall dot dawson at gmail dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#ifndef QGSCODEEDITORCOLORSCHEME_H
17#define QGSCODEEDITORCOLORSCHEME_H
18
19#include "qgis_gui.h"
20#include "qgis_sip.h"
21#include <QString>
22#include <QMap>
23#include <QColor>
24
31{
32 public:
33
37 enum class ColorRole
38 {
39 Default,
40 Keyword,
41 Class,
42 Method,
43 Decoration,
44 Number,
45 Comment,
46 CommentLine,
47 CommentBlock,
48 Background,
49 Cursor,
50 CaretLine,
51 SingleQuote,
52 DoubleQuote,
53 TripleSingleQuote,
54 TripleDoubleQuote,
55 Operator,
56 QuotedOperator,
57 Identifier,
58 QuotedIdentifier,
59 Tag,
60 UnknownTag,
61 MarginBackground,
62 MarginForeground,
63 SelectionBackground,
64 SelectionForeground,
65 MatchedBraceBackground,
66 MatchedBraceForeground,
67 Edge,
68 Fold,
69 Error,
70 ErrorBackground,
71 FoldIconForeground,
72 FoldIconHalo,
73 IndentationGuide,
74 SearchMatchBackground,
75 };
76
84 QgsCodeEditorColorScheme( const QString &id = QString(), const QString &name = QString() );
85
86
90 QString id() const { return mId; }
91
95 QString name() const { return mThemeName; }
96
102 QColor color( ColorRole role ) const;
103
109 void setColor( ColorRole role, const QColor &color );
110
116 void setColors( const QMap< ColorRole, QColor > &colors ) SIP_SKIP;
117
118 private:
119
120 QString mId;
121 QString mThemeName;
122 QMap< ColorRole, QColor > mColors;
123};
124
125#endif // QGSCODEEDITORCOLORSCHEME_H
Defines a color scheme for use in QgsCodeEditor widgets.
QString id() const
Returns the ID of the color scheme, which is a unique, non-translated identifier for the scheme.
QString name() const
Returns the name of the color scheme, which is the translated, user-visible name of the scheme.
#define SIP_SKIP
Definition qgis_sip.h:126