merge the formfield patch from ooo-build
[ooovba.git] / shell / qa / i_xml_parser_event_handler.hxx
blobe6a0de16a1fb4c4d9202e53ec8bdb36e218bf49a
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: i_xml_parser_event_handler.hxx,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _I_XML_PARSER_EVENT_HANDLER_HXX_
32 #define _I_XML_PARSER_EVENT_HANDLER_HXX_
34 #include <string>
35 #include <map>
36 #include <utility>
38 #if defined(XML_UNICODE) || defined(XML_UNICODE_WCHAR_T)
39 typedef std::wstring string_t;
40 #else
41 typedef std::string string_t;
42 #endif
44 // name-value container
45 typedef std::map<string_t, string_t> xml_tag_attribute_container_t;
48 //#########################################
49 class i_xml_parser_event_handler
51 public:
52 virtual ~i_xml_parser_event_handler() {};
54 virtual void start_document() = 0;
56 virtual void end_document() = 0;
58 virtual void start_element(
59 const string_t& raw_name,
60 const string_t& local_name,
61 const xml_tag_attribute_container_t& attributes) = 0;
63 virtual void end_element(
64 const string_t& raw_name,
65 const string_t& local_name) = 0;
67 virtual void characters(
68 const string_t& character) = 0;
70 virtual void ignore_whitespace(
71 const string_t& whitespaces) = 0;
73 virtual void processing_instruction(
74 const string_t& target, const string_t& data) = 0;
76 virtual void comment(const string_t& comment) = 0;
79 #endif