libwps: WPSPageSpan.h Source File documentation

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

# WPSPageSpan.h

Go to the documentation of this file.

    00001 /* libwps
    00002  * Copyright (C) 2002 William Lachance (william.lachance@sympatico.ca)
    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://libwps.sourceforge.net
    00021  */
    00022
    00023 /*
    00024  * This file is in sync with CVS
    00025  * /libwpd2/src/lib/WPXPageSpan.h 1.21
    00026  */
    00027
    00028 #ifndef WPSPAGE_H
    00029 #define WPSPAGE_H
    00030 #include "WPSFileStructure.h"
    00031 #include <vector>
    00032 #include "libwps_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 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; // for suppression
    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 /* WPSPAGE_H */