KReport
20 #include "KoOdtFrameReportPrimitive.h"
21 #include "KReportRenderObjects.h"
23 #include <KoXmlWriter.h>
24 #include <KReportDpi.h>
25 #include <KoGenStyle.h>
26 #include <KoGenStyles.h>
28 KoOdtFrameReportPrimitive::KoOdtFrameReportPrimitive(
OROPrimitive *primitive)
29 : m_primitive(primitive)
34 KoOdtFrameReportPrimitive::~KoOdtFrameReportPrimitive()
38 bool KoOdtFrameReportPrimitive::isValid()
const
40 return (
bool)m_primitive;
43 void KoOdtFrameReportPrimitive::setPrimitive(
OROPrimitive *primitive)
45 m_primitive = primitive;
48 int KoOdtFrameReportPrimitive::pageNumber()
const
50 return isValid() && m_primitive->page() ? m_primitive->page()->pageNumber() + 1 : 0;
53 void KoOdtFrameReportPrimitive::setUID(
int uid)
58 int KoOdtFrameReportPrimitive::uid()
const
63 QString KoOdtFrameReportPrimitive::itemName()
const
68 void KoOdtFrameReportPrimitive::createStyle(KoGenStyles *coll)
70 KoGenStyle gs(KoGenStyle::GraphicStyle,
"graphic");
71 gs.addProperty(
"draw:fill",
"none");
72 gs.addPropertyPt(
"fo:margin", 0);
73 gs.addProperty(
"style:horizontal-pos",
"from-left");
74 gs.addProperty(
"style:horizontal-rel",
"page");
75 gs.addProperty(
"style:vertical-pos",
"from-top");
76 gs.addProperty(
"style:vertical-rel",
"page");
77 gs.addProperty(
"style:wrap",
"dynamic");
78 gs.addPropertyPt(
"style:wrap-dynamic-threshold", 0);
80 m_frameStyleName = coll->insert(gs,
"F");
83 void KoOdtFrameReportPrimitive::createBody(KoXmlWriter *bodyWriter)
const
88 void KoOdtFrameReportPrimitive::commonAttributes(KoXmlWriter *bodyWriter)
const
91 qreal x = m_primitive->position().x() / KReportPrivate::dpiX();
92 qreal y = m_primitive->position().y() / KReportPrivate::dpiX();
93 qreal w = m_primitive->size().width() / KReportPrivate::dpiX();
94 qreal h = m_primitive->size().height() / KReportPrivate::dpiY();
96 bodyWriter->addAttribute(
"svg:x",
QString(
"%1in").arg(x));
97 bodyWriter->addAttribute(
"svg:y",
QString(
"%1in").arg(y));
98 bodyWriter->addAttribute(
"svg:width",
QString(
"%1in").arg(w));
99 bodyWriter->addAttribute(
"svg:height",
QString(
"%1in").arg(h));
100 bodyWriter->addAttribute(
"draw:z-index",
"3");
103 bool KoOdtFrameReportPrimitive::saveData(KoStore *, KoXmlWriter*)
const
QString arg(qlonglong a, int fieldWidth, int base, QChar fillChar) const const
bool isValid(QStringView ifopt)
Represents the basic primitive with a position and type. Other primitives are subclasses with a defin...
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Feb 7 2023 04:17:37 by
doxygen 1.8.17 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.