KReport

KReportPreRenderer.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 KREPORTPRERENDERER_H
20 #define KREPORTPRERENDERER_H
21 
22 #include "config-kreport.h"
23 #include "kreport_export.h"
24 
25 #include <QObject>
26 
27 #ifdef KREPORT_SCRIPTING
28 class KReportScriptHandler;
30 #else
31 #define KReportScriptHandler void
32 #endif
33 class KReportPreRendererPrivate;
34 class ORODocument;
35 class KReportDataSource;
36 class KReportDocument;
37 class QDomElement;
38 
39 /*!
40  * @brief Takes a report definition and prerenders the result to
41  * an ORODocument that can be used to pass to any number of renderers.
42  */
43 class KREPORT_EXPORT KReportPreRenderer : public QObject
44 {
45  Q_OBJECT
46 public:
47  explicit KReportPreRenderer(const QDomElement& document);
48 
49  ~KReportPreRenderer() override;
50 
51  //! Sets data source to @a data, takes ownership
52  void setDataSource(KReportDataSource* dataSource);
53 
54 #ifdef KREPORT_SCRIPTING
55  //!Sets the script source to @a source, does NOT take ownership as it may be an application window
56  void setScriptSource(KReportScriptSource* source);
57 
58  KReportScriptHandler *scriptHandler();
59  void registerScriptObject(QObject *obj, const QString &name);
60 #endif
61 
62  bool generateDocument();
63 
64  ORODocument *document();
65 
66  /**
67  @brief Set the name of the report so that it can be used internally by the script engine
68  */
69  void setName(const QString &);
70 
71  bool isValid() const;
72 
73  const KReportDocument *reportData() const;
74 
75 Q_SIGNALS:
76  void groupChanged(const QMap<QString, QVariant> &groupData);
77  void finishedAllASyncItems();
78 
79 private:
80  bool setDocument(const QDomElement &document);
81 
83  KReportPreRendererPrivate *const d;
84 };
85 
86 #endif // KREPORTPRERENDERER_H
Takes a report definition and prerenders the result to an ORODocument that can be used to pass to any...
Represents a single document containing one or more OROPage elements.
Abstraction of report data source.
Q_SIGNALSQ_SIGNALS
Abstraction of report script source.
Top level report document definition. A KReportDocment defines the design of a document,...
Q_DISABLE_COPY(Class)
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Wed Feb 8 2023 04:21:47 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.