00001 /* AbiSource 00002 * 00003 * Copyright (C) 2005 INdT 00004 * Author: Daniel d'Andrada T. de Carvalho <daniel.carvalho@indt.org.br> 00005 * 00006 * This program is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU General Public License 00008 * as published by the Free Software Foundation; either version 2 00009 * of the License, or (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software 00018 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 00019 * 02110-1301 USA. 00020 */ 00021 00022 #ifndef ODE_LISTLEVELSTYLE_H_ 00023 #define ODE_LISTLEVELSTYLE_H_ 00024 00025 // External includes 00026 #include <gsf/gsf-output.h> 00027 00028 // AbiWord includes 00029 #include <ut_string_class.h> 00030 00031 // AbiWord classes 00032 class PP_AttrProp; 00033 00034 00039 class ODe_ListLevelStyle { 00040 public: 00041 virtual ~ODe_ListLevelStyle() 00042 { 00043 } 00044 virtual void fetchAttributesFromAbiBlock(const PP_AttrProp& rAP); 00045 00046 // Write this <text:list-style> element. 00047 virtual bool write(GsfOutput* pODT, 00048 const UT_UTF8String& rSpacesOffset) const = 0; 00049 00050 const UT_UTF8String& getAbiListID() const {return m_AbiListId;} 00051 00052 const UT_UTF8String& getFontName() const {return m_fontName;} 00053 00054 static void calculateListMargins(const PP_AttrProp& rAP, 00055 UT_UTF8String& textIndent, UT_UTF8String& spaceBefore, 00056 UT_UTF8String& minLabelWidth, UT_UTF8String& marginLeft); 00057 00058 protected: 00059 00060 void _writeTextProperties(GsfOutput* pODT, 00061 const UT_UTF8String& rSpacesOffset) const; 00062 00063 void _writeListLevelProperties(GsfOutput* pODT, 00064 const UT_UTF8String& rSpacesOffset) const; 00065 00066 // listid attribute fom AbiWord <p> tag. 00067 UT_UTF8String m_AbiListId; 00068 00069 UT_UTF8String m_level; // text:level 00070 00072 // <style:text-properties> sub element 00073 UT_UTF8String m_fontName; // style:font-name 00074 00076 // <style:list-level-properties> sub element 00077 UT_UTF8String m_textIndent; // fo:text-indent 00078 UT_UTF8String m_spaceBefore; // text:space-before 00079 UT_UTF8String m_minLabelWidth; // text:min-label-width 00080 UT_UTF8String m_marginLeft; // fo:margin-left 00081 }; 00082 00083 00087 class ODe_Bullet_ListLevelStyle : public ODe_ListLevelStyle { 00088 public: 00089 virtual ~ODe_Bullet_ListLevelStyle() 00090 {} 00091 00092 virtual void fetchAttributesFromAbiBlock(const PP_AttrProp& rAP); 00093 00094 virtual bool write(GsfOutput* pODT, 00095 const UT_UTF8String& rSpacesOffset) const; 00096 00097 private: 00098 UT_UTF8String m_bulletChar; // text:bullet-char 00099 }; 00100 00101 00105 class ODe_Numbered_ListLevelStyle : public ODe_ListLevelStyle { 00106 public: 00107 virtual ~ODe_Numbered_ListLevelStyle() 00108 {} 00109 virtual void fetchAttributesFromAbiBlock(const PP_AttrProp& rAP); 00110 00111 virtual bool write(GsfOutput* pODT, 00112 const UT_UTF8String& rSpacesOffset) const; 00113 private: 00114 UT_UTF8String m_startValue; // text:start-value 00115 UT_UTF8String m_numFormat; // style:num-format 00116 UT_UTF8String m_displayLevels; // text:display-levels 00117 }; 00118 00119 #endif /*ODE_LISTLEVELSTYLE_H_*/