lib

KoOasisLoadingContext.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 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 version 2 as published by the Free Software Foundation.
00007 
00008    This library is distributed in the hope that it will be useful,
00009    but WITHOUT ANY WARRANTY; without even the implied warranty of
00010    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011    Library General Public License for more details.
00012 
00013    You should have received a copy of the GNU Library General Public License
00014    along with this library; see the file COPYING.LIB.  If not, write to
00015    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00016    Boston, MA 02110-1301, USA.
00017 */
00018 
00019 #ifndef KOOASISLOADINGCONTEXT_H
00020 #define KOOASISLOADINGCONTEXT_H
00021 
00022 class KoXmlWriter;
00023 class QDomElement;
00024 class KoDocument;
00025 class KoOasisStyles;
00026 class KoPictureCollection;
00027 class KoStore;
00028 
00029 #include <qmap.h>
00030 #include <koffice_export.h>
00031 #include <qstringlist.h>
00032 #include <KoStyleStack.h>
00033 
00039 class KOFFICECORE_EXPORT KoOasisLoadingContext
00040 {
00041 public:
00051     KoOasisLoadingContext( KoDocument* doc, KoOasisStyles& styles, KoStore* store );
00052     ~KoOasisLoadingContext();
00053 
00054     KoDocument* koDocument() { return m_doc; }
00055     KoStore* store() { return m_store; }
00056 
00057     KoOasisStyles& oasisStyles() { return m_styles; }
00058     KoStyleStack& styleStack() { return m_styleStack; }
00059 
00060     const QDomDocument& manifestDocument() const { return m_manifestDoc; }
00061 
00063     QString generator() const;
00064 
00077     void fillStyleStack( const QDomElement& element, const char* nsURI, const char* attrName, const char* family );
00078 
00093     void addStyles( const QDomElement* style, const char* family, bool usingStylesAutoStyles = false );
00094 
00097     void setUseStylesAutoStyles( bool useStylesAutoStyles ) { m_useStylesAutoStyles = useStylesAutoStyles; }
00098     //bool useStylesAutoStyles() const { return m_useStylesAutoStyles; }
00099 
00100 private:
00101     void parseMeta() const;
00102 
00103 private:
00104     KoDocument* m_doc;
00105     KoStore* m_store;
00106     KoOasisStyles& m_styles;
00107     KoStyleStack m_styleStack;
00108 
00109     mutable QString m_generator;
00110     mutable bool m_metaXmlParsed;
00111     bool m_useStylesAutoStyles;
00112     bool m_unused1; // padding, can be used later
00113     bool m_unused2; // padding, can be used later
00114 
00115     QDomDocument m_manifestDoc;
00116 
00117     class Private;
00118     Private *d;
00119 };
00120 
00121 #endif /* KOOASISLOADINGCONTEXT_H */
00122 
KDE Home | KDE Accessibility Home | Description of Access Keys