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

ODi_ListLevelStyle.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  *
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 _ODI_LISTLEVELSTYLE_H_
00023 #define _ODI_LISTLEVELSTYLE_H_
00024 
00025 // Internal includes
00026 #include "ODi_ListenerState.h"
00027 
00028 // Internal classes
00029 class ODi_Style_Style;
00030 
00031 // AbiWord classes
00032 class PD_Document;
00033 
00037 class ODi_ListLevelStyle : public ODi_ListenerState {
00038 
00039 public:
00040 
00041     ODi_ListLevelStyle(const char* pStateName, ODi_ElementStack& rElementStack);
00042     virtual ~ODi_ListLevelStyle() {}
00043 
00044     virtual void startElement (const gchar* pName, const gchar** ppAtts,
00045                                ODi_ListenerStateAction& rAction);
00046 
00047     virtual void endElement (const gchar* pName,
00048                              ODi_ListenerStateAction& rAction);
00049 
00050     virtual void charData (const gchar* /*pBuffer*/, int /*length*/) {}
00051 
00052     UT_uint32 getLevelNumber() const {return m_levelNumber;}
00053 
00054     void setAbiListID(UT_uint32 abiListID);
00055     const std::string* getAbiListID() const {return &m_abiListID;}
00056 
00057     void setAbiListParentID(const std::string& rAbiListParentID) {
00058         m_abiListParentID = rAbiListParentID;
00059     }
00060 
00061     bool isVisible(void) const;
00062 
00063     void setAbiListParentID(const gchar* pParentID) {
00064         m_abiListParentID.assign(pParentID);
00065     }
00066 
00067     const std::string* getTextStyleName() const {return &m_textStyleName;}
00068     void setTextStyle(const ODi_Style_Style* pTextStyle) {m_pTextStyle = pTextStyle;}
00069 
00070     const std::string* getAbiListParentID() const {return &m_abiListParentID;}
00071 
00079     void getAbiProperties(std::string& rProps, const ODi_Style_Style* pStyle = NULL) const;
00080 
00081     void defineAbiList(PD_Document* pDocument);
00082 
00083     virtual void buildAbiPropsString();
00084 
00085     const std::string* getMinLabelDistance() const {return &m_minLabelDistance;}
00086 
00087 protected:
00088 
00089     std::string m_level;
00090     UT_uint32 m_levelNumber;
00091 
00092     // The AbiWord list (<l> tag) ID.
00093     std::string m_abiListID;
00094 
00095     // The AbiWord list (<l> tag) parent id.
00096     std::string m_abiListParentID;
00097 
00098     // The AbiWord list (<l> tag) type.
00099     std::string m_abiListType;
00100 
00101     // The AbiWord list (<l> tag) start value.
00102     std::string m_abiListStartValue;
00103 
00104     // The AbiWord list (<l> tag) list delim.
00105     // It's a printf like string with the list maker format.
00106     std::string m_abiListListDelim;
00107 
00108     // The AbiWord list (<l> tag) list decimal.
00109     // It's the level delimiter, usually a ".", "," or "-"
00110     // Looks like the property name and its real name (the one used on the GUI)
00111     // don't match.
00112     std::string m_abiListListDecimal;
00113 
00114     // The properties of the list, to be used on the "props" attribute of
00115     // abi paragraphs (<p>) that uses this list level style.
00116     std::string m_abiProperties;
00117 
00118 
00119 
00120     // text:space-before attribute of <style:list-level-properties>
00121     std::string m_spaceBefore;
00122 
00123     // text:min-label-width attribute of <style:list-level-properties>
00124     std::string m_minLabelWidth;
00125 
00126     // text:min-label-distance attribute of <style:list-level-properties>
00127     // The minumum distance between the list label and the list text.
00128     // Can't be translated to AbiWord easily.
00129     std::string m_minLabelDistance;
00130 
00131     // fo:text-indent attribute of <style:list-level-properties>
00132     std::string m_textIndent;
00133 
00134     // fo:margin-left attribute of <style:list-level-properties>
00135     std::string m_marginLeft;
00136 
00137     // text:style-name attribute of <text:list-level-style-*>
00138     // Maps, indirectly, to the AbiWord "field-font" property.
00139     std::string m_textStyleName;
00140     const ODi_Style_Style* m_pTextStyle;
00141 };
00142 
00143 
00147 class ODi_Bullet_ListLevelStyle : public ODi_ListLevelStyle {
00148 
00149 public:
00150 
00151     ODi_Bullet_ListLevelStyle(ODi_ElementStack& m_rElementStack);
00152 
00153     void startElement (const gchar* pName, const gchar** ppAtts,
00154                                ODi_ListenerStateAction& rAction);
00155 
00156     /*void endElement (const gchar* pName,
00157                              ODi_ListenerStateAction& rAction);
00158 
00159     void charData (const gchar* pBuffer, int length);*/
00160 
00161     void buildAbiPropsString();
00162 };
00163 
00164 
00168 class ODi_Numbered_ListLevelStyle : public ODi_ListLevelStyle {
00169 
00170 public:
00171 
00172     ODi_Numbered_ListLevelStyle(ODi_ElementStack& m_rElementStack);
00173 
00174     void startElement (const gchar* pName, const gchar** ppAtts,
00175                                ODi_ListenerStateAction& rAction);
00176 
00177     /*void endElement (const gchar* pName,
00178                              ODi_ListenerStateAction& rAction);
00179 
00180     void charData (const gchar* pBuffer, int length);*/
00181 
00182     void buildAbiPropsString();
00183 
00184 private:
00185 
00192     void _setAbiListType(const gchar* pStyleNumFormat);
00193 };
00194 
00195 #endif //_ODI_LISTLEVELSTYLE_H_

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1