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 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); }