xref: /AOO41X/main/xmloff/source/transform/MetaTContext.hxx (revision ecfe53c5d1886e1e0d215b0d140d05282ab1c477)
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_METATCONTEXT_HXX
25 #define _XMLOFF_METATCONTEXT_HXX
26 
27 #include <rtl/ref.hxx>
28 #include "xmloff/functional.hxx"
29 
30 #include <map>
31 
32 #ifndef _XMLOFF_FLATTRCONTEXT_HXX
33 #include "FlatTContext.hxx"
34 #endif
35 
36 typedef ::std::multimap< ::rtl::OUString,
37                     ::rtl::Reference< XMLPersTextContentTContext >,
38                     less_functor > XMLMetaContexts_Impl;
39 
40 
41 class XMLMetaTransformerContext : public XMLTransformerContext
42 {
43     XMLMetaContexts_Impl m_aContexts;
44 
45 public:
46     TYPEINFO();
47 
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     XMLMetaTransformerContext( XMLTransformerBase& rTransformer,
53                            const ::rtl::OUString& rQName );
54 
55     // A contexts destructor does anything that is required if an element
56     // ends. By default, nothing is done.
57     // Note that virtual methods cannot be used inside destructors. Use
58     // EndElement instead if this is required.
59     virtual ~XMLMetaTransformerContext();
60 
61     // Create a childs element context. By default, the import's
62     // CreateContext method is called to create a new default context.
63     virtual XMLTransformerContext *CreateChildContext( sal_uInt16 nPrefix,
64                                    const ::rtl::OUString& rLocalName,
65                                    const ::rtl::OUString& rQName,
66                                    const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
67 
68     // EndElement is called before a context will be destructed, but
69     // after a elements context has been parsed. It may be used for actions
70     // that require virtual methods. The default is to do nothing.
71     virtual void EndElement();
72 
73     // This method is called for all characters that are contained in the
74     // current element. The default is to ignore them.
75     virtual void Characters( const ::rtl::OUString& rChars );
76 };
77 
78 #endif  //  _XMLOFF_METATCONTEXT_HXX
79 
80