KD Reports  1.7
KDReportsTextElement.h
1 /****************************************************************************
2 ** Copyright (C) 2007-2015 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 class QColor;
31 class QFont;
32 
33 namespace KDReports {
34 class TextElementPrivate;
35 
40 class KDREPORTS_EXPORT TextElement : public Element
41 {
42 public:
46  explicit TextElement( const QString& string = QString() );
50  virtual ~TextElement();
51 
56  TextElement(const TextElement &other);
60  TextElement &operator=(const TextElement &other);
61 
65  void setText( const QString& text );
66 
70  TextElement& operator<<( const QString& );
71 
73  void setFontFamily( const QString& family );
75  void setBold( bool bold );
77  void setItalic( bool italic );
79  void setUnderline( bool underline );
81  void setStrikeOut( bool strikeout );
83  void setPointSize( qreal size );
84 
92  void setFont( const QFont& );
93 
98  QFont font() const;
99 
104  void setTextColor( const QColor& color );
105 
110  QColor textColor() const;
111 
116  void setId( const QString& id );
117 
122  QString id() const;
123 
128  QString text() const;
129 
134  void build( ReportBuilder& builder ) const;
139  Element* clone() const;
140 
141 private:
142 
143  friend class ReportBuilder;
144  void setCharFormat( const QTextCharFormat& format );
145 
146  TextElementPrivate* const d;
147 };
148 
149 }
150 
151 #endif /* KDREPORTSTEXTELEMENT_H */
Definition: KDReportsTextElement.h:40
Definition: KDReportsAbstractTableElement.h:33
Definition: KDReportsElement.h:42

Klarälvdalens Datakonsult AB (KDAB)
Qt-related services and products
http://www.kdab.com/
http://www.kdab.com/products/kd-reports/