lib

#include <KoOasisStore.h>

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 TQString &fileName, TQDomDocument &doc, TQString &errorMessage)
 

Static Public Member Functions

static TQString mimeForPath (const TQDomDocument &doc, const TQString &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:

TODO: maybe we could encapsulate a bit more things, to e.g. handle adding manifest entries automatically.

Author
: David Faure faure.nosp@m.@kde.nosp@m..org

Definition at line 51 of file KoOasisStore.h.

Constructor & Destructor Documentation

◆ KoOasisStore()

KoOasisStore::KoOasisStore ( KoStore *  store)
Parameters
storerecontents the property of the caller

Definition at line 36 of file KoOasisStore.cpp.

◆ ~KoOasisStore()

KoOasisStore::~KoOasisStore ( )

Definition at line 46 of file KoOasisStore.cpp.

Member Function Documentation

◆ bodyWriter()

KoXmlWriter * KoOasisStore::bodyWriter ( )

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.

◆ closeContentWriter()

bool KoOasisStore::closeContentWriter ( )

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.

◆ closeManifestWriter()

bool KoOasisStore::closeManifestWriter ( )

Close the manifest writer, writing its contents to manifest.xml.

Definition at line 125 of file KoOasisStore.cpp.

◆ contentWriter()

KoXmlWriter * KoOasisStore::contentWriter ( )

Open contents.xml for writing and return the KoXmlWriter.

Definition at line 62 of file KoOasisStore.cpp.

◆ loadAndParse()

bool KoOasisStore::loadAndParse ( const TQString &  fileName,
TQDomDocument &  doc,
TQString &  errorMessage 
)

A completely unrelated method, for loading a file from an oasis store.

Definition at line 141 of file KoOasisStore.cpp.

◆ manifestWriter()

KoXmlWriter * KoOasisStore::manifestWriter ( const char *  mimeType)

Create and return a manifest writer. It will write to a memory buffer.

Definition at line 109 of file KoOasisStore.cpp.

◆ mimeForPath()

TQString KoOasisStore::mimeForPath ( const TQDomDocument &  doc,
const TQString &  fullPath 
)
static

Another method for loading: get mimetype from full path, using the manifest.

Definition at line 181 of file KoOasisStore.cpp.

◆ store()

KoStore * KoOasisStore::store ( ) const
inline

Definition at line 59 of file KoOasisStore.h.


The documentation for this class was generated from the following files: