QGIS API Documentation  3.14.0-Pi (9f7028fd23)
qgstextcharacterformat.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgstextcharacterformat.h
3  -----------------
4  begin : May 2020
5  copyright : (C) 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 QGSTEXTCHARACTERFORMAT_H
17 #define QGSTEXTCHARACTERFORMAT_H
18 
19 #include "qgis_sip.h"
20 #include "qgis_core.h"
21 
22 #include <QFont>
23 #include <QColor>
24 
25 class QTextCharFormat;
26 
39 class CORE_EXPORT QgsTextCharacterFormat
40 {
41  public:
42 
46  QgsTextCharacterFormat() = default;
47 
51  QgsTextCharacterFormat( const QTextCharFormat &format );
52 
54  enum class BooleanValue
55  {
56  NotSet,
57  SetTrue,
58  SetFalse,
59  };
60 
67  QColor textColor() const;
68 
77  void setTextColor( const QColor &textColor );
78 
79 #if 0
80 
87  int fontWeight() const;
88 
97  void setFontWeight( int fontWeight );
98 
104  BooleanValue italic() const;
105 
111  void setItalic( BooleanValue enabled );
112 #endif
113 
119  BooleanValue strikeOut() const;
120 
126  void setStrikeOut( BooleanValue enabled );
127 
133  BooleanValue underline() const;
134 
140  void setUnderline( BooleanValue enabled );
141 
147  BooleanValue overline() const;
148 
154  void setOverline( BooleanValue enabled );
155 
160  void updateFontForFormat( QFont &font ) const;
161 
162  private:
163 
164  QColor mTextColor;
165 
166 #if 0 // settings which affect font metrics are disabled for now
167  int mFontWeight = -1;
168  BooleanValue mItalic = BooleanValue::NotSet;
169  double mFontPointSize = -1;
170  QString mFontFamily;
171 #endif
172 
173  BooleanValue mStrikethrough = BooleanValue::NotSet;
174  BooleanValue mUnderline = BooleanValue::NotSet;
175  BooleanValue mOverline = BooleanValue::NotSet;
176 };
177 
178 #endif // QGSTEXTCHARACTERFORMAT_H
QgsTextCharacterFormat
Definition: qgstextcharacterformat.h:39
QgsTextCharacterFormat::BooleanValue
BooleanValue
Status values for boolean format properties.
Definition: qgstextcharacterformat.h:54
qgis_sip.h