kword

KWLoadingInfo.h
1/* This file is part of the KDE project
2 Copyright (C) 2004 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 KWLOADINGINFO_H
21#define KWLOADINGINFO_H
22
23#include <tqstring.h>
24#include <tqvaluelist.h>
25#include <tqdict.h>
26#include <KoPageLayout.h>
27
28class KoTextParag;
29class KWTextDocument;
30class KWFrame;
31
34{
35public:
38
41
43 struct BookMark
44 {
45 TQString bookname;
46 int paragStartIndex;
47 int paragEndIndex;
48 TQString frameSetName;
49 int cursorStartIndex;
50 int cursorEndIndex;
51 };
52
53 typedef TQValueList<BookMark> BookMarkList;
54 BookMarkList bookMarkList;
55
58 BookmarkStart() {} // for stupid TQValueList
59 BookmarkStart( KWTextDocument* _doc, KoTextParag* par, int ind )
60 : doc( _doc ), parag( par ), pos( ind ) {}
61 KWTextDocument* doc;
62 KoTextParag* parag;
63 int pos;
64 };
65 typedef TQMap<TQString, BookmarkStart> BookmarkStartsMap;
66 BookmarkStartsMap m_bookmarkStarts;
67
68 // Text frame chains; see KWTextFrameSet::loadOasisText
69
70 void storeNextFrame( KWFrame* thisFrame, const TQString& chainNextName ) {
71 m_nextFrameDict.insert( chainNextName, thisFrame );
72 }
73 KWFrame* chainPrevFrame( const TQString& frameName ) const {
74 return m_nextFrameDict[frameName]; // returns 0 if not found
75 }
76
77 void storeFrameName( KWFrame* frame, const TQString& name ) {
78 m_frameNameDict.insert( name, frame );
79 }
80 KWFrame* frameByName( const TQString& name ) const {
81 return m_frameNameDict[name]; // returns 0 if not found
82 }
83
84 KoColumns columns;
85 KoKWHeaderFooter hf;
86
87private:
88 // Ignore warnings about operator delete from those dicts; we don't use it here...
89 TQDict<KWFrame> m_nextFrameDict;
90 TQDict<KWFrame> m_frameNameDict;
91};
92
93#endif /* KWLOADINGINFO_H */
94
This class represents a single frame.
Definition KWFrame.h:68
Temporary information used only during loading.
TQString m_currentMasterPage
Current master-page name (OASIS loading)
This is our KoTextDocument reimplementation, to create KWTextParag instead of KoTextParags,...
Bookmarks (kword-1.3 XML: they need all framesets to be loaded first)
Bookmarks (OASIS XML). Only need to store bookmark starts, until hitting bookmark ends.