QGIS API Documentation 3.41.0-Master (af5edcb665c)
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:
36 enum class ColorRole
37 {
38 Default,
39 Keyword,
40 Class,
41 Method,
42 Decoration,
43 Number,
44 Comment,
45 CommentLine,
46 CommentBlock,
47 Background,
48 Cursor,
49 CaretLine,
50 SingleQuote,
51 DoubleQuote,
52 TripleSingleQuote,
53 TripleDoubleQuote,
54 Operator,
55 QuotedOperator,
56 Identifier,
57 QuotedIdentifier,
58 Tag,
59 UnknownTag,
60 MarginBackground,
61 MarginForeground,
62 SelectionBackground,
63 SelectionForeground,
64 MatchedBraceBackground,
65 MatchedBraceForeground,
66 Edge,
67 Fold,
68 Error,
69 ErrorBackground,
70 FoldIconForeground,
71 FoldIconHalo,
72 IndentationGuide,
73 SearchMatchBackground,
74 };
75
83 QgsCodeEditorColorScheme( const QString &id = QString(), const QString &name = QString() );
84
85
89 QString id() const { return mId; }
90
94 QString name() const { return mThemeName; }
95
101 QColor color( ColorRole role ) const;
102
108 void setColor( ColorRole role, const QColor &color );
109
115 void setColors( const QMap<ColorRole, QColor> &colors ) SIP_SKIP;
116
117 private:
118 QString mId;
119 QString mThemeName;
120 QMap<ColorRole, QColor> mColors;
121};
122
123#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