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 #ifndef WPSPAGE_H
00029 #define WPSPAGE_H
00030 #include "WPSFileStructure.h"
00031 #include <vector>
00032 #include "libwps_internal.h"
00033
00034
00035
00036 class WPSHeaderFooter
00037 {
00038 public:
00039 WPSHeaderFooter(const WPSHeaderFooterType headerFooterType, const WPSHeaderFooterOccurence occurence,
00040 const uint8_t internalType);
00041 WPSHeaderFooter(const WPSHeaderFooter &headerFooter);
00042 ~WPSHeaderFooter();
00043 const WPSHeaderFooterType getType() const { return m_type; }
00044 const WPSHeaderFooterOccurence getOccurence() const { return m_occurence; }
00045 const uint8_t getInternalType() const { return m_internalType; }
00046
00047 private:
00048 WPSHeaderFooterType m_type;
00049 WPSHeaderFooterOccurence m_occurence;
00050 uint8_t m_internalType;
00051 };
00052
00053 class WPSPageSpan
00054 {
00055 public:
00056 WPSPageSpan();
00057 WPSPageSpan(const WPSPageSpan &page, float paragraphMarginLeft, float paragraphMarginRight);
00058 WPSPageSpan(const WPSPageSpan &page);
00059 virtual ~WPSPageSpan();
00060
00061 const bool getHeaderFooterSuppression(const uint8_t headerFooterType) const { if (headerFooterType <= WPS_FOOTER_B) return m_isHeaderFooterSuppressed[headerFooterType]; return false; }
00062 const float getFormLength() const { return m_formLength; }
00063 const float getFormWidth() const { return m_formWidth; }
00064 const WPSFormOrientation getFormOrientation() const { return m_formOrientation; }
00065 const float getMarginLeft() const { return m_marginLeft; }
00066 const float getMarginRight() const { return m_marginRight; }
00067 const float getMarginTop() const { return m_marginTop; }
00068 const float getMarginBottom() const { return m_marginBottom; }
00069 const int getPageSpan() const { return m_pageSpan; }
00070 const std::vector<WPSHeaderFooter> & getHeaderFooterList() const { return m_headerFooterList; }
00071
00072 void setHeaderFooter(const WPSHeaderFooterType type, const uint8_t headerFooterType, const WPSHeaderFooterOccurence occurence);
00073 void setHeadFooterSuppression(const uint8_t headerFooterType, const bool suppress) { m_isHeaderFooterSuppressed[headerFooterType] = suppress; }
00074 void setFormLength(const float formLength) { m_formLength = formLength; }
00075 void setFormWidth(const float formWidth) { m_formWidth = formWidth; }
00076 void setFormOrientation(const WPSFormOrientation formOrientation) { m_formOrientation = formOrientation; }
00077 void setMarginLeft(const float marginLeft) { m_marginLeft = marginLeft; }
00078 void setMarginRight(const float marginRight) { m_marginRight = marginRight; }
00079 void setMarginTop(const float marginTop) { m_marginTop = marginTop; }
00080 void setMarginBottom(const float marginBottom) { m_marginBottom = marginBottom; }
00081 void setPageSpan(const int pageSpan) { m_pageSpan = pageSpan; }
00082
00083 void makeConsistent(int startingPageNumber);
00084
00085 protected:
00086 void _removeHeaderFooter(WPSHeaderFooterType type, WPSHeaderFooterOccurence occurence);
00087 bool _containsHeaderFooter(WPSHeaderFooterType type, WPSHeaderFooterOccurence occurence);
00088
00089 private:
00090 bool m_isHeaderFooterSuppressed[WPS_NUM_HEADER_FOOTER_TYPES];
00091 float m_formLength, m_formWidth;
00092 WPSFormOrientation m_formOrientation;
00093 float m_marginLeft, m_marginRight;
00094 float m_marginTop, m_marginBottom;
00095 std::vector<WPSHeaderFooter> m_headerFooterList;
00096
00097 int m_pageSpan;
00098 };
00099
00100 bool operator==(const WPSPageSpan &, const WPSPageSpan &);
00101 #endif