Changeset View
Changeset View
Standalone View
Standalone View
src/wrtembed/KReportDesignerItemBase.cpp
Show All 18 Lines | |||||
19 | #include "KReportDesignerItemBase.h" | 19 | #include "KReportDesignerItemBase.h" | ||
20 | #include "KReportItemBase.h" | 20 | #include "KReportItemBase.h" | ||
21 | #include "KReportUtils.h" | 21 | #include "KReportUtils.h" | ||
22 | 22 | | |||
23 | #include <QString> | 23 | #include <QString> | ||
24 | #include <QDomDocument> | 24 | #include <QDomDocument> | ||
25 | #include <QCheckBox> | 25 | #include <QCheckBox> | ||
26 | 26 | | |||
27 | // | 27 | class Q_DECL_HIDDEN KReportDesignerItemBase::Private | ||
28 | // ReportEntity | 28 | { | ||
29 | // | 29 | public: | ||
30 | Private(); | ||||
31 | ~Private(); | ||||
32 | | ||||
33 | KReportDesigner *reportDesigner; | ||||
34 | KReportItemBase *item; | ||||
35 | QString renderText; | ||||
36 | }; | ||||
37 | | ||||
38 | KReportDesignerItemBase::Private::Private() | ||||
39 | { | ||||
40 | } | ||||
41 | | ||||
42 | KReportDesignerItemBase::Private::~Private() | ||||
43 | { | ||||
44 | } | ||||
45 | | ||||
30 | KReportDesignerItemBase::~KReportDesignerItemBase() | 46 | KReportDesignerItemBase::~KReportDesignerItemBase() | ||
31 | { | 47 | { | ||
48 | delete d; | ||||
32 | } | 49 | } | ||
33 | 50 | | |||
34 | KReportDesignerItemBase::KReportDesignerItemBase(KReportDesigner* r) | 51 | KReportDesignerItemBase::KReportDesignerItemBase(KReportDesigner *r, KReportItemBase *b) : d(new Private()) | ||
35 | { | 52 | { | ||
36 | m_reportDesigner = r; | 53 | d->reportDesigner = r; | ||
54 | d->item = b; | ||||
37 | } | 55 | } | ||
38 | 56 | | |||
39 | void KReportDesignerItemBase::buildXML(QGraphicsItem * item, QDomDocument *doc, QDomElement *parent) | 57 | void KReportDesignerItemBase::buildXML(QGraphicsItem * item, QDomDocument *doc, QDomElement *parent) | ||
40 | { | 58 | { | ||
41 | KReportDesignerItemBase *re = 0; | 59 | KReportDesignerItemBase *re = 0; | ||
42 | re = dynamic_cast<KReportDesignerItemBase*>(item); | 60 | re = dynamic_cast<KReportDesignerItemBase*>(item); | ||
43 | 61 | | |||
44 | if (re) { | 62 | if (re) { | ||
45 | re->buildXML(doc, parent); | 63 | re->buildXML(doc, parent); | ||
46 | } | 64 | } | ||
47 | 65 | | |||
48 | } | 66 | } | ||
49 | 67 | | |||
50 | void KReportDesignerItemBase::buildXMLRect(QDomDocument *doc, QDomElement *entity, KReportPosition *pos, KReportSize *size) | 68 | void KReportDesignerItemBase::buildXMLRect(QDomDocument *doc, QDomElement *entity, KReportItemBase *i) | ||
51 | { | 69 | { | ||
52 | Q_UNUSED(doc); | 70 | Q_UNUSED(doc); | ||
53 | KReportUtils::buildXMLRect(entity, pos, size); | 71 | KReportUtils::buildXMLRect(entity, i->position(), i->size()); | ||
54 | } | 72 | } | ||
55 | 73 | | |||
56 | void KReportDesignerItemBase::buildXMLTextStyle(QDomDocument *doc, QDomElement *entity, const KRTextStyleData &ts) | 74 | void KReportDesignerItemBase::buildXMLTextStyle(QDomDocument *doc, QDomElement *entity, const KRTextStyleData &ts) | ||
57 | { | 75 | { | ||
58 | KReportUtils::buildXMLTextStyle(doc, entity, ts); | 76 | KReportUtils::buildXMLTextStyle(doc, entity, ts); | ||
59 | } | 77 | } | ||
60 | 78 | | |||
61 | void KReportDesignerItemBase::buildXMLLineStyle(QDomDocument *doc, QDomElement *entity, const KReportLineStyle &ls) | 79 | void KReportDesignerItemBase::buildXMLLineStyle(QDomDocument *doc, QDomElement *entity, const KReportLineStyle &ls) | ||
62 | { | 80 | { | ||
63 | KReportUtils::buildXMLLineStyle(doc, entity, ls); | 81 | KReportUtils::buildXMLLineStyle(doc, entity, ls); | ||
64 | } | 82 | } | ||
65 | 83 | | |||
66 | QString KReportDesignerItemBase::dataSourceAndObjectTypeName(const QString& dataSource, const QString& objectTypeName) const | 84 | QString KReportDesignerItemBase::dataSourceAndObjectTypeName(const QString& dataSource, const QString& objectTypeName) const | ||
67 | { | 85 | { | ||
68 | return QString::fromLatin1("%1: %2").arg(dataSource).arg(objectTypeName); | 86 | return QString::fromLatin1("%1: %2").arg(dataSource).arg(objectTypeName); | ||
69 | } | 87 | } | ||
70 | 88 | | |||
71 | // static | 89 | // static | ||
72 | void KReportDesignerItemBase::addPropertyAsAttribute(QDomElement* e, KProperty* p) | 90 | void KReportDesignerItemBase::addPropertyAsAttribute(QDomElement* e, KProperty* p) | ||
73 | { | 91 | { | ||
74 | KReportUtils::addPropertyAsAttribute(e, p); | 92 | KReportUtils::addPropertyAsAttribute(e, p); | ||
75 | } | 93 | } | ||
94 | | ||||
95 | KReportDesigner * KReportDesignerItemBase::designer() const | ||||
96 | { | ||||
97 | return d->reportDesigner; | ||||
98 | } | ||||
99 | | ||||
100 | void KReportDesignerItemBase::setDesigner(KReportDesigner* rd) | ||||
101 | { | ||||
102 | d->reportDesigner = rd; | ||||
103 | } | ||||
104 | | ||||
105 | KReportItemBase *KReportDesignerItemBase::item() const | ||||
106 | { | ||||
107 | return d->item; | ||||
108 | } | ||||
109 | | ||||
110 | QString KReportDesignerItemBase::renderText() const | ||||
111 | { | ||||
112 | return d->renderText; | ||||
113 | } | ||||
114 | | ||||
115 | void KReportDesignerItemBase::setRenderText(const QString& text) | ||||
116 | { | ||||
117 | d->renderText = text; | ||||
118 | } |