00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ 00002 /* libwps 00003 * Version: MPL 2.0 / LGPLv2.1+ 00004 * 00005 * This Source Code Form is subject to the terms of the Mozilla Public 00006 * License, v. 2.0. If a copy of the MPL was not distributed with this 00007 * file, You can obtain one at http://mozilla.org/MPL/2.0/. 00008 * 00009 * Major Contributor(s): 00010 * Copyright (C) 2006, 2007 Andrew Ziem 00011 * Copyright (C) 2006 Fridrich Strba (fridrich.strba@bluewin.ch) 00012 * Copyright (C) 2003-2005 William Lachance (william.lachance@sympatico.ca) 00013 * Copyright (C) 2003 Marc Maurer (uwog@uwog.net) 00014 * 00015 * For minor contributions see the git repository. 00016 * 00017 * Alternatively, the contents of this file may be used under the terms 00018 * of the GNU Lesser General Public License Version 2.1 or later 00019 * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are 00020 * applicable instead of those above. 00021 * 00022 * For further information visit http://libwps.sourceforge.net 00023 */ 00024 00025 #ifndef WPSLISTENER_H 00026 #define WPSLISTENER_H 00027 00028 #include <librevenge/librevenge.h> 00029 00030 #include "libwps_internal.h" 00031 00032 struct WPSParagraph; 00033 struct WPSTabStop; 00034 00036 class WPSListener 00037 { 00038 public: 00039 WPSListener() {} 00040 virtual ~WPSListener() {} 00041 00042 virtual void setDocumentLanguage(int lcid)=0; 00043 00044 // ------ text data ----------- 00045 00047 virtual void insertCharacter(uint8_t character)=0; 00051 virtual void insertUnicode(uint32_t character)=0; 00053 virtual void insertUnicodeString(librevenge::RVNGString const &str)=0; 00055 00056 virtual void insertTab()=0; 00057 virtual void insertEOL(bool softBreak=false)=0; 00058 virtual void insertBreak(const uint8_t breakType)=0; 00059 00060 // ------ text format ----------- 00062 virtual void setFont(const WPSFont &font)=0; 00064 virtual WPSFont const &getFont() const=0; 00065 00066 // ------ paragraph format ----------- 00068 virtual bool isParagraphOpened() const=0; 00070 virtual void setParagraph(const WPSParagraph ¶)=0; 00072 virtual WPSParagraph const &getParagraph() const=0; 00073 00074 // ------- fields ---------------- 00076 enum FieldType { None, PageNumber, Date, Time, Title, Link, Database }; 00078 virtual void insertField(FieldType type) = 0; 00080 virtual void insertDateTimeField(char const *format)=0; 00081 }; 00082 00083 #endif 00084 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */