void ReportEntityLabel::buildXML(QDomDocument & doc, QDomElement & parent) { kDebug(); //kdDebug() << "ReportEntityLabel::buildXML()"); QDomElement entity = doc.createElement("label"); // bounding rect buildXMLRect(doc, entity, pointRect()); // name QDomElement n = doc.createElement("name"); n.appendChild(doc.createTextNode(entityName())); entity.appendChild(n); // z QDomElement z = doc.createElement("zvalue"); z.appendChild(doc.createTextNode(QString::number(zValue()))); entity.appendChild(z); // font info //buildXMLFont ( doc,entity,font() ); //text style info buildXMLTextStyle(doc, entity, textStyle()); //Line Style buildXMLLineStyle(doc, entity, lineStyle()); // text alignment int align = textFlags(); // horizontal if ((align & Qt::AlignRight) == Qt::AlignRight) entity.appendChild(doc.createElement("right")); else if ((align & Qt::AlignHCenter) == Qt::AlignHCenter) entity.appendChild(doc.createElement("hcenter")); else // Qt::AlignLeft entity.appendChild(doc.createElement("left")); // vertical if ((align & Qt::AlignBottom) == Qt::AlignBottom) entity.appendChild(doc.createElement("bottom")); else if ((align & Qt::AlignVCenter) == Qt::AlignVCenter) entity.appendChild(doc.createElement("vcenter")); else // Qt::AlignTop entity.appendChild(doc.createElement("top")); // the text string QDomElement string = doc.createElement("string"); string.appendChild(doc.createTextNode(text())); entity.appendChild(string); parent.appendChild(entity); }
void KReportDesignerItemLine::buildXML(QDomDocument *doc, QDomElement *parent) { QDomElement entity = doc->createElement(QLatin1String("report:") + typeName()); // properties addPropertyAsAttribute(&entity, nameProperty()); entity.setAttribute(QLatin1String("report:z-index"), zValue()); KReportUtils::setAttribute(&entity, QLatin1String("svg:x1"), m_start->value().toPointF().x()); KReportUtils::setAttribute(&entity, QLatin1String("svg:y1"), m_start->value().toPointF().y()); KReportUtils::setAttribute(&entity, QLatin1String("svg:x2"), m_end->value().toPointF().x()); KReportUtils::setAttribute(&entity, QLatin1String("svg:y2"), m_end->value().toPointF().y()); buildXMLLineStyle(doc, &entity, lineStyle()); parent->appendChild(entity); }
void KoReportDesignerItemLine::buildXML(QDomDocument & doc, QDomElement & parent) { QDomElement entity = doc.createElement("report:line"); // properties addPropertyAsAttribute(&entity, m_name); entity.setAttribute("report:z-index", zValue()); KRUtils::setAttribute(entity, "svg:x1", m_start.toPoint().x()); KRUtils::setAttribute(entity, "svg:y1", m_start.toPoint().y()); KRUtils::setAttribute(entity, "svg:x2", m_end.toPoint().x()); KRUtils::setAttribute(entity, "svg:y2", m_end.toPoint().y()); buildXMLLineStyle(doc, entity, lineStyle()); parent.appendChild(entity); }
void KReportDesignerItemCheckBox::buildXML(QDomDocument *doc, QDomElement *parent) { //kreportpluginDebug(); QDomElement entity = doc->createElement(QLatin1String("report:") + typeName()); //properties addPropertyAsAttribute(&entity, m_name); addPropertyAsAttribute(&entity, m_controlSource); entity.setAttribute(QLatin1String("fo:foreground-color"), m_foregroundColor->value().toString()); addPropertyAsAttribute(&entity, m_checkStyle); addPropertyAsAttribute(&entity, m_staticValue); // bounding rect buildXMLRect(doc, &entity, &m_pos, &m_size); //Line Style buildXMLLineStyle(doc, &entity, lineStyle()); parent->appendChild(entity); }
void ReportEntityCheck::buildXML(QDomDocument & doc, QDomElement & parent) { kDebug() << endl; QDomElement entity = doc.createElement("check"); // bounding rect buildXMLRect(doc, entity, pointRect()); // name QDomElement n = doc.createElement("name"); n.appendChild(doc.createTextNode(entityName())); entity.appendChild(n); // z QDomElement z = doc.createElement("zvalue"); z.appendChild(doc.createTextNode(QString::number(zValue()))); entity.appendChild(z); //Line Style buildXMLLineStyle(doc, entity, lineStyle()); //Color QDomElement fc = doc.createElement("fgcolor"); fc.appendChild(doc.createTextNode(m_foregroundColor->value().value<QColor>().name())); entity.appendChild(fc); QDomElement cs = doc.createElement("controlsource"); cs.appendChild(doc.createTextNode(m_controlSource->value().toString())); entity.appendChild(cs); // the check style QDomElement sty = doc.createElement("checkstyle"); sty.appendChild(doc.createTextNode(m_checkStyle->value().toString())); entity.appendChild(sty); parent.appendChild(entity); }
void KoReportDesignerItemLabel::buildXML(QDomDocument & doc, QDomElement & parent) { //kDebug(); QDomElement entity = doc.createElement("report:label"); // properties addPropertyAsAttribute(&entity, m_name); addPropertyAsAttribute(&entity, m_text); addPropertyAsAttribute(&entity, m_verticalAlignment); addPropertyAsAttribute(&entity, m_horizontalAlignment); entity.setAttribute("report:z-index", zValue()); // bounding rect buildXMLRect(doc, entity, &m_pos, &m_size); //text style info buildXMLTextStyle(doc, entity, textStyle()); //Line Style buildXMLLineStyle(doc, entity, lineStyle()); parent.appendChild(entity); }
void KoReportDesignerItemText::buildXML(QDomDocument & doc, QDomElement & parent) { //kdDebug() << "ReportEntityText::buildXML()"); QDomElement entity = doc.createElement("report:text"); // properties addPropertyAsAttribute(&entity, m_name); addPropertyAsAttribute(&entity, m_controlSource); addPropertyAsAttribute(&entity, m_verticalAlignment); addPropertyAsAttribute(&entity, m_horizontalAlignment); entity.setAttribute("report:bottom-padding", m_bottomPadding); entity.setAttribute("report:z-index", zValue()); // bounding rect buildXMLRect(doc, entity, &m_pos, &m_size); //text style info buildXMLTextStyle(doc, entity, textStyle()); //Line Style buildXMLLineStyle(doc, entity, lineStyle()); parent.appendChild(entity); }