KReport

KReportDesignerItemBase.h
1/* This file is part of the KDE project
2 * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com)
3 * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
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/*
20 * This file contains all the Report Entity classes. Each one is a
21 * derivative of ReportEntity, which in turn is derived from QCanvasItem.
22 */
23
24#ifndef KREPORTDESIGNERITEMBASE_H
25#define KREPORTDESIGNERITEMBASE_H
26
27#include <QGraphicsItem>
28
29#include "KReportItemBase.h"
30
31class QDomDocument;
32class QDomElement;
33
34class KReportDesigner;
35
36/*!
37 * @brief Base class for report items used within the designer GUI.
38*/
39class KREPORT_EXPORT KReportDesignerItemBase
40{
41public:
43
44 static void buildXML(QGraphicsItem * item, QDomDocument *doc, QDomElement *parent);
45 virtual void buildXML(QDomDocument *doc, QDomElement *parent) = 0;
46
47 static void buildXMLRect(QDomDocument *doc, QDomElement *entity, KReportItemBase *i);
48 static void buildXMLTextStyle(QDomDocument *doc, QDomElement *entity, const KReportTextStyleData &ts);
49 static void buildXMLLineStyle(QDomDocument *doc, QDomElement *entity, const KReportLineStyle &ls);
50
51 virtual KReportDesignerItemBase* clone() = 0;
52 virtual void move(const QPointF&) = 0;
53
54 KReportDesigner* designer() const;
55 void setDesigner(KReportDesigner* rd);
56
57 static void addPropertyAsAttribute(QDomElement* e, KProperty* p);
58
59protected:
61 QString dataSourceAndObjectTypeName(const QString &dataSource,
62 const QString &objectTypeName) const;
63
64 /**
65 * @brief Updates the text that is shown for the item in the report designer
66 * If itemDataSource is set then it is preferred over itemStaticValue
67 * itemType is appended to the end of the text
68 *
69 * @param itemDataSource source field property
70 * @param itemStaticValue value property
71 * @param itemType type of item
72 * @return void
73 */
74 void updateRenderText(const QString &itemDataSource, const QString &itemStaticValue, const QString &itemType);
75 KReportItemBase *item() const;
76
77 void setRenderText(const QString &text);
78 QString renderText() const;
79
80private:
81 Q_DISABLE_COPY(KReportDesignerItemBase)
82 class Private;
83 Private * const d;
84};
85
86#endif
87
Base class for report items used within the designer GUI.
The ReportDesigner is the main widget for designing a report.
Base class for items that are drawn syncronously.
The KReportLineStyle class represents line style.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:06:04 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.