kpresenter

KPrPolylineObject.cpp
1/* This file is part of the KDE project
2 Copyright (C) 2001 Toshitaka Fujioka <fujioka@kde.org>
3 Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19*/
20
21#include "KPrPolylineObject.h"
22#include "KPrUtils.h"
23#include "KPrPolyLineObjectIface.h"
24
25#include <tqpainter.h>
26#include <tqwmatrix.h>
27#include <tqdom.h>
28
29#include <kdebug.h>
30#include <KoTextZoomHandler.h>
31#include <KoOasisContext.h>
32#include <KoUnit.h>
33
34#include <math.h>
35using namespace std;
36
37KPrPolylineObject::KPrPolylineObject()
38 : KPrPointObject()
39{
40}
41
42DCOPObject* KPrPolylineObject::dcopObject()
43{
44 if ( !dcop )
45 dcop = new KPrPolyLineObjectIface( this );
46 return dcop;
47}
48
49KPrPolylineObject::KPrPolylineObject( const KoPointArray &_points, const KoSize &_size,
50 const KoPen &_pen, LineEnd _lineBegin, LineEnd _lineEnd )
51 : KPrPointObject( _pen, _lineBegin, _lineEnd )
52{
53 points = KoPointArray( _points );
54 ext = _size;
55}
56
57KPrPolylineObject &KPrPolylineObject::operator=( const KPrPolylineObject & )
58{
59 return *this;
60}
61
62TQDomDocumentFragment KPrPolylineObject::save( TQDomDocument& doc, double offset )
63{
64 return KPrPointObject::save( doc, offset );
65}
66
67double KPrPolylineObject::load(const TQDomElement &element)
68{
69 return KPrPointObject::load( element );
70}
71
72bool KPrPolylineObject::saveOasisObjectAttributes( KPOasisSaveContext &sc ) const
73{
75 return true;
76}
77
78const char * KPrPolylineObject::getOasisElementName() const
79{
80 return "draw:polyline";
81}
82
83
84void KPrPolylineObject::loadOasis(const TQDomElement &element, KoOasisContext & context, KPrLoadingInfo *info)
85{
86 kdDebug()<<"void KPrPolylineObject::loadOasis(const TQDomElement &element)************\n";
87 KPrShadowObject::loadOasis( element, context, info );
88 KPrShadowObject::loadOasisDrawPoints( points, element, context, info );
89 loadOasisMarker( context );
90}
Temporary information used only during loading.
bool loadOasisDrawPoints(KoPointArray &points, const TQDomElement &element, KoOasisContext &context, KPrLoadingInfo *info)
Helper method for loading draw:points.
static bool saveOasisDrawPoints(const KoPointArray &points, KPOasisSaveContext &sc)
Helper method for saving draw:points.