KReport

KReportDocument.h
1 /* This file is part of the KDE project
2  * Copyright (C) 2001-2007 by OpenMFG, LLC ([email protected])
3  * Copyright (C) 2007-2008 by Adam Pigg ([email protected])
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef KREPORTDOCUMENT_H
20 #define KREPORTDOCUMENT_H
21 
22 #include "config-kreport.h"
23 #include "KReportSectionData.h"
24 
25 #include <QPageLayout>
26 
27 class KReportDetailSectionData;
28 
29 #ifdef KREPORT_SCRIPTING
30 namespace Scripting
31 {
32 class Report;
33 }
34 #endif
35 
36 /*!
37  * @brief Top level report document definition.
38  * A KReportDocment defines the design of a document, and is composed of multiple
39  * sections.
40  */
41 class KREPORT_EXPORT KReportDocument : public QObject
42 {
43  Q_OBJECT
44 
45 public:
46  explicit KReportDocument(const QDomElement &elemSource, QObject *parent = nullptr);
47  explicit KReportDocument(QObject *parent = nullptr);
48  ~KReportDocument() override;
49 
50  bool isValid() const;
51 
52  /**
53  \return a list of all objects in the report
54  */
55  QList<KReportItemBase*> objects() const;
56 
57  /**
58  \return a report object given its name
59  */
60  KReportItemBase* object(const QString&) const;
61 
62  /**
63  \return all the sections, including groups and detail
64  */
65  QList<KReportSectionData*> sections() const;
66 
67  /**
68  \return a sectiondata given a section type
69  */
70  KReportSectionData* section(KReportSectionData::Type type) const;
71 
72  /**
73  \return a sectiondata given its name
74  */
75  KReportSectionData* section(const QString &name) const;
76 
77  QString query() const;
78 #ifdef KREPORT_SCRIPTING
79  QString script() const;
80 
81  QString interpreter() const;
82 #endif
83 
84  bool externalData() const;
85 
86  KReportDetailSectionData* detail() const;
87 
88  void setName(const QString&n);
89  QString name() const;
90 
91  QString title() const;
92 
93  QPageLayout pageLayout() const;
94 
95  QString pageSize();
96  void setPageSize(const QString &size);
97 
98 private:
99  friend class KReportPreRendererPrivate;
100  friend class KReportPreRenderer;
101 #ifdef KREPORT_SCRIPTING
102  friend class KReportScriptHandler;
103  friend class Scripting::Report;
104 #endif
105 
106  //! TODO add support for labels
107  QString labelType() const;
108  void setLabelType(const QString &label);
109 
110  class Private;
111  Private * const d;
112 };
113 
114 #endif
Base class for items that are drawn syncronously.
Takes a report definition and prerenders the result to an ORODocument that can be used to pass to any...
KReportSectionData is used to store the information about a specific report section.
Field item script interface.
Report object user scripting API.
Top level report document definition. A KReportDocment defines the design of a document,...
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sat Jun 25 2022 06:24:09 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.