Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

WPXPageSpan.h

Go to the documentation of this file.
00001 /* libwpd
00002  * Copyright (C) 2002 William Lachance (wrlach@gmail.com)
00003  * Copyright (C) 2002 Marc Maurer (uwog@uwog.net)
00004  * Copyright (C) 2006 Fridrich Strba (fridrich.strba@bluewin.ch)
00005  *  
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Library General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2 of the License, or (at your option) any later version.
00010  *
00011  * This library 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 GNU
00014  * Library General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Library General Public
00017  * License along with this library; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
00019  *
00020  * For further information visit http://libwpd.sourceforge.net
00021  */
00022 
00023 /* "This product is not manufactured, approved, or supported by 
00024  * Corel Corporation or Corel Corporation Limited."
00025  */
00026 
00027 #ifndef WPXPAGE_H
00028 #define WPXPAGE_H
00029 #include "WPXFileStructure.h"
00030 #include <vector>
00031 #include "WPXTable.h"
00032 #include "libwpd_internal.h"
00033 #include "WPXSubDocument.h"
00034 
00035 const uint8_t DUMMY_INTERNAL_HEADER_FOOTER = 16;
00036 
00037 // intermediate page representation class: for internal use only (by the high-level content/styles listeners). should not be exported.
00038 
00039 class WPXHeaderFooter
00040 {
00041 public:
00042         WPXHeaderFooter(const WPXHeaderFooterType headerFooterType, const WPXHeaderFooterOccurence occurence, 
00043                         const uint8_t internalType, const WPXSubDocument * subDocument, WPXTableList tableList);
00044         WPXHeaderFooter(const WPXHeaderFooterType headerFooterType, const WPXHeaderFooterOccurence occurence, 
00045                         const uint8_t internalType, const WPXSubDocument * subDocument);
00046         WPXHeaderFooter(const WPXHeaderFooter &headerFooter);
00047         ~WPXHeaderFooter();
00048         WPXHeaderFooter& operator=(const WPXHeaderFooter &headerFooter);
00049         const WPXHeaderFooterType getType() const { return m_type; }
00050         const WPXHeaderFooterOccurence getOccurence() const { return m_occurence; }
00051         const uint8_t getInternalType() const { return m_internalType; }
00052         const WPXSubDocument * getSubDocument() const { return m_subDocument; }
00053         WPXTableList getTableList() const { return m_tableList; }
00054 
00055 private:
00056         WPXHeaderFooterType m_type;
00057         WPXHeaderFooterOccurence m_occurence;
00058         uint8_t m_internalType; // for suppression
00059         const WPXSubDocument * m_subDocument; // for the actual text
00060         WPXTableList m_tableList;
00061 };
00062 
00063 class WPXPageSpan
00064 {
00065 public:
00066         WPXPageSpan();
00067         WPXPageSpan(const WPXPageSpan &page, float paragraphMarginLeft, float paragraphMarginRight);
00068         WPXPageSpan(const WPXPageSpan &page);
00069         virtual ~WPXPageSpan();
00070 
00071         const bool getHeaderFooterSuppression(const uint8_t headerFooterType) const { if (headerFooterType <= WPX_FOOTER_B) return m_isHeaderFooterSuppressed[headerFooterType]; return false; }
00072         const float getFormLength() const { return m_formLength; }
00073         const float getFormWidth() const { return m_formWidth; }
00074         const WPXFormOrientation getFormOrientation() const { return m_formOrientation; }
00075         const float getMarginLeft() const { return m_marginLeft; }
00076         const float getMarginRight() const { return m_marginRight; }
00077         const float getMarginTop() const { return m_marginTop; }
00078         const float getMarginBottom() const { return m_marginBottom; }
00079         const int getPageSpan() const { return m_pageSpan; }
00080         const std::vector<WPXHeaderFooter> & getHeaderFooterList() const { return m_headerFooterList; }
00081 
00082         void setHeaderFooter(const WPXHeaderFooterType type, const uint8_t headerFooterType, const WPXHeaderFooterOccurence occurence, 
00083                              const WPXSubDocument * subDocument, WPXTableList tableList);
00084         void setHeadFooterSuppression(const uint8_t headerFooterType, const bool suppress) { m_isHeaderFooterSuppressed[headerFooterType] = suppress; }
00085         void setFormLength(const float formLength) { m_formLength = formLength; }
00086         void setFormWidth(const float formWidth) { m_formWidth = formWidth; }
00087         void setFormOrientation(const WPXFormOrientation formOrientation) { m_formOrientation = formOrientation; }
00088         void setMarginLeft(const float marginLeft) { m_marginLeft = marginLeft; }
00089         void setMarginRight(const float marginRight) { m_marginRight = marginRight; }
00090         void setMarginTop(const float marginTop) { m_marginTop = marginTop; }
00091         void setMarginBottom(const float marginBottom) { m_marginBottom = marginBottom; }
00092         void setPageSpan(const int pageSpan) { m_pageSpan = pageSpan; }
00093         
00094         void makeConsistent(int startingPageNumber);
00095         
00096 protected:
00097         void _removeHeaderFooter(WPXHeaderFooterType type, WPXHeaderFooterOccurence occurence);
00098         bool _containsHeaderFooter(WPXHeaderFooterType type, WPXHeaderFooterOccurence occurence);
00099 
00100 private:
00101         bool m_isHeaderFooterSuppressed[WPX_NUM_HEADER_FOOTER_TYPES];
00102         float m_formLength, m_formWidth;
00103         WPXFormOrientation m_formOrientation;
00104         float m_marginLeft, m_marginRight;
00105         float m_marginTop, m_marginBottom;
00106         std::vector<WPXHeaderFooter> m_headerFooterList;
00107 
00108         int m_pageSpan;
00109 };
00110 
00111 bool operator==(const WPXPageSpan &, const WPXPageSpan &);
00112 #endif /* WPXPAGE_H */

Generated on Sat Aug 20 05:20:57 2022 for libwpd by doxygen 1.3.5