1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 #ifndef I_XML_PARSER_EVENT_HANDLER_HXX_INCLUDED 29 #define I_XML_PARSER_EVENT_HANDLER_HXX_INCLUDED 30 31 #include <string> 32 #include <map> 33 34 #if defined(XML_UNICODE) || defined(XML_UNICODE_WCHAR_T) 35 typedef std::wstring string_t; 36 typedef wchar_t char_t; 37 #else 38 typedef std::string string_t; 39 typedef char char_t; 40 #endif 41 42 // name-value container 43 typedef std::map<string_t, string_t> xml_tag_attribute_container_t; 44 45 46 //######################################### 47 class i_xml_parser_event_handler 48 { 49 public: 50 virtual ~i_xml_parser_event_handler() {}; 51 52 virtual void start_document() = 0; 53 54 virtual void end_document() = 0; 55 56 virtual void start_element( 57 const string_t& raw_name, 58 const string_t& local_name, 59 const xml_tag_attribute_container_t& attributes) = 0; 60 61 virtual void end_element( 62 const string_t& raw_name, 63 const string_t& local_name) = 0; 64 65 virtual void characters( 66 const string_t& character) = 0; 67 68 virtual void ignore_whitespace( 69 const string_t& whitespaces) = 0; 70 71 virtual void processing_instruction( 72 const string_t& target, const string_t& data) = 0; 73 74 virtual void comment(const string_t& comment) = 0; 75 }; 76 77 #endif 78 79