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

ODe_Style_PageLayout.h

Go to the documentation of this file.
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_STYLE_PAGELAYOUT_H_
00023 #define _ODE_STYLE_PAGELAYOUT_H_
00024 
00025 // AbiWord includes
00026 #include "ut_string_class.h"
00027 
00028 // External includes
00029 #include <gsf/gsf-output.h>
00030 
00031 // AbiWord classes
00032 class PD_Document;
00033 class PP_AttrProp;
00034 
00038 class ODe_Style_PageLayout {
00039 public:
00040 
00041     void setName (const gchar* pName) {
00042         m_name = pName;
00043     }
00044 
00045     void setName (const UT_UTF8String& rName) {
00046         m_name = rName;
00047     }
00048 
00049     const gchar* getName() const {return m_name.utf8_str();}
00050 
00051     void fetchAttributesFromAbiDoc(PD_Document* pAbiDoc);
00052     void fetchAttributesFromAbiSection(const PP_AttrProp* pAP);
00053 
00054     static bool hasPageLayoutInfo(const PP_AttrProp* pAP);
00055 
00056     // Write the <style:page-layout> element.
00057     bool write(GsfOutput* pODT, const UT_UTF8String& rSpacesOffset) const;
00058 
00059     const char * getPageMarginTop(void)
00060     { return m_marginTop.utf8_str();}
00061     const char * getPageMarginLeft(void)
00062     { return m_marginLeft.utf8_str();}
00063     const char * getPageMarginHeader(void)
00064     { return m_headerHeight.utf8_str();}
00065 
00066 private:
00067 
00068     bool _haveHeaderInfo() const {return !m_headerHeight.empty();}
00069     bool _haveFooterInfo() const {return !m_footerHeight.empty();}
00070 
00071     // <style:page-layout>
00072     UT_UTF8String m_name; // style:name
00073 
00074     // <style:page-layout-properties>
00075     UT_UTF8String m_pageWidth;        // fo:page-width
00076     UT_UTF8String m_pageHeight;       // fo:page-height
00077     UT_UTF8String m_printOrientation; // style:print-orientation
00078     UT_UTF8String m_marginTop;        // fo:margin-top
00079     UT_UTF8String m_marginBottom;     // fo:margin-bottom
00080     UT_UTF8String m_marginLeft;       // fo:margin-left
00081     UT_UTF8String m_marginRight;      // fo:margin-right
00082     UT_UTF8String m_backgroundColor;  // fo:background-color
00083 
00084     // <style:header-style>
00085     //   <style:header-footer-properties>
00086     UT_UTF8String m_headerHeight; // svg:height
00087 
00088     // <style:footer-style>
00089     //   <style:header-footer-properties>
00090     UT_UTF8String m_footerHeight; // svg:height
00091 
00092     // <style:background-image>
00093     UT_UTF8String m_backgroundImage;  // xlink:href
00094 };
00095 
00096 #endif //_ODE_STYLE_PAGELAYOUT_H_

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1