KD Reports  1.8
KDReportsTextElement.h
1 /****************************************************************************
2 ** Copyright (C) 2007-2020 Klaralvdalens Datakonsult AB. All rights reserved.
3 **
4 ** This file is part of the KD Reports library.
5 **
6 ** Licensees holding valid commercial KD Reports licenses may use this file in
7 ** accordance with the KD Reports Commercial License Agreement provided with
8 ** the Software.
9 **
10 **
11 ** This file may be distributed and/or modified under the terms of the
12 ** GNU Lesser General Public License version 2.1 and version 3 as published by the
13 ** Free Software Foundation and appearing in the file LICENSE.LGPL.txt included.
14 **
15 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17 **
18 ** Contact info@kdab.com if any conditions of this licensing are not
19 ** clear to you.
20 **
21 **********************************************************************/
22 
23 #ifndef KDREPORTSTEXTELEMENT_H
24 #define KDREPORTSTEXTELEMENT_H
25 
26 #include "KDReportsElement.h"
27 #include <QtCore/QString>
28 #include <QTextCharFormat>
29 
30 QT_BEGIN_NAMESPACE
31 class QColor;
32 class QFont;
33 QT_END_NAMESPACE
34 
35 namespace KDReports {
36 class TextElementPrivate;
37 
42 class KDREPORTS_EXPORT TextElement : public Element
43 {
44 public:
48  explicit TextElement( const QString& string = QString() );
52  virtual ~TextElement();
53 
58  TextElement(const TextElement &other);
62  TextElement &operator=(const TextElement &other);
63 
67  void setText( const QString& text );
68 
72  TextElement& operator<<( const QString& );
73 
75  void setFontFamily( const QString& family );
77  void setBold( bool bold );
79  void setItalic( bool italic );
81  void setUnderline( bool underline );
83  void setStrikeOut( bool strikeout );
85  void setPointSize( qreal size );
86 
94  void setFont( const QFont& );
95 
100  QFont font() const;
101 
106  void setTextColor( const QColor& color );
107 
112  QColor textColor() const;
113 
118  void setId( const QString& id );
119 
124  QString id() const;
125 
130  QString text() const;
131 
136  void build( ReportBuilder& builder ) const;
141  Element* clone() const;
142 
143 private:
144 
145  friend class ReportBuilder;
146  void setCharFormat( const QTextCharFormat& format );
147 
148  TextElementPrivate* const d;
149 };
150 
151 }
152 
153 #endif /* KDREPORTSTEXTELEMENT_H */
Definition: KDReportsTextElement.h:42
Definition: KDReportsAbstractTableElement.h:36
Definition: KDReportsElement.h:45

Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/

https://www.kdab.com/development-resources/qt-tools/kd-reports/