KD Reports 1.4
KDReportsHeader.h
00001 /****************************************************************************
00002 ** Copyright (C) 2007-2012 Klaralvdalens Datakonsult AB.  All rights reserved.
00003 **
00004 ** This file is part of the KD Reports library.
00005 **
00006 ** Licensees holding valid commercial KD Reports licenses may use this file in
00007 ** accordance with the KD Reports Commercial License Agreement provided with
00008 ** the Software.
00009 **
00010 **
00011 ** This file may be distributed and/or modified under the terms of the
00012 ** GNU General Public License version 2 and version 3 as published by the
00013 ** Free Software Foundation and appearing in the file LICENSE.GPL included.
00014 **
00015 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00016 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00017 **
00018 ** Contact info@kdab.com if any conditions of this licensing are not
00019 ** clear to you.
00020 **
00021 **********************************************************************/
00022 
00023 #ifndef KDREPORTSHEADER_H
00024 #define KDREPORTSHEADER_H
00025 
00026 #include "KDReportsGlobal.h"
00027 #include "KDReportsVariableType.h"
00028 #include <QtCore/Qt>
00029 #include <QtGui/QTextOption>
00030 
00031 template<class T> class QList;
00032 class QFont;
00033 class QTextDocument;
00034 class HeaderData;
00035 
00036 namespace KDReports {
00037 
00038 class XmlParser;
00039 class Element;
00040 class HeaderMap;
00041 class Report;
00042 class ReportPrivate;
00043 class TextDocument;
00044 
00051 class KDREPORTS_EXPORT Header
00052 {
00053 public:
00058     void setDefaultFont( const QFont& font );
00059 
00064     QFont defaultFont() const;
00065 
00069     void addInlineElement( const Element& element );
00070 
00075     void addElement( const Element& element, Qt::AlignmentFlag horizontalAlignment = Qt::AlignLeft );
00076 
00088     void addVariable( VariableType variable );
00089 
00095     void addVerticalSpacing( qreal space );
00096 
00105     void setTabPositions( const QList<QTextOption::Tab>& tabs );
00106     
00110     int currentPosition() const;
00111 
00112 private:
00113     friend class XmlParser;
00114     friend class Report;
00115     friend class ReportPrivate;
00116     Header( Report* report );
00117     ~Header();
00118     friend class Test;
00119     friend class HeaderMap;
00120     friend class ::HeaderData;
00121     TextDocument& doc();
00122     void preparePaintingPage( int pageNumber );
00123 
00124     Q_DISABLE_COPY( Header )
00125 
00126     class Private;
00127     Private* const d;
00128 };
00129 
00130 typedef Header Footer;
00131 
00132 }
00133 
00134 #endif /* KDREPORTSHEADER_H */
 All Classes Namespaces Functions Enumerations Enumerator

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