00001 /* This file is part of the KDE project 00002 Copyright (c) 2004 David Faure <faure@kde.org> 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License as published by the Free Software Foundation; either 00007 version 2 of the License, or (at your option) any later version. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this library; see the file COPYING.LIB. If not, write to 00016 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00017 * Boston, MA 02110-1301, USA. 00018 */ 00019 00020 #ifndef KOLISTSTYLESTACK_H 00021 #define KOLISTSTYLESTACK_H 00022 00023 #include <qdom.h> 00024 #include <q3valuestack.h> 00025 00034 class KoListStyleStack 00035 { 00036 public: 00037 KoListStyleStack(); 00038 ~KoListStyleStack(); 00039 00043 void pop(); 00044 00048 void push( const QDomElement& style ); 00049 00051 bool hasListStyle() const { return !m_stack.isEmpty(); } 00052 00055 QDomElement currentListStyle() const; 00056 00063 QDomElement currentListStyleProperties() const; 00064 00068 QDomElement currentListStyleTextProperties() const; 00069 00075 void setInitialLevel( int initialLevel ); 00076 00078 int initialLevel() const { return m_initialLevel; } 00079 00081 int level() const { return m_initialLevel + m_stack.count(); } 00082 00083 00084 private: 00085 Q3ValueStack<QDomElement> m_stack; 00086 int m_initialLevel; 00087 00088 }; 00089 00090 #endif /* KOLISTSTYLESTACK_H */ 00091