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

WP3ContentListener.h

Go to the documentation of this file.
00001 /* libwpd
00002  * Copyright (C) 2004 Marc Maurer (uwog@uwog.net)
00003  * Copyright (C) 2005-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
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 #ifndef WP3CONTENTLISTENER_H
00027 #define WP3CONTENTLISTENER_H
00028 
00029 #include "WP3Listener.h"
00030 #include "WPXContentListener.h"
00031 #include "WP3SubDocument.h"
00032 
00033 typedef struct _WP3ContentParsingState WP3ContentParsingState;
00034 struct _WP3ContentParsingState
00035 {
00036         _WP3ContentParsingState();
00037         ~_WP3ContentParsingState();
00038         uint16_t m_colSpan;
00039         uint16_t m_rowSpan;
00040         WPXString m_textBuffer;
00041         RGBSColor * m_cellFillColor;
00042         WPXString m_noteReference;
00043 
00044         WPXTableList m_tableList;
00045 private:
00046         _WP3ContentParsingState(const _WP3ContentParsingState&);
00047         _WP3ContentParsingState& operator=(const _WP3ContentParsingState&);
00048 };
00049 
00050 class WP3ContentListener : public WP3Listener, protected WPXContentListener
00051 {
00052 public:
00053         WP3ContentListener(std::list<WPXPageSpan> &pageList, std::vector<WP3SubDocument *> &subDocuments, WPXHLListenerImpl *listenerImpl);
00054         ~WP3ContentListener();
00055 
00056         void startDocument() { WPXContentListener::startDocument(); };
00057         void insertCharacter(const uint16_t character);
00058         void insertTab();
00059         void insertTab(const uint8_t tabType, const float tabPosition);
00060         void insertBreak(const uint8_t breakType) { WPXContentListener::insertBreak(breakType); };
00061         void insertEOL();
00062         void attributeChange(const bool isOn, const uint8_t attribute);
00063         void lineSpacingChange(const float lineSpacing) { WPXContentListener::lineSpacingChange(lineSpacing); };
00064         void pageMarginChange(const uint8_t /* side */, const uint16_t /* margin */) {};
00065         void pageFormChange(const uint16_t /* length */, const uint16_t /* width */, const WPXFormOrientation /* orientation */) {};
00066         void marginChange(const uint8_t side, const uint16_t margin);
00067         void indentFirstLineChange(const int16_t offset);
00068         void setTabs(const bool isRelative, const std::vector<WPXTabStop> tabStops);
00069         void columnChange(const WPXTextColumnType columnType, const uint8_t numColumns, const std::vector<float> &columnWidth,
00070                                         const std::vector<bool> &isFixedWidth);
00071         void endDocument() { WPXContentListener::endDocument(); };
00072 
00073         void defineTable(const uint8_t position, const uint16_t leftOffset);
00074         void addTableColumnDefinition(const uint32_t width, const uint32_t leftGutter, const uint32_t rightGutter,
00075                                         const uint32_t attributes, const uint8_t alignment);
00076         void startTable();
00077         void insertRow();
00078         void insertCell();
00079         void closeCell();
00080         void closeRow();
00081         void setTableCellSpan(const uint16_t colSpan, const uint16_t rowSpan);
00082         void setTableCellFillColor(const RGBSColor * cellFillColor);
00083         void endTable();
00084         void undoChange(const uint8_t undoType, const uint16_t undoLevel);
00085         void justificationChange(const uint8_t justification);
00086         void setTextColor(const RGBSColor * fontColor);
00087         void setTextFont(const WPXString &fontName);
00088         void setFontSize(const uint16_t fontSize);
00089         void insertPageNumber(const WPXString &pageNumber);
00090         void insertNoteReference(const WPXString &noteReference);
00091         void insertNote(const WPXNoteType noteType, WP3SubDocument *subDocument);
00092         void headerFooterGroup(const uint8_t headerFooterType, const uint8_t occurenceBits, WP3SubDocument *subDocument);
00093         void suppressPage(const uint16_t /* suppressCode */) {};
00094         void backTab();
00095         void leftIndent();
00096         void leftIndent(const float offset);
00097         void leftRightIndent();
00098         void leftRightIndent(const float offset);
00099         
00100 protected:
00101         void _handleSubDocument(const WPXSubDocument *subDocument, const bool isHeaderFooter, WPXTableList tableList, int nextTableIndice = 0);
00102         void _openParagraph();
00103 
00104         void _flushText();
00105         void _changeList() {};
00106 
00107 private:
00108         WP3ContentListener(const WP3ContentListener&);
00109         WP3ContentListener& operator=(const WP3ContentListener&);
00110         WP3ContentParsingState *m_parseState;
00111         std::vector<WP3SubDocument *> &m_subDocuments;
00112 };
00113 
00114 #endif /* WP3CONTENTLISTENER_H */

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