xref: /aoo41x/main/shell/inc/internal/basereader.hxx (revision cdf0e10c)
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 BASEREADER_HXX_INCLUDED
29 #define BASEREADER_HXX_INCLUDED
30 
31 #include "internal/global.hxx"
32 #include "internal/types.hxx"
33 #include "internal/config.hxx"
34 #include "internal/utilities.hxx"
35 #include "internal/i_xml_parser_event_handler.hxx"
36 
37 #ifndef XML_PARSER_HXX_INCLUDED
38 #include "internal/xml_parser.hxx"
39 #endif
40 #include "internal/zipfile.hxx"
41 
42 class CBaseReader : public i_xml_parser_event_handler
43 {
44 public:
45 	virtual ~CBaseReader();
46 
47 protected: // protected because its only an implementation relevant class
48 	CBaseReader( const std::string& DocumentName );
49 
50 	CBaseReader( void* stream, zlib_filefunc_def* fa );
51 
52 	virtual void start_document();
53 
54 	virtual void end_document();
55 
56 	virtual void start_element(
57 		const std::wstring& raw_name,
58 		const std::wstring& local_name,
59 		const XmlTagAttributes_t& attributes) = 0;
60 
61 	virtual void end_element(
62 		const std::wstring& raw_name, const std::wstring& local_name) = 0;
63 
64 	virtual void characters(const std::wstring& character) = 0;
65 
66 	virtual void ignore_whitespace(const std::wstring& /*whitespaces*/){};
67 
68 	virtual void processing_instruction(
69 		const std::wstring& /*target*/, const std::wstring& /*data*/){};
70 
71 	virtual void comment(const std::wstring& /*comment*/){};
72 
73 	void Initialize( const std::string& /*ContentName*/);
74 
75 private:
76 	ZipFile        m_ZipFile;
77 	ZipFile::ZipContentBuffer_t m_ZipContent;
78 };
79 
80 #endif
81