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 | }; | ||||
36 | | ||||
37 | KReportDesignerItemBase::Private::Private() | ||||
38 | { | ||||
39 | } | ||||
40 | | ||||
41 | KReportDesignerItemBase::Private::~Private() | ||||
42 | { | ||||
43 | } | ||||
44 | | ||||
30 | KReportDesignerItemBase::~KReportDesignerItemBase() | 45 | KReportDesignerItemBase::~KReportDesignerItemBase() | ||
31 | { | 46 | { | ||
32 | } | 47 | } | ||
33 | 48 | | |||
34 | KReportDesignerItemBase::KReportDesignerItemBase(KReportDesigner* r) | 49 | KReportDesignerItemBase::KReportDesignerItemBase(KReportDesigner *r, KReportItemBase *b) : d(new Private()) | ||
35 | { | 50 | { | ||
36 | m_reportDesigner = r; | 51 | d->reportDesigner = r; | ||
52 | d->item = b; | ||||
37 | } | 53 | } | ||
38 | 54 | | |||
39 | void KReportDesignerItemBase::buildXML(QGraphicsItem * item, QDomDocument *doc, QDomElement *parent) | 55 | void KReportDesignerItemBase::buildXML(QGraphicsItem * item, QDomDocument *doc, QDomElement *parent) | ||
40 | { | 56 | { | ||
41 | KReportDesignerItemBase *re = 0; | 57 | KReportDesignerItemBase *re = 0; | ||
42 | re = dynamic_cast<KReportDesignerItemBase*>(item); | 58 | re = dynamic_cast<KReportDesignerItemBase*>(item); | ||
43 | 59 | | |||
44 | if (re) { | 60 | if (re) { | ||
45 | re->buildXML(doc, parent); | 61 | re->buildXML(doc, parent); | ||
46 | } | 62 | } | ||
47 | 63 | | |||
48 | } | 64 | } | ||
49 | 65 | | |||
50 | void KReportDesignerItemBase::buildXMLRect(QDomDocument *doc, QDomElement *entity, KReportPosition *pos, KReportSize *size) | 66 | void KReportDesignerItemBase::buildXMLRect(QDomDocument *doc, QDomElement *entity, KReportItemBase *i) | ||
51 | { | 67 | { | ||
52 | Q_UNUSED(doc); | 68 | Q_UNUSED(doc); | ||
53 | KReportUtils::buildXMLRect(entity, pos, size); | 69 | KReportUtils::buildXMLRect(entity, i->position(), i->size()); | ||
54 | } | 70 | } | ||
55 | 71 | | |||
56 | void KReportDesignerItemBase::buildXMLTextStyle(QDomDocument *doc, QDomElement *entity, const KRTextStyleData &ts) | 72 | void KReportDesignerItemBase::buildXMLTextStyle(QDomDocument *doc, QDomElement *entity, const KRTextStyleData &ts) | ||
57 | { | 73 | { | ||
58 | KReportUtils::buildXMLTextStyle(doc, entity, ts); | 74 | KReportUtils::buildXMLTextStyle(doc, entity, ts); | ||
59 | } | 75 | } | ||
60 | 76 | | |||
61 | void KReportDesignerItemBase::buildXMLLineStyle(QDomDocument *doc, QDomElement *entity, const KReportLineStyle &ls) | 77 | void KReportDesignerItemBase::buildXMLLineStyle(QDomDocument *doc, QDomElement *entity, const KReportLineStyle &ls) | ||
62 | { | 78 | { | ||
63 | KReportUtils::buildXMLLineStyle(doc, entity, ls); | 79 | KReportUtils::buildXMLLineStyle(doc, entity, ls); | ||
64 | } | 80 | } | ||
65 | 81 | | |||
66 | QString KReportDesignerItemBase::dataSourceAndObjectTypeName(const QString& dataSource, const QString& objectTypeName) const | 82 | QString KReportDesignerItemBase::dataSourceAndObjectTypeName(const QString& dataSource, const QString& objectTypeName) const | ||
67 | { | 83 | { | ||
68 | return QString::fromLatin1("%1: %2").arg(dataSource).arg(objectTypeName); | 84 | return QString::fromLatin1("%1: %2").arg(dataSource).arg(objectTypeName); | ||
69 | } | 85 | } | ||
70 | 86 | | |||
71 | // static | 87 | // static | ||
72 | void KReportDesignerItemBase::addPropertyAsAttribute(QDomElement* e, KProperty* p) | 88 | void KReportDesignerItemBase::addPropertyAsAttribute(QDomElement* e, KProperty* p) | ||
73 | { | 89 | { | ||
74 | KReportUtils::addPropertyAsAttribute(e, p); | 90 | KReportUtils::addPropertyAsAttribute(e, p); | ||
75 | } | 91 | } | ||
92 | | ||||
93 | KReportDesigner * KReportDesignerItemBase::designer() const | ||||
94 | { | ||||
95 | return d->reportDesigner; | ||||
96 | } | ||||
97 | | ||||
98 | void KReportDesignerItemBase::setDesigner(KReportDesigner* rd) | ||||
99 | { | ||||
100 | d->reportDesigner = rd; | ||||
101 | } | ||||
102 | | ||||
103 | KReportItemBase *KReportDesignerItemBase::item() const | ||||
104 | { | ||||
105 | return d->item; | ||||
106 | } |