kword
KWLoadingInfo.h
00001 /* This file is part of the KDE project 00002 Copyright (C) 2004 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 KWLOADINGINFO_H 00021 #define KWLOADINGINFO_H 00022 00023 #include <qstring.h> 00024 #include <qvaluelist.h> 00025 #include <qdict.h> 00026 #include <KoPageLayout.h> 00027 00028 class KoTextParag; 00029 class KWTextDocument; 00030 class KWFrame; 00031 00033 class KWLoadingInfo 00034 { 00035 public: 00036 KWLoadingInfo(); 00037 ~KWLoadingInfo() {} 00038 00040 QString m_currentMasterPage; 00041 00043 struct BookMark 00044 { 00045 QString bookname; 00046 int paragStartIndex; 00047 int paragEndIndex; 00048 QString frameSetName; 00049 int cursorStartIndex; 00050 int cursorEndIndex; 00051 }; 00052 00053 typedef QValueList<BookMark> BookMarkList; 00054 BookMarkList bookMarkList; 00055 00057 struct BookmarkStart { 00058 BookmarkStart() {} // for stupid QValueList 00059 BookmarkStart( KWTextDocument* _doc, KoTextParag* par, int ind ) 00060 : doc( _doc ), parag( par ), pos( ind ) {} 00061 KWTextDocument* doc; 00062 KoTextParag* parag; 00063 int pos; 00064 }; 00065 typedef QMap<QString, BookmarkStart> BookmarkStartsMap; 00066 BookmarkStartsMap m_bookmarkStarts; 00067 00068 // Text frame chains; see KWTextFrameSet::loadOasisText 00069 00070 void storeNextFrame( KWFrame* thisFrame, const QString& chainNextName ) { 00071 m_nextFrameDict.insert( chainNextName, thisFrame ); 00072 } 00073 KWFrame* chainPrevFrame( const QString& frameName ) const { 00074 return m_nextFrameDict[frameName]; // returns 0 if not found 00075 } 00076 00077 void storeFrameName( KWFrame* frame, const QString& name ) { 00078 m_frameNameDict.insert( name, frame ); 00079 } 00080 KWFrame* frameByName( const QString& name ) const { 00081 return m_frameNameDict[name]; // returns 0 if not found 00082 } 00083 00084 KoColumns columns; 00085 KoKWHeaderFooter hf; 00086 00087 private: 00088 // Ignore warnings about operator delete from those dicts; we don't use it here... 00089 QDict<KWFrame> m_nextFrameDict; 00090 QDict<KWFrame> m_frameNameDict; 00091 }; 00092 00093 #endif /* KWLOADINGINFO_H */ 00094