Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef WPSPAGE_H
00030 #define WPSPAGE_H
00031 #include <vector>
00032 #include "libwps_internal.h"
00033
00034
00035
00036 class WPSHeaderFooter
00037 {
00038 public:
00039 WPSHeaderFooter(const WPSHeaderFooter &headerFooter);
00040 ~WPSHeaderFooter();
00041 libwps::HeaderFooterType getType() const
00042 {
00043 return m_type;
00044 }
00045 libwps::HeaderFooterOccurence getOccurence() const
00046 {
00047 return m_occurence;
00048 }
00049 uint8_t getInternalType() const
00050 {
00051 return m_internalType;
00052 }
00053
00054 private:
00055 libwps::HeaderFooterType m_type;
00056 libwps::HeaderFooterOccurence m_occurence;
00057 uint8_t m_internalType;
00058 };
00059
00060 class WPSPageSpan
00061 {
00062 public:
00063 enum HeaderFooterInternalType { HEADER_A=0, HEADER_B, FOOTER_A, FOOTER_B, NUM_HEADER_FOOTER_TYPES= FOOTER_B+1 };
00064
00065 WPSPageSpan();
00066 WPSPageSpan(const WPSPageSpan &page);
00067 virtual ~WPSPageSpan();
00068
00069 bool getHeaderFooterSuppression(const uint8_t headerFooterType) const
00070 {
00071 if (headerFooterType <= FOOTER_B) return m_isHeaderFooterSuppressed[headerFooterType];
00072 return false;
00073 }
00074 float getFormLength() const
00075 {
00076 return m_formLength;
00077 }
00078 float getFormWidth() const
00079 {
00080 return m_formWidth;
00081 }
00082 libwps::FormOrientation getFormOrientation() const
00083 {
00084 return m_formOrientation;
00085 }
00086 float getMarginLeft() const
00087 {
00088 return m_marginLeft;
00089 }
00090 float getMarginRight() const
00091 {
00092 return m_marginRight;
00093 }
00094 float getMarginTop() const
00095 {
00096 return m_marginTop;
00097 }
00098 float getMarginBottom() const
00099 {
00100 return m_marginBottom;
00101 }
00102 int getPageSpan() const
00103 {
00104 return m_pageSpan;
00105 }
00106 const std::vector<WPSHeaderFooter> & getHeaderFooterList() const
00107 {
00108 return m_headerFooterList;
00109 }
00110
00111 void setHeadFooterSuppression(const uint8_t headerFooterType, const bool suppress)
00112 {
00113 m_isHeaderFooterSuppressed[headerFooterType] = suppress;
00114 }
00115 void setFormLength(const float formLength)
00116 {
00117 m_formLength = formLength;
00118 }
00119 void setFormWidth(const float formWidth)
00120 {
00121 m_formWidth = formWidth;
00122 }
00123 void setFormOrientation(const libwps::FormOrientation formOrientation)
00124 {
00125 m_formOrientation = formOrientation;
00126 }
00127 void setMarginLeft(const float marginLeft)
00128 {
00129 m_marginLeft = marginLeft;
00130 }
00131 void setMarginRight(const float marginRight)
00132 {
00133 m_marginRight = marginRight;
00134 }
00135 void setMarginTop(const float marginTop)
00136 {
00137 m_marginTop = marginTop;
00138 }
00139 void setMarginBottom(const float marginBottom)
00140 {
00141 m_marginBottom = marginBottom;
00142 }
00143 void setPageSpan(const int pageSpan)
00144 {
00145 m_pageSpan = pageSpan;
00146 }
00147
00148 void makeConsistent(int startingPageNumber);
00149
00150 protected:
00151 void _removeHeaderFooter(libwps::HeaderFooterType type, libwps::HeaderFooterOccurence occurence);
00152
00153 private:
00154 bool m_isHeaderFooterSuppressed[NUM_HEADER_FOOTER_TYPES];
00155 float m_formLength, m_formWidth;
00156 libwps::FormOrientation m_formOrientation;
00157 float m_marginLeft, m_marginRight;
00158 float m_marginTop, m_marginBottom;
00159 std::vector<WPSHeaderFooter> m_headerFooterList;
00160
00161 int m_pageSpan;
00162 };
00163
00164 bool operator==(const WPSPageSpan &, const WPSPageSpan &);
00165 #endif
00166