libwpd: WP6StylesListener.h Source File documentation

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

# WP6StylesListener.h

Go to the documentation of this file.

    00001 /* libwpd
    00002  * Copyright (C) 2003 William Lachance (william.lachance@sympatico.ca)
    00003  * Copyright (C) 2003 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., 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 <vector>
    00034 #include <set>
    00035 #include "WPXPageSpan.h"
    00036 #include "WPXTable.h"
    00037
    00038 class WPXSubDocument;
    00039
    00040 class WP6StylesListener : public WP6Listener
    00041 {
    00042 public:
    00043         WP6StylesListener(std::vector<WPXPageSpan *> *pageList, WPXTableList tableList);
    00044
    00045         virtual void setDate(const uint16_t year, const uint8_t month, const uint8_t day,
    00046                              const uint8_t hour, const uint8_t minute, const uint8_t second,
    00047                              const uint8_t dayOfWeek, const uint8_t timeZone, const uint8_t unused) {}
    00048         virtual void setExtendedInformation(const uint16_t type, const WPXString &data) {}
    00049         virtual void startDocument() {}
    00050         virtual void setAlignmentCharacter(const uint16_t character) {}
    00051         virtual void setLeaderCharacter(const uint16_t character, const uint8_t numberOfSpaces) {}
    00052         virtual void defineTabStops(const bool isRelative, const std::vector<WPXTabStop> &tabStops,
    00053                                     const std::vector<bool> &usePreWP9LeaderMethods) {}
    00054         virtual void insertCharacter(const uint16_t character) { if (!isUndoOn()) m_currentPageHasContent = true; }
    00055         virtual void insertTab(const uint8_t tabType, const float tabPosition) { if (!isUndoOn()) m_currentPageHasContent = true; }
    00056         virtual void handleLineBreak()  { if (!isUndoOn()) m_currentPageHasContent = true; }
    00057         virtual void insertEOL() { if (!isUndoOn()) m_currentPageHasContent = true; }
    00058         virtual void insertBreak(const uint8_t breakType);
    00059         virtual void characterColorChange(const uint8_t red, const uint8_t green, const uint8_t blue) {}
    00060         virtual void characterShadingChange(const uint8_t shading) {}
    00061         virtual void highlightChange(const bool isOn, const RGBSColor color) {}
    00062         virtual void fontChange(const uint16_t matchedFontPointSize, const uint16_t fontPID) {}
    00063         virtual void attributeChange(const bool isOn, const uint8_t attribute) {}
    00064         virtual void lineSpacingChange(const float lineSpacing) {}
    00065         virtual void spacingAfterParagraphChange(const float spacingRelative, const float spacingAbsolute) {}
    00066         virtual void justificationChange(const uint8_t justification) {}
    00067         virtual void pageMarginChange(const uint8_t side, const uint16_t margin);
    00068         virtual void pageFormChange(const uint16_t length, const uint16_t width, const WPXFormOrientation orientation, const bool isPersistent);
    00069         virtual void marginChange(const uint8_t side, const uint16_t margin);
    00070         virtual void paragraphMarginChange(const uint8_t side, const int16_t margin) {}
    00071         virtual void indentFirstLineChange(const int16_t offset) {}
    00072         virtual void columnChange(const WPXTextColumnType columnType, const uint8_t numColumns, const std::vector<float> &columnWidth,
    00073                                   const std::vector<bool> &isFixedWidth) {}
    00074         virtual void updateOutlineDefinition(const WP6OutlineLocation outlineLocation, const uint16_t outlineHash,
    00075                                              const uint8_t *numberingMethods, const uint8_t tabBehaviourFlag) {}
    00076
    00077         virtual void paragraphNumberOn(const uint16_t outlineHash, const uint8_t level, const uint8_t flag) {}
    00078         virtual void paragraphNumberOff() { if (!isUndoOn()) m_currentPageHasContent = true; }
    00079         virtual void displayNumberReferenceGroupOn(const uint8_t subGroup, const uint8_t level) {}
    00080         virtual void displayNumberReferenceGroupOff(const uint8_t subGroup) { if (!isUndoOn()) m_currentPageHasContent = true; }
    00081         void styleGroupOn(const uint8_t subGroup) {}
    00082         virtual void styleGroupOff(const uint8_t subGroup) {}
    00083         virtual void globalOn(const uint8_t systemStyle) {}
    00084         virtual void globalOff() {}
    00085         virtual void noteOn(const uint16_t textPID);
    00086         virtual void noteOff(const WPXNoteType noteType) {}
    00087         virtual void headerFooterGroup(const uint8_t headerFooterType, const uint8_t occurenceBits, const uint16_t textPID);
    00088         virtual void suppressPageCharacteristics(const uint8_t suppressCode);
    00089         virtual void endDocument();
    00090
    00091         virtual void defineTable(const uint8_t position, const uint16_t leftOffset);
    00092         virtual void addTableColumnDefinition(const uint32_t width, const uint32_t leftGutter, const uint32_t rightGutter,
    00093                                 const uint32_t attributes, const uint8_t alignment) {}
    00094         virtual void startTable();
    00095         virtual void insertRow(const uint16_t rowHeight, const bool isMinimumHeight, const bool isHeaderRow);
    00096         virtual void insertCell(const uint8_t colSpan, const uint8_t rowSpan, const uint8_t borderBits,
    00097                                 const RGBSColor * cellFgColor, const RGBSColor * cellBgColor,
    00098                                 const RGBSColor * cellBorderColor, const WPXVerticalAlignment cellVerticalAlignment,
    00099                                 const bool useCellAttributes, const uint32_t cellAttributes);
    00100         virtual void endTable();
    00101
    00102 protected:
    00103         virtual void _handleSubDocument(const WPXSubDocument *subDocument, const bool isHeaderFooter, WPXTableList tableList, int nextTableIndice = 0);
    00104
    00105         virtual void _flushText() {}
    00106         virtual void _openParagraph() {}
    00107         virtual void _openPageSpan() { /* FIXME: REMOVE ME WHEN IMPLEMENTED IN WPXListener */ };
    00108         virtual void _changeList() {}
    00109
    00110 private:
    00111         WPXPageSpan *m_currentPage;
    00112
    00113         WPXTableList m_tableList;
    00114         WPXTable *m_currentTable;
    00115         float m_tempMarginLeft, m_tempMarginRight;
    00116         bool m_currentPageHasContent;
    00117         bool m_isTableDefined;
    00118         std::set <const WPXSubDocument *> m_subDocuments;
    00119 };
    00120
    00121 #endif /* WP6STYLESLISTENER_H */