lib

KoOasisLoadingContext Class Reference

#include <KoOasisLoadingContext.h>

Inheritance diagram for KoOasisLoadingContext:

KoOasisContext List of all members.

Detailed Description

Used during loading of Oasis format (and discarded at the end of the loading).

Author:
David Faure <faure@kde.org>

Definition at line 39 of file KoOasisLoadingContext.h.


Public Member Functions

 KoOasisLoadingContext (KoDocument *doc, KoOasisStyles &styles, KoStore *store)
 ~KoOasisLoadingContext ()
KoDocumentkoDocument ()
KoStorestore ()
KoOasisStylesoasisStyles ()
KoStyleStackstyleStack ()
const QDomDocument & manifestDocument () const
QString generator () const
void fillStyleStack (const QDomElement &element, const char *nsURI, const char *attrName, const char *family)
void addStyles (const QDomElement *style, const char *family, bool usingStylesAutoStyles=false)
void setUseStylesAutoStyles (bool useStylesAutoStyles)

Constructor & Destructor Documentation

KoOasisLoadingContext::KoOasisLoadingContext ( KoDocument doc,
KoOasisStyles styles,
KoStore store 
)

Stores reference to the KoOasisStyles and stored passed by KoDocument.

Make sure that the KoOasisStyles instance outlives this KoOasisLoadingContext instance. (This is the case during loading, when using the KoOasisStyles given by KoDocument)

Parameters:
doc the KoDocument being loaded
styles reference to the KoOasisStyles parsed by KoDocument
store pointer to store, if available, for e.g. loading images.

Definition at line 27 of file KoOasisLoadingContext.cpp.


Member Function Documentation

QString KoOasisLoadingContext::generator (  )  const

Return the <meta:generator> of the document, e.g. "KOffice/1.4.0a".

Definition at line 99 of file KoOasisLoadingContext.cpp.

void KoOasisLoadingContext::fillStyleStack ( const QDomElement &  element,
const char *  nsURI,
const char *  attrName,
const char *  family 
)

Convenience method for loading the style of an object before loading that object.

Read attribute (nsURI,attrName) from the given dom element, treat that attribute as a style name, and load that style including all its parent styles.

Parameters:
element the dom element to read the attribute from
nsURI the namespace URI of the attribute to read
attrName the name of the attribute to read
family the style family used for this object

Definition at line 44 of file KoOasisLoadingContext.cpp.

void KoOasisLoadingContext::addStyles ( const QDomElement *  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.

Parameters:
style the dom element containing the style to add to the stack
family the family to use when looking up parent styles
usingStylesAutoStyles if true, the parent styles are looked up in the automatic styles from styles.xml, instead of looking up in the automatic styles from content.xml as we usually do. This is useful for loading headers and footers for instance. See setUseStylesAutoStyles(), which makes fillStyleStack() set this bool.
Usually you would call fillStyleStack() instead.

Definition at line 67 of file KoOasisLoadingContext.cpp.

void KoOasisLoadingContext::setUseStylesAutoStyles ( bool  useStylesAutoStyles  )  [inline]

Set to true while loading headers and footers, to remember to use auto styles from styles.xml.

Definition at line 97 of file KoOasisLoadingContext.h.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys