kword

KWTextDocument.h
1/* This file is part of the KDE project
2 Copyright (C) 2001-2005 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 kwtextdocument_h
21#define kwtextdocument_h
22
23#include "KoRichText.h"
24#include <KoTextDocument.h>
25
26class KWFrame;
27class KWTextFrameSet;
28class KoTextFormatCollection;
29class KoTextDocCommand;
30
35class KWTextDocument : public KoTextDocument
36{
37 TQ_OBJECT
38
39public:
41 KWTextDocument( KWTextFrameSet * textfs, KoTextFormatCollection *fc, KoTextFormatter *formatter = 0L );
43 KWTextDocument( KoTextZoomHandler * zoomHandler );
44
46
47 virtual KoTextParag * createParag( KoTextDocument *d, KoTextParag *pr = 0, KoTextParag *nx = 0, bool updateIds = true );
48
51 KWTextFrameSet * textFrameSet() const { return m_textfs; }
52
53 virtual KoTextDocCommand *deleteTextCommand( KoTextDocument *textdoc, int id, int index, const TQMemArray<KoTextStringChar> & str, const CustomItemsMap & customItemsMap, const TQValueList<KoParagLayout> & oldParagLayouts );
54
56 virtual bool loadSpanTag( const TQDomElement& tag, KoOasisContext& context,
57 KoTextParag* parag, uint pos,
58 TQString& textData, KoTextCustomItem* & customItem );
60 virtual bool loadOasisBodyTag( const TQDomElement& tag, KoOasisContext& context,
61 KoTextParag* & lastParagraph, KoStyleCollection * styleColl,
62 KoTextParag* nextParagraph );
63protected:
64 void init();
65private:
66 void appendBookmark( KoTextParag* parag, int pos, KoTextParag* endParag, int endPos, const TQString& name );
67 void loadOasisFootnote( const TQDomElement& tag, KoOasisContext& context,
68 KoTextCustomItem* & customItem );
69 void loadOasisTOC( const TQDomElement& tag, KoOasisContext& context, KoTextParag* & lastParagraph, KoStyleCollection* styleColl, KoTextParag* nextParagraph );
70
71 KWTextFrameSet * m_textfs;
72};
73
74#endif
This class represents a single frame.
Definition KWFrame.h:68
This is our KoTextDocument reimplementation, to create KWTextParag instead of KoTextParags,...
virtual bool loadOasisBodyTag(const TQDomElement &tag, KoOasisContext &context, KoTextParag *&lastParagraph, KoStyleCollection *styleColl, KoTextParag *nextParagraph)
Extensions to KoTextDocument::loadOasisText.
virtual bool loadSpanTag(const TQDomElement &tag, KoOasisContext &context, KoTextParag *parag, uint pos, TQString &textData, KoTextCustomItem *&customItem)
Extensions to KoTextParag::loadOasisSpan.
KWTextFrameSet * textFrameSet() const
Return the text frameset in which this document is.
Class: KWTextFrameSet Contains text (KoTextObject) and frames to display that text.