lib

KoStyleStack.h

00001 /* This file is part of the KDE project
00002    Copyright (c) 2003 Lukas Tinkl <lukas@kde.org>
00003    Copyright (c) 2003 David Faure <faure@kde.org>
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License as published by the Free Software Foundation; either
00008    version 2 of the License, or (at your option) any later version.
00009 
00010    This library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this library; see the file COPYING.LIB.  If not, write to
00017    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018  * Boston, MA 02110-1301, USA.
00019 */
00020 
00021 #ifndef KOSTYLESTACK_H
00022 #define KOSTYLESTACK_H
00023 
00024 
00025 #include <qvaluelist.h>
00026 #include <qdom.h>
00027 #include <qvaluestack.h>
00028 
00029 #include <kdemacros.h>
00030 
00031 #include "koffice_export.h"
00032 
00059 class KOFFICECORE_EXPORT  KoStyleStack
00060 {
00061 public:
00065     KoStyleStack();
00069     KoStyleStack( const char* styleNSURI, const char* foNSURI );
00070     virtual ~KoStyleStack();
00071 
00075     void clear();
00076 
00081     void save();
00082 
00086     void restore();
00087 
00091     void pop();
00092 
00096     void push( const QDomElement& style );
00097 
00103     bool hasAttribute( const QString& name, const QString& detail = QString::null ) const KDE_DEPRECATED;
00104 
00109     QString attribute( const QString& name, const QString& detail = QString::null ) const KDE_DEPRECATED;
00110 
00116     bool hasAttributeNS( const char* nsURI, const char* localName, const char* detail = 0 ) const;
00117 
00122     QString attributeNS( const char* nsURI, const char* localName, const char* detail = 0 ) const;
00123 
00127     bool hasChildNode( const QString & name ) const KDE_DEPRECATED;
00128 
00133     QDomElement childNode( const QString & name ) const KDE_DEPRECATED;
00134 
00138     bool hasChildNodeNS( const char* nsURI, const char* localName ) const;
00139 
00145     QDomElement childNodeNS( const char* nsURI, const char* localName ) const;
00146 
00150     double fontSize() const;
00151 
00158     QString userStyleName( const QString& family ) const;
00159 
00164     QString userStyleDisplayName( const QString& family ) const;
00165 
00173     void setTypeProperties( const char* typeProperties );
00174 
00175 private:
00176     bool isUserStyle( const QDomElement& e, const QString& family ) const;
00177 
00178 private:
00180     QValueStack<int> m_marks;
00181 
00186     QValueList<QDomElement> m_stack;
00187 
00188     QCString m_propertiesTagName;
00189 
00190     const char* m_styleNSURI;
00191     const char* m_foNSURI;
00192 
00193     class KoStyleStackPrivate;
00194     KoStyleStackPrivate *d;
00195 
00196     // forbidden
00197     void operator=( const KoStyleStack& );
00198     KoStyleStack( const KoStyleStack& );
00199 };
00200 
00201 #endif /* KOSTYLESTACK_H */
KDE Home | KDE Accessibility Home | Description of Access Keys