xref: /AOO41X/main/xmloff/source/transform/DeepTContext.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_DEEPTCONTEXT_HXX
25 #define _XMLOFF_DEEPTCONTEXT_HXX
26 
27 #include <rtl/ref.hxx>
28 
29 #include <vector>
30 #include "PersAttrListTContext.hxx"
31 #include "TContextVector.hxx"
32 
33 class XMLPersElemContentTContext : public XMLPersAttrListTContext
34 {
35     XMLTransformerContextVector m_aChildContexts;
36 
37 public:
38     TYPEINFO();
39 
40     // element content persistence only
41     XMLPersElemContentTContext( XMLTransformerBase& rTransformer,
42                            const ::rtl::OUString& rQName );
43 
44     // element content persistence + attribute processing
45     XMLPersElemContentTContext( XMLTransformerBase& rTransformer,
46                            const ::rtl::OUString& rQName,
47                            sal_uInt16 nActionMap );
48 
49     // element content persistence + renaming
50     XMLPersElemContentTContext( XMLTransformerBase& rTransformer,
51                            const ::rtl::OUString& rQName,
52                            sal_uInt16 nPrefix,
53                            ::xmloff::token::XMLTokenEnum eToken );
54 
55     // element content persistence + renaming + attribute processing
56     XMLPersElemContentTContext( XMLTransformerBase& rTransformer,
57                            const ::rtl::OUString& rQName,
58                            sal_uInt16 nPrefix,
59                            ::xmloff::token::XMLTokenEnum eToken,
60                            sal_uInt16 nActionMap );
61 
62     virtual ~XMLPersElemContentTContext();
63 
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     void AddContent( XMLTransformerContext *pContent );
70 
HasElementContent() const71     sal_Bool HasElementContent() const
72     {
73         return static_cast<sal_Bool>( !m_aChildContexts.empty() );
74     }
75 
76     virtual void ExportContent();
77 };
78 
79 #endif  //  _XMLOFF_DEEPTCONTEXT_HXX
80 
81