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

WP6StylesListener.h

Go to the documentation of this file.
00001 /* libwpd
00002  * Copyright (C) 2003 William Lachance (wrlach@gmail.com)
00003  * Copyright (C) 2003 Marc Maurer (uwog@uwog.net)
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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, 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 // WP6StylesListener: creates an intermediate table representation, given a
00027 // sequence of messages passed to it by the parser.
00028 
00029 #ifndef WP6STYLESLISTENER_H
00030 #define WP6STYLESLISTENER_H
00031 
00032 #include "WP6Listener.h"
00033 #include "WPXStylesListener.h"
00034 #include <vector>
00035 #include <set>
00036 #include <list>
00037 #include "WPXPageSpan.h"
00038 #include "WPXTable.h"
00039 
00040 class WPXSubDocument;
00041 
00042 class WP6StylesListener : public WP6Listener, protected WPXStylesListener
00043 {
00044 public:
00045         WP6StylesListener(std::list<WPXPageSpan> &pageList, WPXTableList tableList);
00046 
00047         void setDate(const uint16_t /* type */, const uint16_t /* year */, 
00048                      const uint8_t /* month */, const uint8_t /* day */, 
00049                      const uint8_t /* hour */, const uint8_t /* minute */, 
00050                      const uint8_t /* second */, const uint8_t /* dayOfWeek */, 
00051                      const uint8_t /* timeZone */, const uint8_t /* unused */) {}
00052         void setExtendedInformation(const uint16_t /* type */, const WPXString & /* data */) {}
00053         void startDocument() {}
00054         void setAlignmentCharacter(const uint16_t /* character */) {}
00055         void setLeaderCharacter(const uint16_t /* character */, const uint8_t /* numberOfSpaces */) {}
00056         void defineTabStops(const bool /* isRelative */, const std::vector<WPXTabStop> & /* tabStops */, 
00057                                     const std::vector<bool> & /* usePreWP9LeaderMethods */) {}
00058         void insertCharacter(const uint16_t /* character */) { if (!isUndoOn()) m_currentPageHasContent = true; }
00059         void insertTab(const uint8_t /* tabType */, float /* tabPosition */) { if (!isUndoOn()) m_currentPageHasContent = true; }
00060         void handleLineBreak()  { if (!isUndoOn()) m_currentPageHasContent = true; }
00061         void insertEOL() { if (!isUndoOn()) m_currentPageHasContent = true; }
00062         void insertBreak(const uint8_t breakType);
00063         void characterColorChange(const uint8_t /* red */, const uint8_t /* green */, const uint8_t /* blue */) {}
00064         void characterShadingChange(const uint8_t /* shading */) {}
00065         void highlightChange(const bool /* isOn */, const RGBSColor /* color */) {}
00066         void fontChange(const uint16_t /* matchedFontPointSize */, const uint16_t /* fontPID */) {}
00067         void attributeChange(const bool /* isOn */, const uint8_t /* attribute */) {}
00068         void lineSpacingChange(const float /* lineSpacing */) {}
00069         void spacingAfterParagraphChange(const float /* spacingRelative */, const float /* spacingAbsolute */) {}
00070         void justificationChange(const uint8_t /* justification */) {}
00071         void pageMarginChange(const uint8_t side, const uint16_t margin);
00072         void pageFormChange(const uint16_t length, const uint16_t width, const WPXFormOrientation orientation);
00073         void marginChange(const uint8_t side, const uint16_t margin);
00074         void paragraphMarginChange(const uint8_t /* side */, const int16_t /* margin */) {}
00075         void indentFirstLineChange(const int16_t /* offset */) {}
00076         void columnChange(const WPXTextColumnType /* columnType */, const uint8_t /* numColumns */,
00077                                 const std::vector<float> & /* columnWidth */, const std::vector<bool> & /* isFixedWidth */) {}
00078         void updateOutlineDefinition(const WP6OutlineLocation /* outlineLocation */, const uint16_t /* outlineHash */,
00079                                              const uint8_t * /* numberingMethods */, const uint8_t /* tabBehaviourFlag */) {}
00080 
00081         void paragraphNumberOn(const uint16_t /* outlineHash */, const uint8_t /* level */, const uint8_t /* flag */) {}
00082         void paragraphNumberOff() { if (!isUndoOn()) m_currentPageHasContent = true; }
00083         void displayNumberReferenceGroupOn(const uint8_t /* subGroup */, const uint8_t /* level */) {}
00084         void displayNumberReferenceGroupOff(const uint8_t /* subGroup */) { if (!isUndoOn()) m_currentPageHasContent = true; }
00085         void styleGroupOn(const uint8_t /* subGroup */) {}
00086         void styleGroupOff(const uint8_t /* subGroup */) {}
00087         void globalOn(const uint8_t /* systemStyle */) {}
00088         void globalOff() {}
00089         void noteOn(const uint16_t textPID);
00090         void noteOff(const WPXNoteType /* noteType */) {}
00091         void headerFooterGroup(const uint8_t headerFooterType, const uint8_t occurenceBits, const uint16_t textPID);
00092         void suppressPageCharacteristics(const uint8_t suppressCode);
00093         void endDocument();
00094 
00095         void defineTable(const uint8_t position, const uint16_t leftOffset);
00096         void addTableColumnDefinition(const uint32_t /* width */, const uint32_t /* leftGutter */, const uint32_t /* rightGutter */,
00097                                 const uint32_t /* attributes */, const uint8_t /* alignment */) {}
00098         void startTable();
00099         void insertRow(const uint16_t rowHeight, const bool isMinimumHeight, const bool isHeaderRow);
00100         void insertCell(const uint8_t colSpan, const uint8_t rowSpan, const uint8_t borderBits, 
00101                                 const RGBSColor * cellFgColor, const RGBSColor * cellBgColor,
00102                                 const RGBSColor * cellBorderColor, const WPXVerticalAlignment cellVerticalAlignment, 
00103                                 const bool useCellAttributes, const uint32_t cellAttributes);
00104         void endTable();
00105 
00106         void undoChange(const uint8_t undoType, const uint16_t undoLevel);
00107 
00108 protected:
00109         void _handleSubDocument(const WPXSubDocument *subDocument, const bool isHeaderFooter, WPXTableList tableList, int nextTableIndice = 0);
00110 
00111         void _flushText() {}
00112         void _changeList() {}
00113 
00114 private:
00115         WP6StylesListener(const WP6StylesListener&);
00116         WP6StylesListener& operator=(const WP6StylesListener&);
00117         WPXPageSpan m_currentPage;
00118 
00119         WPXTableList m_tableList;
00120         WPXTable * m_currentTable;
00121         float m_tempMarginLeft, m_tempMarginRight;
00122         bool m_currentPageHasContent;
00123         bool m_isTableDefined;
00124         bool m_isSubDocument;
00125         std::set <const WPXSubDocument *> m_subDocuments;
00126         std::list<WPXPageSpan>::iterator m_pageListHardPageMark;
00127 };
00128 
00129 #endif /* WP6STYLESLISTENER_H */

Generated on Sat Aug 20 05:20:57 2022 for libwpd by doxygen 1.3.5