00001 /* AbiSource Program Utilities 00002 * 00003 * Copyright (C) 2002 Dom Lachowicz <cinamod@hotmail.com> 00004 * Copyright (C) 2005 Daniel d'Andrada T. de Carvalho 00005 * <daniel.carvalho@indt.org.br> 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., 59 Temple Place - Suite 330, Boston, MA 00020 * 02111-1307, USA. 00021 */ 00022 00023 #ifndef _ODI_STYLE_PAGELAYOUT_H_ 00024 #define _ODI_STYLE_PAGELAYOUT_H_ 00025 00026 // Internal includes 00027 #include "ODi_ListenerState.h" 00028 00029 // AbiWord includes 00030 #include <ut_string_class.h> 00031 00032 // Internal classes 00033 class ODi_Abi_Data; 00034 00035 // AbiWord classes 00036 class PD_Document; 00037 00038 00042 class ODi_Style_PageLayout : public ODi_ListenerState { 00043 public: 00044 ODi_Style_PageLayout(ODi_ElementStack& rElementStack, ODi_Abi_Data& rAbiData) : 00045 ODi_ListenerState("StylePageLayout", rElementStack), 00046 m_rAbiData(rAbiData) {} 00047 00048 virtual ~ODi_Style_PageLayout() {} 00049 00050 void startElement(const gchar* pName, const gchar** ppAtts, 00051 ODi_ListenerStateAction& rAction); 00052 00053 void endElement(const gchar* pName, ODi_ListenerStateAction& rAction); 00054 00055 void charData (const gchar* /*pBuffer*/, int /*length*/) {} 00056 00057 void definePageSizeTag(PD_Document* pDocument) const; 00058 00059 // Returns the value to be used on every <section> tag of the AbiWord 00060 // document. 00061 const UT_UTF8String getSectionProps(bool hasHeader, bool hasFooter) const; 00062 00063 const UT_UTF8String getMarginLeft() const { 00064 return m_marginLeft; 00065 } 00066 00067 const UT_UTF8String getMarginRight() const { 00068 return m_marginRight; 00069 } 00070 00071 inline const UT_UTF8String& getSectionDataID() const {return m_sectionDataID;} 00072 00073 inline const UT_UTF8String& getName() const {return m_name;} 00074 00075 private: 00076 00077 void _parseHeaderFooterProperties(const gchar** ppAtts); 00078 void _parsePageLayoutProperties(const gchar** ppAtts); 00079 void _parseBackgroundImage(const gchar** ppAtts); 00080 UT_UTF8String _buildSectionPropsString(bool hasHeader, bool hasFooter) const; 00081 void _buildSectionDataIDString(); 00082 00083 ODi_Abi_Data& m_rAbiData; 00084 00085 UT_UTF8String m_name; 00086 00088 // <style:page-layout-properties> 00089 UT_UTF8String m_pageWidth; // fo:page-width 00090 UT_UTF8String m_pageHeight; // fo:page-height 00091 UT_UTF8String m_printOrientation; // style:print-orientation 00092 UT_UTF8String m_marginLeft; // fo:margin-left 00093 UT_UTF8String m_marginRight; // fo:margin-right 00094 UT_UTF8String m_marginTop; // fo:margin-top 00095 UT_UTF8String m_marginBottom; // fo:margin-bottom 00096 UT_UTF8String m_backgroundColor; // fo:background-color 00097 00099 // <style:columns> 00100 UT_UTF8String m_columnCount; // fo:column-count 00101 UT_UTF8String m_columnGap; // fo:column-gap 00102 00104 // <style:column-sep> 00105 UT_UTF8String m_columnLine; // style:style or style:width 00106 00108 // <style:header-style> 00109 UT_UTF8String m_headerHeight; // svg:height 00110 UT_UTF8String m_headerMarginBottom; // fo:margin-bottom 00111 00113 // <style:footer-style> 00114 UT_UTF8String m_footerHeight; // svg:height 00115 UT_UTF8String m_footerMarginTop; // fo:margin-top 00116 00118 // <style:background-image> 00119 UT_UTF8String m_backgroundImage; // xlink:href 00120 00121 // The strux-image-dataid attribute for the section 00122 UT_UTF8String m_sectionDataID; 00123 }; 00124 00125 #endif //_ODI_STYLE_PAGELAYOUT_H_
1.7.1