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

WPXPageSpan.h

Go to the documentation of this file.
00001 /* libwpd
00002  * Copyright (C) 2002 William Lachance (william.lachance@sympatico.ca)
00003  * Copyright (C) 2002 Marc Maurer (j.m.maurer@student.utwente.nl)
00004  *  
00005  * This library is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU Library General Public
00007  * License as published by the Free Software Foundation; either
00008  * version 2 of the License, or (at your option) any later version.
00009  *
00010  * This library is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * Library General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU Library General Public
00016  * License along with this library; if not, write to the Free Software
00017  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00018  *
00019  * For further information visit http://libwpd.sourceforge.net
00020  */
00021 
00022 /* "This product is not manufactured, approved, or supported by 
00023  * Corel Corporation or Corel Corporation Limited."
00024  */
00025 
00026 #ifndef WPXPAGE_H
00027 #define WPXPAGE_H
00028 #include "libwpd.h"
00029 #include "WP6FileStructure.h"
00030 #include <vector>
00031 #include "WPXTable.h"
00032 #include "libwpd_internal.h"
00033 
00034 // intermediate page representation class: for internal use only (by the high-level content/styles listeners). should not be exported.
00035 
00036 class WPXHeaderFooter
00037 {
00038 public:
00039         WPXHeaderFooter(const WPXHeaderFooterType headerFooterType, const WPXHeaderFooterOccurence occurence, 
00040                         const uint8_t internalType, const uint16_t textPID, WPXTableList tableList);
00041         WPXHeaderFooter(const WPXHeaderFooterType headerFooterType, const WPXHeaderFooterOccurence occurence, 
00042                         const uint8_t internalType, const uint16_t textPID);
00043         WPXHeaderFooter(const WPXHeaderFooter &headerFooter);
00044         ~WPXHeaderFooter();
00045         const WPXHeaderFooterType getType() const { return m_type; }
00046         const WPXHeaderFooterOccurence getOccurence() const { return m_occurence; }
00047         const uint8_t getInternalType() const { return m_internalType; }
00048         const uint16_t getTextPID() const { return m_textPID; }
00049         WPXTableList getTableList() const { return m_tableList; }
00050 
00051 private:
00052         WPXHeaderFooterType m_type;
00053         WPXHeaderFooterOccurence m_occurence;
00054         uint8_t m_internalType; // for suppression
00055         uint16_t m_textPID; // for the actual text
00056         WPXTableList m_tableList;
00057 };
00058 
00059 class WPXPageSpan
00060 {
00061 public:
00062         WPXPageSpan();
00063         WPXPageSpan(WPXPageSpan &page, float paragraphMarginLeft=0.0f, float paragraphMarginRight=0.0f);
00064         virtual ~WPXPageSpan();
00065 
00066         const bool getHeaderFooterSuppression(const uint8_t headerFooterType) const { if (headerFooterType <= WP6_HEADER_FOOTER_GROUP_FOOTER_B) return m_isHeaderFooterSuppressed[headerFooterType]; return false; }
00067         const float getFormLength() const { return m_formLength; }
00068         const float getFormWidth() const { return m_formWidth; }
00069         const WPXFormOrientation getFormOrientation() const { return m_formOrientation; }
00070         const float getMarginLeft() const { return m_marginLeft; }
00071         const float getMarginRight() const { return m_marginRight; }
00072         const float getMarginTop() const { return m_marginTop; }
00073         const float getMarginBottom() const { return m_marginBottom; }
00074         const int getPageSpan() const { return m_pageSpan; }
00075         const std::vector<WPXHeaderFooter> & getHeaderFooterList() const { return m_headerFooterList; }
00076 
00077         void setHeaderFooter(const uint8_t headerFooterType, const uint8_t occurenceBits, 
00078                              const uint16_t textPID, WPXTableList tableList);
00079         void setHeadFooterSuppression(const uint8_t headerFooterType, const bool suppress) { m_isHeaderFooterSuppressed[headerFooterType] = suppress; }
00080         void setFormLength(const float formLength) { m_formLength = formLength; }
00081         void setFormWidth(const float formWidth) { m_formWidth = formWidth; }
00082         void setFormOrientation(const WPXFormOrientation formOrientation) { m_formOrientation = formOrientation; }
00083         void setMarginLeft(const float marginLeft) { m_marginLeft = marginLeft; }
00084         void setMarginRight(const float marginRight) { m_marginRight = marginRight; }
00085         void setMarginTop(const float marginTop) { m_marginTop = marginTop; }
00086         void setMarginBottom(const float marginBottom) { m_marginBottom = marginBottom; }
00087         void setPageSpan(const int pageSpan) { m_pageSpan = pageSpan; }
00088 
00089         void makeConsistent(int startingPageNumber);
00090 protected:
00091         void _removeHeaderFooter(WPXHeaderFooterType type, WPXHeaderFooterOccurence occurence);
00092         bool _containsHeaderFooter(WPXHeaderFooterType type, WPXHeaderFooterOccurence occurence);
00093 
00094 private:
00095         bool m_isHeaderFooterSuppressed[WP6_NUM_HEADER_FOOTER_TYPES];
00096         float m_formLength, m_formWidth;
00097         WPXFormOrientation m_formOrientation;
00098         float m_marginLeft, m_marginRight;
00099         float m_marginTop, m_marginBottom;
00100         std::vector<WPXHeaderFooter> m_headerFooterList;
00101 
00102         int m_pageSpan;
00103 };
00104 
00105 bool operator==(const WPXPageSpan &, const WPXPageSpan &);
00106 #endif /* WPXPAGE_H */

Generated on Wed Aug 3 18:22:28 2005 for libwpd by doxygen 1.4.3-20050530