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 _XMLOFF_IGNORETCONTEXT_HXX
25 #define _XMLOFF_IGNORETCONTEXT_HXX
26 
27 #include "TransformerContext.hxx"
28 
29 
30 class XMLIgnoreTransformerContext : public XMLTransformerContext
31 {
32 	sal_Bool m_bIgnoreCharacters;
33 	sal_Bool m_bIgnoreElements;
34     sal_Bool m_bAllowCharactersRecursive;
35     sal_Bool m_bRecursiveUse;
36 
37 public:
38 	TYPEINFO();
39 
40 	// A contexts constructor does anything that is required if an element
41 	// starts. Namespace processing has been done already.
42 	// Note that virtual methods cannot be used inside constructors. Use
43 	// StartElement instead if this is required.
44 	XMLIgnoreTransformerContext( XMLTransformerBase& rTransformer,
45 						   const ::rtl::OUString& rQName,
46 		   				   sal_Bool bIgnoreCharacters,
47 		   				   sal_Bool bIgnoreElements	);
48 	// A contexts constructor does anything that is required if an element
49 	// starts. Namespace processing has been done already.
50 	// Note that virtual methods cannot be used inside constructors. Use
51 	// StartElement instead if this is required.
52 	XMLIgnoreTransformerContext( XMLTransformerBase& rTransformer,
53 						   const ::rtl::OUString& rQName,
54 		   				   sal_Bool bAllowCharactersRecursive );
55 
56 	// A contexts destructor does anything that is required if an element
57 	// ends. By default, nothing is done.
58 	// Note that virtual methods cannot be used inside destructors. Use
59 	// EndElement instead if this is required.
60 	virtual ~XMLIgnoreTransformerContext();
61 
62 	// Create a childs element context. By default, the import's
63 	// CreateContext method is called to create a new default context.
64 	virtual XMLTransformerContext *CreateChildContext( sal_uInt16 nPrefix,
65 								   const ::rtl::OUString& rLocalName,
66 								   const ::rtl::OUString& rQName,
67 								   const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
68 
69 	// StartElement is called after a context has been constructed and
70 	// before a elements context is parsed. It may be used for actions that
71 	// require virtual methods. The default is to do nothing.
72 	virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
73 
74 	// EndElement is called before a context will be destructed, but
75 	// after a elements context has been parsed. It may be used for actions
76 	// that require virtual methods. The default is to do nothing.
77 	virtual void EndElement();
78 
79 	// This method is called for all characters that are contained in the
80 	// current element. The default is to ignore them.
81 	virtual void Characters( const ::rtl::OUString& rChars );
82 };
83 
84 #endif	//  _XMLOFF_IGNORETCONTEXT_HXX
85 
86