xref: /aoo41x/main/xmloff/inc/SchXMLImport.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_XMLIMPORT_HXX_
28 #define SCH_XMLIMPORT_HXX_
29 
30 #include <xmloff/SchXMLImportHelper.hxx>
31 #include <xmloff/xmlimp.hxx>
32 #include <xmloff/xmltkmap.hxx>
33 #include <xmloff/xmlictxt.hxx>
34 #include <xmloff/prhdlfac.hxx>
35 #include <xmloff/families.hxx>
36 
37 /* ----------------------------------------
38    these enums are used for the
39    SvXMLTokenMapEntries to distinguish
40    the tokens in switch-directives
41    ----------------------------------------*/
42 
43 enum SchXMLDocElemTokenMap
44 {
45 	XML_TOK_DOC_AUTOSTYLES,
46 	XML_TOK_DOC_STYLES,
47 	XML_TOK_DOC_META,
48 	XML_TOK_DOC_BODY
49 };
50 
51 enum SchXMLTableElemTokenMap
52 {
53 	XML_TOK_TABLE_HEADER_COLS,
54 	XML_TOK_TABLE_COLUMNS,
55 	XML_TOK_TABLE_COLUMN,
56 	XML_TOK_TABLE_HEADER_ROWS,
57 	XML_TOK_TABLE_ROWS,
58 	XML_TOK_TABLE_ROW
59 };
60 
61 enum SchXMLChartElemTokenMap
62 {
63 	XML_TOK_CHART_PLOT_AREA,
64 	XML_TOK_CHART_TITLE,
65 	XML_TOK_CHART_SUBTITLE,
66 	XML_TOK_CHART_LEGEND,
67 	XML_TOK_CHART_TABLE
68 };
69 
70 enum SchXMLPlotAreaElemTokenMap
71 {
72     XML_TOK_PA_COORDINATE_REGION_EXT,
73     XML_TOK_PA_COORDINATE_REGION,
74 	XML_TOK_PA_AXIS,
75 	XML_TOK_PA_SERIES,
76 	XML_TOK_PA_WALL,
77 	XML_TOK_PA_FLOOR,
78 	XML_TOK_PA_LIGHT_SOURCE,
79     XML_TOK_PA_STOCK_GAIN,
80     XML_TOK_PA_STOCK_LOSS,
81     XML_TOK_PA_STOCK_RANGE
82 };
83 
84 enum SchXMLSeriesElemTokenMap
85 {
86 	XML_TOK_SERIES_DATA_POINT,
87 	XML_TOK_SERIES_DOMAIN,
88     XML_TOK_SERIES_MEAN_VALUE_LINE,
89     XML_TOK_SERIES_REGRESSION_CURVE,
90     XML_TOK_SERIES_ERROR_INDICATOR
91 };
92 
93 // ----------------------------------------
94 
95 enum SchXMLChartAttrMap
96 {
97     XML_TOK_CHART_HREF,
98     XML_TOK_CHART_CLASS,
99 	XML_TOK_CHART_WIDTH,
100 	XML_TOK_CHART_HEIGHT,
101 	XML_TOK_CHART_STYLE_NAME,
102 	XML_TOK_CHART_ADDIN_NAME,
103     XML_TOK_CHART_COL_MAPPING,
104     XML_TOK_CHART_ROW_MAPPING
105 };
106 
107 enum SchXMLPlotAreaAttrTokenMap
108 {
109 	XML_TOK_PA_X,
110 	XML_TOK_PA_Y,
111 	XML_TOK_PA_WIDTH,
112 	XML_TOK_PA_HEIGHT,
113 	XML_TOK_PA_STYLE_NAME,
114 	XML_TOK_PA_TRANSFORM,
115     XML_TOK_PA_CHART_ADDRESS,
116     XML_TOK_PA_TABLE_NUMBER_LIST,
117     XML_TOK_PA_DS_HAS_LABELS,
118     XML_TOK_PA_VRP,
119     XML_TOK_PA_VPN,
120     XML_TOK_PA_VUP,
121     XML_TOK_PA_PROJECTION,
122     XML_TOK_PA_DISTANCE,
123     XML_TOK_PA_FOCAL_LENGTH,
124     XML_TOK_PA_SHADOW_SLANT,
125     XML_TOK_PA_SHADE_MODE,
126     XML_TOK_PA_AMBIENT_COLOR,
127     XML_TOK_PA_LIGHTING_MODE
128 };
129 
130 enum SchXMLAutoStyleAttrMap
131 {
132 	XML_TOK_AS_FAMILY,
133 	XML_TOK_AS_NAME
134 };
135 
136 enum SchXMLCellAttrMap
137 {
138 	XML_TOK_CELL_VAL_TYPE,
139 	XML_TOK_CELL_VALUE
140 };
141 
142 enum SchXMLSeriesAttrMap
143 {
144 	XML_TOK_SERIES_CELL_RANGE,
145 	XML_TOK_SERIES_LABEL_ADDRESS,
146 	XML_TOK_SERIES_ATTACHED_AXIS,
147 	XML_TOK_SERIES_STYLE_NAME,
148 	XML_TOK_SERIES_CHART_CLASS
149 };
150 
151 enum SchXMLRegEquationAttrMap
152 {
153     XML_TOK_REGEQ_STYLE_NAME,
154     XML_TOK_REGEQ_DISPLAY_EQUATION,
155     XML_TOK_REGEQ_DISPLAY_R_SQUARE,
156     XML_TOK_REGEQ_POS_X,
157     XML_TOK_REGEQ_POS_Y
158 };
159 
160 class SchXMLImport : public SvXMLImport
161 {
162 private:
163 	com::sun::star::uno::Reference< com::sun::star::task::XStatusIndicator > mxStatusIndicator;
164 
165 	SchXMLImportHelper maImportHelper;
166 
167 protected:
168 	virtual SvXMLImportContext *CreateContext(
169 		sal_uInt16 nPrefix,
170 		const ::rtl::OUString& rLocalName,
171 		const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList );
172 
173 public:
174 	// #110680#
175 	SchXMLImport(
176 		const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
177 		sal_uInt16 nImportFlags = IMPORT_ALL );
178 
179 	// #110680#
180 	SchXMLImport(
181 		const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
182 		com::sun::star::uno::Reference< com::sun::star::frame::XModel > xModel,
183 		com::sun::star::uno::Reference< com::sun::star::document::XGraphicObjectResolver > &,
184 		sal_Bool bLoadDoc, sal_Bool bShowProgress );
185 
186 	virtual ~SchXMLImport() throw ();
187 
188     // XServiceInfo ( : SvXMLExport )
189     virtual ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException );
190 
191     SvXMLImportContext* CreateStylesContext( const ::rtl::OUString& rLocalName,
192         const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList );
193 
194     // XImporter
195     virtual void SAL_CALL setTargetDocument( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& xDoc ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
196 };
197 
198 #endif	// SCH_XMLIMPORT_HXX_
199