KDReportsHeader.h

00001 /****************************************************************************
00002 ** Copyright (C) 2007-2011 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 
00035 namespace KDReports {
00036 
00037 class XmlParser;
00038 class Element;
00039 class HeaderMap;
00040 class Report;
00041 class ReportPrivate;
00042 class TextDocument;
00043 
00050 class KDREPORTS_EXPORT Header
00051 {
00052 public:
00057     void setDefaultFont( const QFont& font );
00058 
00062     void addInlineElement( const Element& element );
00063 
00068     void addElement( const Element& element, Qt::AlignmentFlag horizontalAlignment = Qt::AlignLeft );
00069 
00081     void addVariable( VariableType variable );
00082 
00088     void addVerticalSpacing( qreal space );
00089 
00098     void setTabPositions( const QList<QTextOption::Tab>& tabs );
00099     
00100 private:
00101     friend class XmlParser;
00102     friend class Report;
00103     friend class ReportPrivate;
00104     Header( Report* report );
00105     ~Header();
00106     friend class Test;
00107     friend class HeaderMap;
00108     TextDocument& doc();
00109     void preparePaintingPage( int pageNumber );
00110 
00111     Q_DISABLE_COPY( Header )
00112 
00113     class Private;
00114     Private* const d;
00115 };
00116 
00117 typedef Header Footer;
00118 
00119 }
00120 
00121 #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/