lib

KoOasisLoadingContext.h
1/* This file is part of the KDE project
2 Copyright (C) 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 version 2 as published by the Free Software Foundation.
7
8 This library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details.
12
13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 Boston, MA 02110-1301, USA.
17*/
18
19#ifndef KOOASISLOADINGCONTEXT_H
20#define KOOASISLOADINGCONTEXT_H
21
22class KoXmlWriter;
23class TQDomElement;
24class KoDocument;
25class KoOasisStyles;
27class KoStore;
28
29#include <tqmap.h>
30#include <koffice_export.h>
31#include <tqstringlist.h>
32#include <KoStyleStack.h>
33
39class KOFFICECORE_EXPORT KoOasisLoadingContext
40{
41public:
53
54 KoDocument* koDocument() { return m_doc; }
55 KoStore* store() { return m_store; }
56
57 KoOasisStyles& oasisStyles() { return m_styles; }
58 KoStyleStack& styleStack() { return m_styleStack; }
59
60 const TQDomDocument& manifestDocument() const { return m_manifestDoc; }
61
63 TQString generator() const;
64
77 void fillStyleStack( const TQDomElement& element, const char* nsURI, const char* attrName, const char* family );
78
93 void addStyles( const TQDomElement* style, const char* family, bool usingStylesAutoStyles = false );
94
97 void setUseStylesAutoStyles( bool useStylesAutoStyles ) { m_useStylesAutoStyles = useStylesAutoStyles; }
98 //bool useStylesAutoStyles() const { return m_useStylesAutoStyles; }
99
100private:
101 void parseMeta() const;
102
103private:
104 KoDocument* m_doc;
105 KoStore* m_store;
106 KoOasisStyles& m_styles;
107 KoStyleStack m_styleStack;
108
109 mutable TQString m_generator;
110 mutable bool m_metaXmlParsed;
111 bool m_useStylesAutoStyles;
112 bool m_unused1; // padding, can be used later
113 bool m_unused2; // padding, can be used later
114
115 TQDomDocument m_manifestDoc;
116
117 class Private;
118 Private *d;
119};
120
121#endif /* KOOASISLOADINGCONTEXT_H */
122
The KOffice document class.
Definition KoDocument.h:61
void addStyles(const TQDomElement *style, const char *family, bool usingStylesAutoStyles=false)
Add style to the stack, as well as all its parent styles and the default style for this style family.
KoOasisLoadingContext(KoDocument *doc, KoOasisStyles &styles, KoStore *store)
Stores reference to the KoOasisStyles and stored passed by KoDocument.
void setUseStylesAutoStyles(bool useStylesAutoStyles)
Set to true while loading headers and footers, to remember to use auto styles from styles....
void fillStyleStack(const TQDomElement &element, const char *nsURI, const char *attrName, const char *family)
Convenience method for loading the style of an object before loading that object.
TQString generator() const
Return the <meta:generator> of the document, e.g. "KOffice/1.4.0a".
Repository of styles used during loading of OASIS/OOo file.
A collection of pictures (a key and the picture itself).
Saves and loads KOffice documents using various backends.
Definition KoStore.h:40
This class implements a stack for the different styles of an object.
A class for writing out XML (to any TQIODevice), with a special attention on performance.
Definition KoXmlWriter.h:37