kword

KWAnchor.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2001 David Faure <faure@kde.org>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License as published by the Free Software Foundation; either
00007    version 2 of the License, or (at your option) any later version.
00008 
00009    This library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this library; see the file COPYING.LIB.  If not, write to
00016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, USA.
00018 */
00019 
00020 #ifndef kwanchor_h
00021 #define kwanchor_h
00022 
00023 #include "KWTextDocument.h"
00024 class KCommand;
00025 class KWTextFrameSet;
00026 class KWFrame;
00027 class KWFrameSet;
00028 
00034 class KWAnchor : public KoTextCustomItem
00035 {
00036 public:
00044     KWAnchor( KoTextDocument *textdoc, KWFrameSet * frameset, int frameNum );
00045     ~KWAnchor();
00046     bool ownLine() const;
00047     virtual void setFormat( KoTextFormat* );
00048 
00050     KWFrameSet * frameSet() const { return m_frameset; }
00052     int frameNum() const { return m_frameNum; }
00053 
00055     QSize size() const;
00056 
00057     /* overloaded methods, see lib/kotext/kotextcustomitem.h for docu*/
00058     virtual void resize();
00059     virtual void finalize();
00060 
00061     /* overloaded methods, see korichtext.h for docu*/
00062     virtual Placement placement() const { return PlaceInline; }
00063     virtual int widthHint() const { return size().width(); }
00064     virtual int minimumWidth() const { return size().width(); }
00065     virtual int ascent() const;
00066 
00067     virtual void draw( QPainter* p, int x, int y, int cx, int cy, int cw, int ch, const QColorGroup& cg, bool selected );
00069     virtual void drawCustomItem(QPainter*, int, int, int, int, int, int, int, int, int, const QColorGroup&, bool, int, bool) { }
00070 
00071     virtual KCommand * createCommand();
00072     virtual KCommand * deleteCommand();
00073     virtual void setDeleted( bool b );
00074     virtual void save( QDomElement &formatElem );
00075     virtual void saveOasis( KoXmlWriter& writer, KoSavingContext& context ) const;
00076 
00077     virtual int typeId() const { return 6; }
00078 
00079 private:
00080     KWFrameSet * m_frameset; // the frameset that implements the content for this special char.
00081     int m_frameNum;          // the reference the frameset needs to identify the content in its
00082                              // set of frames
00083 };
00084 
00085 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys