WP6ParagraphGroup.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
00002 /* libwpd
00003  * Copyright (C) 2002 William Lachance (wrlach@gmail.com)
00004  * Copyright (C) 2002 Marc Maurer (uwog@uwog.net)
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser 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 WP6PARAGRAPHGROUP_H
00028 #define WP6PARAGRAPHGROUP_H
00029 
00030 #include "WP6VariableLengthGroup.h"
00031 #include "WP6FileStructure.h"
00032 #include <vector>
00033 
00034 class WP6ParagraphGroup_LineSpacingSubGroup : public WP6VariableLengthGroup_SubGroup
00035 {
00036 public:
00037         WP6ParagraphGroup_LineSpacingSubGroup(WPXInputStream *input, WPXEncryption *encryption);
00038         void parse(WP6Listener *listener, const uint8_t numPrefixIDs, uint16_t const *prefixIDs) const;
00039 
00040 private:
00041         double m_lineSpacing;
00042 };
00043 
00044 class WP6ParagraphGroup_JustificationModeSubGroup : public WP6VariableLengthGroup_SubGroup
00045 {
00046 public:
00047         WP6ParagraphGroup_JustificationModeSubGroup(WPXInputStream *input, WPXEncryption *encryption);
00048         void parse(WP6Listener *listener, const uint8_t numPrefixIDs, uint16_t const *prefixIDs) const;
00049 
00050 private:
00051         uint8_t m_justification;
00052 };
00053 
00054 class WP6ParagraphGroup_SpacingAfterParagraphSubGroup : public WP6VariableLengthGroup_SubGroup
00055 {
00056 public:
00057         WP6ParagraphGroup_SpacingAfterParagraphSubGroup(WPXInputStream *input, WPXEncryption *encryption, const uint16_t sizeNonDeletable);
00058         void parse(WP6Listener *listener, const uint8_t numPrefixIDs, uint16_t const *prefixIDs) const;
00059 
00060 private:
00061         double m_spacingAfterParagraphAbsolute;
00062         double m_spacingAfterParagraphRelative;
00063         uint16_t m_sizeNonDeletable;
00064 };
00065 
00066 class WP6ParagraphGroup_TabSetSubGroup : public WP6VariableLengthGroup_SubGroup
00067 {
00068 public:
00069         WP6ParagraphGroup_TabSetSubGroup(WPXInputStream *input, WPXEncryption *encryption);
00070         ~WP6ParagraphGroup_TabSetSubGroup();
00071         void parse(WP6Listener *listener, const uint8_t numPrefixIDs, uint16_t const *prefixIDs) const;
00072 
00073 private:
00074         bool m_isRelative;
00075         double m_tabAdjustValue;
00076         std::vector<bool> m_usePreWP9LeaderMethods;
00077         std::vector<WPXTabStop> m_tabStops;
00078 };
00079 
00080 class WP6ParagraphGroup_IndentFirstLineSubGroup : public WP6VariableLengthGroup_SubGroup
00081 {
00082 public:
00083         WP6ParagraphGroup_IndentFirstLineSubGroup(WPXInputStream *input, WPXEncryption *encryption);
00084         void parse(WP6Listener *listener, const uint8_t numPrefixIDs, uint16_t const *prefixIDs) const;
00085 
00086 private:
00087         int16_t m_firstLineOffset;
00088 };
00089 
00090 class WP6ParagraphGroup_LeftMarginAdjustmentSubGroup : public WP6VariableLengthGroup_SubGroup
00091 {
00092 public:
00093         WP6ParagraphGroup_LeftMarginAdjustmentSubGroup(WPXInputStream *input, WPXEncryption *encryption);
00094         void parse(WP6Listener *listener, const uint8_t numPrefixIDs, uint16_t const *prefixIDs) const;
00095 
00096 private:
00097         int16_t m_leftMargin;
00098 };
00099 
00100 class WP6ParagraphGroup_RightMarginAdjustmentSubGroup : public WP6VariableLengthGroup_SubGroup
00101 {
00102 public:
00103         WP6ParagraphGroup_RightMarginAdjustmentSubGroup(WPXInputStream *input, WPXEncryption *encryption);
00104         void parse(WP6Listener *listener, const uint8_t numPrefixIDs, uint16_t const *prefixIDs) const;
00105 
00106 private:
00107         int16_t m_rightMargin;
00108 };
00109 
00110 class WP6ParagraphGroup_OutlineDefineSubGroup : public WP6VariableLengthGroup_SubGroup
00111 {
00112 public:
00113         WP6ParagraphGroup_OutlineDefineSubGroup(WPXInputStream *input, WPXEncryption *encryption);
00114         void parse(WP6Listener *listener, const uint8_t numPrefixIDs, uint16_t const *prefixIDs) const;
00115 
00116 private:
00117         uint16_t m_outlineHash;
00118         uint8_t m_numberingMethods[WP6_NUM_LIST_LEVELS];
00119         uint8_t m_tabBehaviourFlag;
00120 };
00121 
00122 class WP6ParagraphGroup : public WP6VariableLengthGroup
00123 {
00124 public:
00125         WP6ParagraphGroup(WPXInputStream *input, WPXEncryption *encryption);
00126         ~WP6ParagraphGroup();
00127         void _readContents(WPXInputStream *input, WPXEncryption *encryption);
00128         void parse(WP6Listener *listener);
00129 private:
00130         WP6ParagraphGroup(const WP6ParagraphGroup &);
00131         WP6ParagraphGroup &operator=(const WP6ParagraphGroup &);
00132         WP6VariableLengthGroup_SubGroup *m_subGroupData;
00133 };
00134 
00135 #endif /* WP6PARAGRAPHGROUP_H */
00136 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */