20#include "KPrFreehandObjectIface.h"
21#include "KPrFreehandObject.h"
23#include <KoTextZoomHandler.h>
32KPrFreehandObject::KPrFreehandObject()
37KPrFreehandObject::KPrFreehandObject(
const KoPointArray &_points,
const KoSize &_size,
38 const KoPen &_pen, LineEnd _lineBegin, LineEnd _lineEnd )
39 : KPrPointObject( _pen, _lineBegin, _lineEnd )
41 points = KoPointArray( _points );
45KPrFreehandObject &KPrFreehandObject::operator=(
const KPrFreehandObject & )
50DCOPObject* KPrFreehandObject::dcopObject()
53 dcop =
new KPrFreehandObjectIface(
this );
57bool KPrFreehandObject::saveOasisObjectAttributes( KPOasisSaveContext &sc )
const
60 KoRect rect( getRect() );
61 sc.xmlWriter.addAttribute(
"svg:viewBox", TQString(
"0 0 %1 %2" ).arg(
int( rect.width() * 100 ) )
62 .arg(
int( rect.height() * 100 ) ) );
63 unsigned int pointCount = points.count();
67 d += TQString(
"M%1 %2" ).arg(
int( points.at(pos).x() * 100 ) )
68 .arg(
int( points.at(pos).y() * 100 ) );
71 while ( pos < pointCount )
73 d += TQString(
"L%1 %2" ).arg(
int( points.at( pos ).x() * 100 ) )
74 .arg(
int( points.at( pos ).y() * 100 ) );
78 sc.xmlWriter.addAttribute(
"svg:d", d );
83const char * KPrFreehandObject::getOasisElementName()
const
88void KPrFreehandObject::loadOasis(
const TQDomElement &element, KoOasisContext & context,
KPrLoadingInfo* info )
90 kdDebug(33001) <<
"KPrFreehandObject::loadOasis" << endl;
91 KPrPointObject::loadOasis( element, context, info );
94 loadOasisMarker( context );
97TQDomDocumentFragment KPrFreehandObject::save( TQDomDocument& doc,
double offset )
99 return KPrPointObject::save( doc, offset );
102double KPrFreehandObject::load(
const TQDomElement &element )
104 return KPrPointObject::load( element );
Temporary information used only during loading.