xref: /aoo42x/main/xmloff/source/chart/contexts.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 #ifndef _SCH_XML_CONTEXTS_HXX_
28 #define _SCH_XML_CONTEXTS_HXX_
29 
30 #include "SchXMLImport.hxx"
31 #include "SchXMLTableContext.hxx"
32 #include <xmloff/xmlictxt.hxx>
33 #include <xmloff/xmltkmap.hxx>
34 
35 #include <xmloff/xmlmetai.hxx>
36 
37 namespace com { namespace sun { namespace star { namespace xml { namespace sax {
38 		class XAttributeList;
39 }}}}}
40 
41 /* ========================================
42 
43    These contexts are only nedded by
44    SchXMLImport not by the SchXMLImportHelper
45    that is also used by other applications
46 
47    ======================================== */
48 
49 class SchXMLDocContext : public virtual SvXMLImportContext
50 {
51 protected:
52 	SchXMLImportHelper& mrImportHelper;
53 
54 public:
55 	SchXMLDocContext(
56 		SchXMLImportHelper& rImpHelper,
57 		SvXMLImport& rImport,
58 		sal_uInt16 nPrefix,
59 		const rtl::OUString& rLName );
60 	virtual ~SchXMLDocContext();
61 
62 	TYPEINFO();
63 
64 	virtual SvXMLImportContext* CreateChildContext(
65 		sal_uInt16 nPrefix,
66 		const ::rtl::OUString& rLocalName,
67 		const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList );
68 };
69 
70 // ========================================
71 
72 // context for flat file xml format
73 class SchXMLFlatDocContext_Impl
74     : public SchXMLDocContext, public SvXMLMetaDocumentContext
75 {
76 public:
77     SchXMLFlatDocContext_Impl(
78 		SchXMLImportHelper& i_rImpHelper,
79         SchXMLImport& i_rImport,
80         sal_uInt16 i_nPrefix, const ::rtl::OUString & i_rLName,
81         const com::sun::star::uno::Reference<com::sun::star::document::XDocumentProperties>& i_xDocProps,
82         const com::sun::star::uno::Reference<com::sun::star::xml::sax::XDocumentHandler>& i_xDocBuilder);
83 
84     virtual ~SchXMLFlatDocContext_Impl();
85 
86     virtual SvXMLImportContext *CreateChildContext(
87         sal_uInt16 i_nPrefix, const ::rtl::OUString& i_rLocalName,
88         const com::sun::star::uno::Reference<com::sun::star::xml::sax::XAttributeList>& i_xAttrList);
89 };
90 
91 // ========================================
92 
93 class SchXMLBodyContext : public SvXMLImportContext
94 {
95 private:
96 	SchXMLImportHelper& mrImportHelper;
97 
98 public:
99 	SchXMLBodyContext(
100 		SchXMLImportHelper& rImpHelper,
101 		SvXMLImport& rImport,
102 		sal_uInt16 nPrefix,
103 		const rtl::OUString& rLName );
104 	virtual ~SchXMLBodyContext();
105 
106 	virtual void EndElement();
107 	virtual SvXMLImportContext* CreateChildContext(
108 		sal_uInt16 nPrefix,
109 		const ::rtl::OUString& rLocalName,
110 		const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList );
111 };
112 
113 // ========================================
114 
115 #endif	// _SCH_XML_CONTEXTS_HXX_
116