kpresenter

KPrLineObject.h

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) 1998, 1999 Reginald Stadlbauer <reggie@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 #ifndef kplineobject_h
00023 #define kplineobject_h
00024 
00025 #include "KPrObject.h"
00026 #include <KoStyleStack.h>
00027 
00028 class QPainter;
00029 class DCOPObject;
00030 class KoXmlWriter;
00031 
00032 class KPrLineObject : public KPrShadowObject, public KPrStartEndLine
00033 {
00034 public:
00035     KPrLineObject();
00036     KPrLineObject( const KoPen &_pen, LineEnd _lineBegin,
00037                   LineEnd _lineEnd, LineType _lineType );
00038     virtual ~KPrLineObject()
00039         {}
00040 
00041     virtual DCOPObject* dcopObject();
00042 
00043     KPrLineObject &operator=( const KPrLineObject & );
00044 
00045     virtual void setLineBegin( LineEnd _lineBegin )
00046         { lineBegin = _lineBegin; }
00047     virtual void setLineEnd( LineEnd _lineEnd )
00048         { lineEnd = _lineEnd; }
00049     virtual void setLineType( LineType _lineType )
00050         { lineType = _lineType; }
00051 
00052     virtual ObjType getType() const
00053         { return OT_LINE; }
00054     virtual QString getTypeString() const
00055         { return i18n("Line"); }
00056     virtual LineEnd getLineBegin() const
00057         { return lineBegin; }
00058     virtual LineEnd getLineEnd() const
00059         { return lineEnd; }
00060     virtual LineType getLineType() const
00061         { return lineType; }
00062 
00063     virtual QDomDocumentFragment save( QDomDocument& doc, double offset );
00064     virtual double load(const QDomElement &element);
00065     virtual void loadOasis(const QDomElement &element, KoOasisContext & context, KPrLoadingInfo *info);
00066 
00067     virtual void flip(bool horizontal );
00068 
00069     virtual KoSize getRealSize() const;
00070     virtual KoPoint getRealOrig() const;
00071 
00072 protected:
00073     virtual const char * getOasisElementName() const;
00074     virtual bool saveOasisObjectAttributes( KPOasisSaveContext &sc ) const;
00075     virtual void saveOasisPosObject( KoXmlWriter &xmlWriter, int indexObj ) const;
00076 
00077     virtual void fillStyle( KoGenStyle& styleObjectAuto, KoGenStyles& mainStyles ) const;
00078 
00079     virtual void paint( QPainter *_painter, KoTextZoomHandler*_zoomHandler,
00080                         int /* pageNum */, bool drawingShadow, bool drawContour = FALSE );
00081     LineType lineType;
00082 };
00083 
00084 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys