KChart

KChartTextAttributes.h
1 /*
2  * Copyright (C) 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3  *
4  * This file is part of the KD Chart library.
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License as
8  * published by the Free Software Foundation; either version 2 of
9  * the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <https://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef KCHARTTEXTATTRIBUTES_H
21 #define KCHARTTEXTATTRIBUTES_H
22 
23 #include <QDebug>
24 #include <QMetaType>
25 #include "KChartGlobal.h"
26 #include "KChartMeasure.h"
27 
28 QT_BEGIN_NAMESPACE
29 class QPen;
30 class QFont;
31 class QTextDocument;
32 QT_END_NAMESPACE
33 
34 namespace KChart {
35 
43 class KCHART_EXPORT TextAttributes
44 {
45 public:
48  TextAttributes &operator= ( const TextAttributes& );
49  bool operator==( const TextAttributes& ) const;
50  inline bool operator!=( const TextAttributes& other ) const
51  { return !operator==(other); }
52 
53  ~TextAttributes();
54 
59  void setVisible( bool visible );
60 
64  bool isVisible() const;
65 
76  void setFont( const QFont& font );
77 
81  QFont font() const;
82 
88  void setFontSize( const Measure & measure );
89 
93  Measure fontSize() const;
94 
100  void setMinimalFontSize( const Measure & measure );
101 
105  Measure minimalFontSize() const;
106 
114  qreal calculatedFontSize( const QSizeF &referenceSize,
115  KChartEnums::MeasureOrientation autoReferenceOrientation ) const;
116 
124 #if defined(Q_COMPILER_MANGLES_RETURN_TYPE)
125  const qreal calculatedFontSize(
126 #else
127  qreal calculatedFontSize(
128 #endif
129  const QObject* autoReferenceArea,
130  KChartEnums::MeasureOrientation autoReferenceOrientation ) const;
131 
139  const QFont calculatedFont(
140  const QObject* autoReferenceArea,
141  KChartEnums::MeasureOrientation autoReferenceOrientation ) const;
142 
146  bool hasAbsoluteFontSize() const;
147 
153  void setAutoRotate( bool autoRotate );
154 
159  bool autoRotate() const;
160 
166  void setAutoShrink( bool autoShrink );
167 
172  bool autoShrink() const;
173 
185  void setRotation( int rotation );
186  void resetRotation();
187  bool hasRotation() const;
188 
192  int rotation() const;
193 
198  void setPen( const QPen& pen );
199 
203  QPen pen() const;
204 
209  QTextDocument* textDocument() const;
210 
214  void setTextDocument(QTextDocument* layout);
215 
216  // FIXME KChartEnums::TextLayoutPolicy?
217 
218 private:
219  KCHART_DECLARE_PRIVATE_BASE_VALUE( TextAttributes )
220 
221 }; // End of class TextAttributes
222 
223 }
224 
225 #if !defined(QT_NO_DEBUG_STREAM)
226 KCHART_EXPORT QDebug operator<<(QDebug, const KChart::TextAttributes& );
227 #endif /* QT_NO_DEBUG_STREAM */
228 
229 KCHART_DECLARE_SWAP_SPECIALISATION( KChart::TextAttributes )
230 
231 QT_BEGIN_NAMESPACE
232 Q_DECLARE_TYPEINFO( KChart::TextAttributes, Q_MOVABLE_TYPE );
233 QT_END_NAMESPACE
234 Q_DECLARE_METATYPE( KChart::TextAttributes )
235 
236 #endif // KCHARTTEXTATTRIBUTES_H
Declaring the class KChart::Measure.
Class only listed here to document inheritance of some KChart classes.
Contains KChart macros.
MeasureOrientation
Measure orientation mode: the way how the absolute value of a KChart::Measure is determined during KC...
Definition: KChartEnums.h:287
QDataStream & operator<<(QDataStream &out, const KDateTime::Spec &spec)
Class only listed here to document inheritance of some KChart classes.
A set of text attributes.
Global namespace.
Measure is used to specify relative and absolute sizes in KChart, e.g.
Definition: KChartMeasure.h:48
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat Sep 19 2020 22:36:26 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.