kpresenter

KPrPolylineObject.cpp

00001 // -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
00002 /* This file is part of the KDE project
00003    Copyright (C) 2001 Toshitaka Fujioka <fujioka@kde.org>
00004    Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
00005 
00006    This library is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Library General Public
00008    License as published by the Free Software Foundation; either
00009    version 2 of the License, or (at your option) any later version.
00010 
00011    This library is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014    Library General Public License for more details.
00015 
00016    You should have received a copy of the GNU Library General Public License
00017    along with this library; see the file COPYING.LIB.  If not, write to
00018    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019  * Boston, MA 02110-1301, USA.
00020 */
00021 
00022 #include "KPrPolylineObject.h"
00023 #include "KPrUtils.h"
00024 #include "KPrPolyLineObjectIface.h"
00025 
00026 #include <qpainter.h>
00027 #include <qwmatrix.h>
00028 #include <qdom.h>
00029 
00030 #include <kdebug.h>
00031 #include <KoTextZoomHandler.h>
00032 #include <KoOasisContext.h>
00033 #include <KoUnit.h>
00034 
00035 #include <math.h>
00036 using namespace std;
00037 
00038 KPrPolylineObject::KPrPolylineObject()
00039     : KPrPointObject()
00040 {
00041 }
00042 
00043 DCOPObject* KPrPolylineObject::dcopObject()
00044 {
00045     if ( !dcop )
00046         dcop = new KPrPolyLineObjectIface( this );
00047     return dcop;
00048 }
00049 
00050 KPrPolylineObject::KPrPolylineObject(  const KoPointArray &_points, const KoSize &_size,
00051                                      const KoPen &_pen, LineEnd _lineBegin, LineEnd _lineEnd )
00052     : KPrPointObject( _pen, _lineBegin, _lineEnd )
00053 {
00054     points = KoPointArray( _points );
00055     ext = _size;
00056 }
00057 
00058 KPrPolylineObject &KPrPolylineObject::operator=( const KPrPolylineObject & )
00059 {
00060     return *this;
00061 }
00062 
00063 QDomDocumentFragment KPrPolylineObject::save( QDomDocument& doc, double offset )
00064 {
00065     return KPrPointObject::save( doc, offset );
00066 }
00067 
00068 double KPrPolylineObject::load(const QDomElement &element)
00069 {
00070     return KPrPointObject::load( element );
00071 }
00072 
00073 bool KPrPolylineObject::saveOasisObjectAttributes( KPOasisSaveContext &sc ) const
00074 {
00075     KPrShadowObject::saveOasisDrawPoints( points, sc );
00076     return true;
00077 }
00078 
00079 const char * KPrPolylineObject::getOasisElementName() const
00080 {
00081     return "draw:polyline";
00082 }
00083 
00084 
00085 void KPrPolylineObject::loadOasis(const QDomElement &element, KoOasisContext & context, KPrLoadingInfo *info)
00086 {
00087     kdDebug()<<"void KPrPolylineObject::loadOasis(const QDomElement &element)************\n";
00088     KPrShadowObject::loadOasis( element, context, info );
00089     KPrShadowObject::loadOasisDrawPoints( points, element, context, info );
00090     loadOasisMarker( context );
00091 }
KDE Home | KDE Accessibility Home | Description of Access Keys