lib

KoOasisLoadingContext Class Reference

#include <KoOasisLoadingContext.h>

Inheritance diagram for KoOasisLoadingContext:
KoOasisContext

Public Member Functions

 KoOasisLoadingContext (KoDocument *doc, KoOasisStyles &styles, KoStore *store)
 
KoDocument * koDocument ()
 
KoStore * store ()
 
KoOasisStyles & oasisStyles ()
 
KoStyleStack & styleStack ()
 
const TQDomDocument & manifestDocument () const
 
TQString generator () const
 
void fillStyleStack (const TQDomElement &element, const char *nsURI, const char *attrName, const char *family)
 
void addStyles (const TQDomElement *style, const char *family, bool usingStylesAutoStyles=false)
 
void setUseStylesAutoStyles (bool useStylesAutoStyles)
 

Detailed Description

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

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

Definition at line 39 of file KoOasisLoadingContext.h.

Constructor & Destructor Documentation

◆ KoOasisLoadingContext()

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
docthe KoDocument being loaded
stylesreference to the KoOasisStyles parsed by KoDocument
storepointer to store, if available, for e.g. loading images.

Definition at line 27 of file KoOasisLoadingContext.cpp.

◆ ~KoOasisLoadingContext()

KoOasisLoadingContext::~KoOasisLoadingContext ( )

Definition at line 39 of file KoOasisLoadingContext.cpp.

Member Function Documentation

◆ addStyles()

void KoOasisLoadingContext::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.

Parameters
stylethe dom element containing the style to add to the stack
familythe family to use when looking up parent styles
usingStylesAutoStylesif 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.

◆ fillStyleStack()

void KoOasisLoadingContext::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.

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
elementthe dom element to read the attribute from
nsURIthe namespace URI of the attribute to read
attrNamethe name of the attribute to read
familythe style family used for this object

Definition at line 44 of file KoOasisLoadingContext.cpp.

◆ generator()

TQString KoOasisLoadingContext::generator ( ) const

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

Definition at line 99 of file KoOasisLoadingContext.cpp.

◆ koDocument()

KoDocument * KoOasisLoadingContext::koDocument ( )
inline

Definition at line 54 of file KoOasisLoadingContext.h.

◆ manifestDocument()

const TQDomDocument & KoOasisLoadingContext::manifestDocument ( ) const
inline

Definition at line 60 of file KoOasisLoadingContext.h.

◆ oasisStyles()

KoOasisStyles & KoOasisLoadingContext::oasisStyles ( )
inline

Definition at line 57 of file KoOasisLoadingContext.h.

◆ setUseStylesAutoStyles()

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.

◆ store()

KoStore * KoOasisLoadingContext::store ( )
inline

Definition at line 55 of file KoOasisLoadingContext.h.

◆ styleStack()

KoStyleStack & KoOasisLoadingContext::styleStack ( )
inline

Definition at line 58 of file KoOasisLoadingContext.h.


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