• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

ODi_Style_List.h

Go to the documentation of this file.
00001 /* AbiSource Program Utilities
00002  *
00003  * Copyright (C) 2005 Daniel d'Andrada T. de Carvalho
00004  * <daniel.carvalho@indt.org.br>
00005  * Copyright (C) 2009 Hubert Figuiere
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation; either version 2
00010  * of the License, or (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00020  * 02110-1301 USA.
00021  */
00022 
00023 #ifndef _ODI_STYLE_LIST_H_
00024 #define _ODI_STYLE_LIST_H_
00025 
00026 #include <string>
00027 #include <vector>
00028 
00029 // Internal includes
00030 #include "ODi_ListenerState.h"
00031 
00032 // Internal classes
00033 class ODi_ListLevelStyle;
00034 
00035 // AbiWord classes
00036 class PD_Document;
00037 
00038 
00042 class ODi_Style_List
00043     : public ODi_ListenerState {
00044 
00045 public:
00046 
00047     ODi_Style_List(ODi_ElementStack& rElementStack) :
00048         ODi_ListenerState("StyleList", rElementStack),
00049         m_bListStyle(false)
00050     {
00051     }
00052 
00053     virtual ~ODi_Style_List();
00054 
00055     void startElement (const gchar* pName, const gchar** ppAtts,
00056                                ODi_ListenerStateAction& rAction);
00057 
00058     void endElement (const gchar* pName,
00059                              ODi_ListenerStateAction& rAction);
00060 
00061     void charData (const gchar* /*pBuffer*/, int /*length*/) { };
00062 
00063     void defineAbiList(PD_Document* pDocument);
00064     void redefine(PD_Document* pDocument, UT_uint32 iLevel);
00065 
00066     ODi_ListLevelStyle* getLevelStyle(UT_uint32 level) const
00067         {
00068             UT_return_val_if_fail(level > 0, NULL);
00069             UT_return_val_if_fail(!m_levelStyles.empty(), NULL);
00070             UT_return_val_if_fail(level <= m_levelStyles.size(), NULL);
00071 
00072             // Levels starts from 1, but our vector starts from 0 (zero).
00073             return m_levelStyles[level-1];
00074         }
00075 
00076     UT_sint32 getLevelCount() const
00077         {
00078             return m_levelStyles.size();
00079         }
00080 
00081     void buildAbiPropertiesString() const;
00082 
00083 private:
00084     // style:name attribute
00085     std::string m_name;
00086 
00087     // style:display-name attribute
00088     std::string m_displayName;
00089 
00090     // text:consecutive-numbering attribute
00091     //bool m_bConsecutiveNumbering;
00092 
00093     std::vector<ODi_ListLevelStyle*> m_levelStyles;
00094     bool m_bListStyle;
00095 };
00096 
00097 #endif //_ODI_STYLE_LIST_H_

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1