kword

KWTextDocument.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2001-2005 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 kwtextdocument_h
00021 #define kwtextdocument_h
00022 
00023 #include "KoRichText.h"
00024 #include <KoTextDocument.h>
00025 
00026 class KWFrame;
00027 class KWTextFrameSet;
00028 class KoTextFormatCollection;
00029 class KoTextDocCommand;
00030 
00035 class KWTextDocument : public KoTextDocument
00036 {
00037     Q_OBJECT
00038 public:
00040     KWTextDocument( KWTextFrameSet * textfs, KoTextFormatCollection *fc, KoTextFormatter *formatter = 0L );
00042     KWTextDocument( KoTextZoomHandler * zoomHandler );
00043 
00044     ~KWTextDocument();
00045 
00046     virtual KoTextParag * createParag( KoTextDocument *d, KoTextParag *pr = 0, KoTextParag *nx = 0, bool updateIds = TRUE );
00047 
00050     KWTextFrameSet * textFrameSet() const { return m_textfs; }
00051 
00052     virtual KoTextDocCommand *deleteTextCommand( KoTextDocument *textdoc, int id, int index, const QMemArray<KoTextStringChar> & str, const CustomItemsMap & customItemsMap, const QValueList<KoParagLayout> & oldParagLayouts );
00053 
00055     virtual bool loadSpanTag( const QDomElement& tag, KoOasisContext& context,
00056                               KoTextParag* parag, uint pos,
00057                               QString& textData, KoTextCustomItem* & customItem );
00059     virtual bool loadOasisBodyTag( const QDomElement& tag, KoOasisContext& context,
00060                                    KoTextParag* & lastParagraph, KoStyleCollection * styleColl,
00061                                    KoTextParag* nextParagraph );
00062 protected:
00063     void init();
00064 private:
00065     void appendBookmark( KoTextParag* parag, int pos, KoTextParag* endParag, int endPos, const QString& name );
00066     void loadOasisFootnote( const QDomElement& tag, KoOasisContext& context,
00067                             KoTextCustomItem* & customItem );
00068     void loadOasisTOC( const QDomElement& tag, KoOasisContext& context, KoTextParag* & lastParagraph, KoStyleCollection* styleColl, KoTextParag* nextParagraph );
00069 
00070     KWTextFrameSet * m_textfs;
00071 };
00072 
00073 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys