xref: /aoo4110/main/shell/inc/internal/basereader.hxx (revision b1cdbd2c)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef BASEREADER_HXX_INCLUDED
25 #define BASEREADER_HXX_INCLUDED
26 
27 #include "internal/global.hxx"
28 #include "internal/types.hxx"
29 #include "internal/config.hxx"
30 #include "internal/utilities.hxx"
31 #include "internal/i_xml_parser_event_handler.hxx"
32 
33 #ifndef XML_PARSER_HXX_INCLUDED
34 #include "internal/xml_parser.hxx"
35 #endif
36 #include "internal/zipfile.hxx"
37 
38 class CBaseReader : public i_xml_parser_event_handler
39 {
40 public:
41 	virtual ~CBaseReader();
42 
43 protected: // protected because its only an implementation relevant class
44 	CBaseReader( const std::string& DocumentName );
45 
46 	CBaseReader( void* stream, zlib_filefunc_def* fa );
47 
48 	virtual void start_document();
49 
50 	virtual void end_document();
51 
52 	virtual void start_element(
53 		const std::wstring& raw_name,
54 		const std::wstring& local_name,
55 		const XmlTagAttributes_t& attributes) = 0;
56 
57 	virtual void end_element(
58 		const std::wstring& raw_name, const std::wstring& local_name) = 0;
59 
60 	virtual void characters(const std::wstring& character) = 0;
61 
ignore_whitespace(const std::wstring &)62 	virtual void ignore_whitespace(const std::wstring& /*whitespaces*/){};
63 
processing_instruction(const std::wstring &,const std::wstring &)64 	virtual void processing_instruction(
65 		const std::wstring& /*target*/, const std::wstring& /*data*/){};
66 
comment(const std::wstring &)67 	virtual void comment(const std::wstring& /*comment*/){};
68 
69 	void Initialize( const std::string& /*ContentName*/);
70 
71 private:
72 	ZipFile        m_ZipFile;
73 	ZipFile::ZipContentBuffer_t m_ZipContent;
74 };
75 
76 #endif
77