KoStyleStack Class Reference
This class implements a stack for the different styles of an object. More...
#include <koStyleStack.h>
Collaboration diagram for KoStyleStack:

Public Member Functions | |
KoStyleStack () | |
KoStyleStack (const char *styleNSURI, const char *foNSURI) | |
void | clear () |
void | save () |
void | restore () |
void | pop () |
void | push (const QDomElement &style) |
bool | hasAttribute (const QString &name, const QString &detail=QString::null) const KDE_DEPRECATED |
QString | attribute (const QString &name, const QString &detail=QString::null) const KDE_DEPRECATED |
bool | hasAttributeNS (const char *nsURI, const char *localName, const char *detail=0) const |
QString | attributeNS (const char *nsURI, const char *localName, const char *detail=0) const |
bool | hasChildNode (const QString &name) const KDE_DEPRECATED |
QDomElement | childNode (const QString &name) const KDE_DEPRECATED |
bool | hasChildNodeNS (const char *nsURI, const char *localName) const |
QDomElement | childNodeNS (const char *nsURI, const char *localName) const |
double | fontSize () const |
QString | userStyleName () const |
QString | userStyleDisplayName () const |
void | setTypeProperties (const char *typeProperties) |
Detailed Description
This class implements a stack for the different styles of an object.There can be several styles that are valid for one object. For example a textobject on a page has styles 'pr3' and 'P7' and a paragraph in that textobject has styles 'P1' and 'T3'. And some styles even have parent-styles...
If you want to know if there is, for example, the attribute 'fo:font-family' for this paragraph, you have to look into style 'T3', 'P1', 'P7' and 'pr3'. When you find this attribute in one style you have to stop processing the list and take the found attribute for this object.
This is what this class does. You can push styles on the stack while walking through the xml-tree to your object and then ask the stack if any of the styles provides a certain attribute. The stack will search from top to bottom, i.e. in our example from 'T3' to 'pr3' and return the first occurrence of the wanted attribute.
So this is some sort of inheritance where the styles on top of the stack overwrite the same attribute of a lower style on the stack.
Definition at line 55 of file koStyleStack.h.
Constructor & Destructor Documentation
|
Create a OASIS style stack.
Definition at line 30 of file koStyleStack.cc. References clear(). |
|
Create a style stack based on other namespaces than OASIS - used for OOo-1.1 import.
Definition at line 36 of file koStyleStack.cc. References clear(). |
Member Function Documentation
|
Clears the complete stack.
Definition at line 46 of file koStyleStack.cc. Referenced by KoStyleStack(). |
|
Save the current state of the stack. Any items added between this call and its corresponding restore() will be removed when calling restore(). Definition at line 54 of file koStyleStack.cc. |
|
Restore the stack to the state it was at the corresponding save() call.
Definition at line 62 of file koStyleStack.cc. |
|
Removes the style on top of the stack.
Definition at line 75 of file koStyleStack.cc. |
|
Pushes the new style onto the stack.
Definition at line 84 of file koStyleStack.cc. |
|
Check if any of the styles on the stack has an attribute called 'name'-'detail' where detail is e.g. left, right, top or bottom. This allows to also find 'name' alone (e.g. padding implies padding-left, padding-right etc.) Definition at line 92 of file koStyleStack.cc. |
|
Search for the attribute called 'name', starting on top of the stack, and return it.
Definition at line 112 of file koStyleStack.cc. |
|
Check if any of the styles on the stack has an attribute called 'name'-'detail' where detail is e.g. left, right, top or bottom. This allows to also find 'name' alone (e.g. padding implies padding-left, padding-right etc.) Definition at line 154 of file koStyleStack.cc. References KoDom::namedItemNS(). Referenced by KoTextFormat::load(). |
|
Search for the attribute called 'name', starting on top of the stack, and return it.
Definition at line 133 of file koStyleStack.cc. References KoDom::namedItemNS(). Referenced by KoTextFormat::load(). |
|
Check if any of the styles on the stack has a child node called 'name'.
Definition at line 198 of file koStyleStack.cc. |
|
Search for a child node called 'name', starting on top of the stack, and return it.
Definition at line 212 of file koStyleStack.cc. |
|
Check if any of the styles on the stack has a child element called 'localName' in the namespace 'nsURI'.
Definition at line 227 of file koStyleStack.cc. References KoDom::namedItemNS(). |
|
Search for a child element which has a child element called 'localName' in the namespace 'nsURI' starting on top of the stack, and return it.
Definition at line 241 of file koStyleStack.cc. References KoDom::namedItemNS(). |
|
Special case for the current font size, due to special handling of fo:font-size="115".
Definition at line 177 of file koStyleStack.cc. References KoDom::namedItemNS(), and KoUnit::parseValue(). Referenced by KoTextFormat::load(). |
|
Return the name of the style specified by the user, i.e. not an auto style Definition at line 264 of file koStyleStack.cc. |
|
Return the display name of the style specified by the user, i.e. not an auto style Definition at line 278 of file koStyleStack.cc. |
|
Set the type of properties that will be looked for.
For instance setTypeProperties("paragraph") will make hasAttribute() and attribute() look into "paragraph-properties". If Definition at line 291 of file koStyleStack.cc. Referenced by KoTextFormat::load(). |
The documentation for this class was generated from the following files: