KoOasisStore Class Reference
Helper class around KoStore for writing out OASIS files. More...
#include <koOasisStore.h>
Collaboration diagram for KoOasisStore:

Public Member Functions | |
KoOasisStore (KoStore *store) | |
KoStore * | store () const |
KoXmlWriter * | contentWriter () |
KoXmlWriter * | bodyWriter () |
bool | closeContentWriter () |
KoXmlWriter * | manifestWriter (const char *mimeType) |
bool | closeManifestWriter () |
bool | loadAndParse (const QString &fileName, QDomDocument &doc, QString &errorMessage) |
Static Public Member Functions | |
static QString | mimeForPath (const QDomDocument &doc, const QString &fullPath) |
Detailed Description
Helper class around KoStore for writing out OASIS files.This class helps solving the problem that automatic styles must be before the body, but it's easier to iterate over the application's objects only once. So we open a KoXmlWriter into a memory buffer, write the body into it, collect automatic styles while doing that, write out automatic styles, and then copy the body XML from the buffer into the real KoXmlWriter.
The typical use of this class is therefore:
- write body into bodyWriter() and collect auto styles
- write auto styles into contentWriter()
- call closeContentWriter()
- write other files into the store (styles.xml, settings.xml etc.)
TODO: maybe we could encapsulate a bit more things, to e.g. handle adding manifest entries automatically.
- Author:
- : David Faure <faure@kde.org>
Definition at line 51 of file koOasisStore.h.
Constructor & Destructor Documentation
|
Definition at line 36 of file koOasisStore.cpp. |
Member Function Documentation
|
Open contents.xml for writing and return the KoXmlWriter.
Definition at line 62 of file koOasisStore.cpp. References KoDocument::createOasisXmlWriter(), and KoStore::open(). |
|
Open another KoXmlWriter for writing out the contents into a temporary file, to collect automatic styles while doing that.
Definition at line 74 of file koOasisStore.cpp. |
|
This will copy the body into the content writer, delete the bodyWriter and the contentWriter, and then close contents.xml.
Definition at line 86 of file koOasisStore.cpp. References KoXmlWriter::addCompleteElement(), and KoStore::close(). |
|
Create and return a manifest writer. It will write to a memory buffer.
Definition at line 109 of file koOasisStore.cpp. References KoXmlWriter::addAttribute(), KoXmlWriter::addManifestEntry(), KoXmlWriter::startDocument(), and KoXmlWriter::startElement(). Referenced by KoDocument::saveNativeFormat(). |
|
Close the manifest writer, writing its contents to manifest.xml.
Definition at line 125 of file koOasisStore.cpp. References KoStore::close(), KoXmlWriter::device(), KoXmlWriter::endDocument(), KoXmlWriter::endElement(), KoStore::open(), and KoStore::write(). Referenced by KoDocument::saveNativeFormat(). |
|
A completely unrelated method, for loading a file from an oasis store.
Definition at line 141 of file koOasisStore.cpp. References KoStore::close(), KoStore::device(), KoStore::open(), and KoDocument::setupXmlReader(). Referenced by KoOasisContext::KoOasisContext(), and KoDocument::loadOasisFromStore(). |
|
Another method for loading: get mimetype from full path, using the manifest.
Definition at line 181 of file koOasisStore.cpp. Referenced by KoDocumentChild::loadOasisDocument(). |
The documentation for this class was generated from the following files: