00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef KOSTYLESTACK_H
00022 #define KOSTYLESTACK_H
00023
00024
00025 #include <q3valuelist.h>
00026 #include <qdom.h>
00027 #include <q3valuestack.h>
00028
00029 #include <kdemacros.h>
00030
00031 #include "koffice_export.h"
00032 #include <KoXmlReader.h>
00033
00060 class KOFFICECORE_EXPORT KoStyleStack
00061 {
00062 public:
00066 KoStyleStack();
00070 KoStyleStack( const char* styleNSURI, const char* foNSURI );
00071 virtual ~KoStyleStack();
00072
00076 void clear();
00077
00082 void save();
00083
00087 void restore();
00088
00092 void pop();
00093
00097 void push( const KoXmlElement& style );
00098
00104 bool hasAttribute( const QString& name, const QString& detail = QString::null ) const KDE_DEPRECATED;
00105
00110 QString attribute( const QString& name, const QString& detail = QString::null ) const KDE_DEPRECATED;
00111
00117 bool hasAttributeNS( const char* nsURI, const char* localName, const char* detail = 0 ) const;
00118
00123 QString attributeNS( const char* nsURI, const char* localName, const char* detail = 0 ) const;
00124
00128 bool hasChildNode( const QString & name ) const KDE_DEPRECATED;
00129
00134 KoXmlElement childNode( const QString & name ) const KDE_DEPRECATED;
00135
00139 bool hasChildNodeNS( const char* nsURI, const char* localName ) const;
00140
00146 KoXmlElement childNodeNS( const char* nsURI, const char* localName ) const;
00147
00151 double fontSize() const;
00152
00159 QString userStyleName( const QString& family ) const;
00160
00165 QString userStyleDisplayName( const QString& family ) const;
00166
00174 void setTypeProperties( const char* typeProperties );
00175
00176 private:
00177 bool isUserStyle( const KoXmlElement& e, const QString& family ) const;
00178
00179 private:
00181 Q3ValueStack<int> m_marks;
00182
00187 Q3ValueList<KoXmlElement> m_stack;
00188
00189 QByteArray m_propertiesTagName;
00190
00191 const char* m_styleNSURI;
00192 const char* m_foNSURI;
00193
00194 class KoStyleStackPrivate;
00195 KoStyleStackPrivate *d;
00196
00197
00198 void operator=( const KoStyleStack& );
00199 KoStyleStack( const KoStyleStack& );
00200 };
00201
00202 #endif