kword

KWAnchor.h
1/* This file is part of the KDE project
2 Copyright (C) 2001 David Faure <faure@kde.org>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20#ifndef kwanchor_h
21#define kwanchor_h
22
23#include "KWTextDocument.h"
24class KCommand;
25class KWTextFrameSet;
26class KWFrame;
27class KWFrameSet;
28
34class KWAnchor : public KoTextCustomItem
35{
36public:
44 KWAnchor( KoTextDocument *textdoc, KWFrameSet * frameset, int frameNum );
45 ~KWAnchor();
46 bool ownLine() const;
47 virtual void setFormat( KoTextFormat* );
48
50 KWFrameSet * frameSet() const { return m_frameset; }
52 int frameNum() const { return m_frameNum; }
53
55 TQSize size() const;
56
57 /* overloaded methods, see lib/kotext/kotextcustomitem.h for docu*/
58 virtual void resize();
59 virtual void finalize();
60
61 /* overloaded methods, see korichtext.h for docu*/
62 virtual Placement placement() const { return PlaceInline; }
63 virtual int widthHint() const { return size().width(); }
64 virtual int minimumWidth() const { return size().width(); }
65 virtual int ascent() const;
66
67 virtual void draw( TQPainter* p, int x, int y, int cx, int cy, int cw, int ch, const TQColorGroup& cg, bool selected );
69 virtual void drawCustomItem(TQPainter*, int, int, int, int, int, int, int, int, int, const TQColorGroup&, bool, int, bool) { }
70
71 virtual KCommand * createCommand();
72 virtual KCommand * deleteCommand();
73 virtual void setDeleted( bool b );
74 virtual void save( TQDomElement &formatElem );
75 virtual void saveOasis( KoXmlWriter& writer, KoSavingContext& context ) const;
76
77 virtual int typeId() const { return 6; }
78
79private:
80 KWFrameSet * m_frameset; // the frameset that implements the content for this special char.
81 int m_frameNum; // the reference the frameset needs to identify the content in its
82 // set of frames
83};
84
85#endif
An anchor is a special character, or 'custom item'.
Definition KWAnchor.h:35
int frameNum() const
The index the frameset needs to access which content is displayed in the anchor object.
Definition KWAnchor.h:52
virtual void drawCustomItem(TQPainter *, int, int, int, int, int, int, int, int, int, const TQColorGroup &, bool, int, bool)
Never called since we reimplement draw.
Definition KWAnchor.h:69
TQSize size() const
Return the size of the item, i.e.
Definition KWAnchor.cpp:201
KWFrameSet * frameSet() const
The frameset that will provide the content to display in this anchor object.
Definition KWAnchor.h:50
Class: KWFrameSet Base type, a frameset holds content as well as frames to show that content.
Definition KWFrameSet.h:62
This class represents a single frame.
Definition KWFrame.h:68
Class: KWTextFrameSet Contains text (KoTextObject) and frames to display that text.