xref: /aoo41x/main/xmloff/inc/SchXMLImport.hxx (revision ecfe53c5)
1*ecfe53c5SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*ecfe53c5SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*ecfe53c5SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*ecfe53c5SAndrew Rist  * distributed with this work for additional information
6*ecfe53c5SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*ecfe53c5SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*ecfe53c5SAndrew Rist  * "License"); you may not use this file except in compliance
9*ecfe53c5SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*ecfe53c5SAndrew Rist  *
11*ecfe53c5SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*ecfe53c5SAndrew Rist  *
13*ecfe53c5SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*ecfe53c5SAndrew Rist  * software distributed under the License is distributed on an
15*ecfe53c5SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*ecfe53c5SAndrew Rist  * KIND, either express or implied.  See the License for the
17*ecfe53c5SAndrew Rist  * specific language governing permissions and limitations
18*ecfe53c5SAndrew Rist  * under the License.
19*ecfe53c5SAndrew Rist  *
20*ecfe53c5SAndrew Rist  *************************************************************/
21*ecfe53c5SAndrew Rist 
22*ecfe53c5SAndrew Rist 
23cdf0e10cSrcweir #ifndef SCH_XMLIMPORT_HXX_
24cdf0e10cSrcweir #define SCH_XMLIMPORT_HXX_
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include <xmloff/SchXMLImportHelper.hxx>
27cdf0e10cSrcweir #include <xmloff/xmlimp.hxx>
28cdf0e10cSrcweir #include <xmloff/xmltkmap.hxx>
29cdf0e10cSrcweir #include <xmloff/xmlictxt.hxx>
30cdf0e10cSrcweir #include <xmloff/prhdlfac.hxx>
31cdf0e10cSrcweir #include <xmloff/families.hxx>
32cdf0e10cSrcweir 
33cdf0e10cSrcweir /* ----------------------------------------
34cdf0e10cSrcweir    these enums are used for the
35cdf0e10cSrcweir    SvXMLTokenMapEntries to distinguish
36cdf0e10cSrcweir    the tokens in switch-directives
37cdf0e10cSrcweir    ----------------------------------------*/
38cdf0e10cSrcweir 
39cdf0e10cSrcweir enum SchXMLDocElemTokenMap
40cdf0e10cSrcweir {
41cdf0e10cSrcweir 	XML_TOK_DOC_AUTOSTYLES,
42cdf0e10cSrcweir 	XML_TOK_DOC_STYLES,
43cdf0e10cSrcweir 	XML_TOK_DOC_META,
44cdf0e10cSrcweir 	XML_TOK_DOC_BODY
45cdf0e10cSrcweir };
46cdf0e10cSrcweir 
47cdf0e10cSrcweir enum SchXMLTableElemTokenMap
48cdf0e10cSrcweir {
49cdf0e10cSrcweir 	XML_TOK_TABLE_HEADER_COLS,
50cdf0e10cSrcweir 	XML_TOK_TABLE_COLUMNS,
51cdf0e10cSrcweir 	XML_TOK_TABLE_COLUMN,
52cdf0e10cSrcweir 	XML_TOK_TABLE_HEADER_ROWS,
53cdf0e10cSrcweir 	XML_TOK_TABLE_ROWS,
54cdf0e10cSrcweir 	XML_TOK_TABLE_ROW
55cdf0e10cSrcweir };
56cdf0e10cSrcweir 
57cdf0e10cSrcweir enum SchXMLChartElemTokenMap
58cdf0e10cSrcweir {
59cdf0e10cSrcweir 	XML_TOK_CHART_PLOT_AREA,
60cdf0e10cSrcweir 	XML_TOK_CHART_TITLE,
61cdf0e10cSrcweir 	XML_TOK_CHART_SUBTITLE,
62cdf0e10cSrcweir 	XML_TOK_CHART_LEGEND,
63cdf0e10cSrcweir 	XML_TOK_CHART_TABLE
64cdf0e10cSrcweir };
65cdf0e10cSrcweir 
66cdf0e10cSrcweir enum SchXMLPlotAreaElemTokenMap
67cdf0e10cSrcweir {
68cdf0e10cSrcweir     XML_TOK_PA_COORDINATE_REGION_EXT,
69cdf0e10cSrcweir     XML_TOK_PA_COORDINATE_REGION,
70cdf0e10cSrcweir 	XML_TOK_PA_AXIS,
71cdf0e10cSrcweir 	XML_TOK_PA_SERIES,
72cdf0e10cSrcweir 	XML_TOK_PA_WALL,
73cdf0e10cSrcweir 	XML_TOK_PA_FLOOR,
74cdf0e10cSrcweir 	XML_TOK_PA_LIGHT_SOURCE,
75cdf0e10cSrcweir     XML_TOK_PA_STOCK_GAIN,
76cdf0e10cSrcweir     XML_TOK_PA_STOCK_LOSS,
77cdf0e10cSrcweir     XML_TOK_PA_STOCK_RANGE
78cdf0e10cSrcweir };
79cdf0e10cSrcweir 
80cdf0e10cSrcweir enum SchXMLSeriesElemTokenMap
81cdf0e10cSrcweir {
82cdf0e10cSrcweir 	XML_TOK_SERIES_DATA_POINT,
83cdf0e10cSrcweir 	XML_TOK_SERIES_DOMAIN,
84cdf0e10cSrcweir     XML_TOK_SERIES_MEAN_VALUE_LINE,
85cdf0e10cSrcweir     XML_TOK_SERIES_REGRESSION_CURVE,
86cdf0e10cSrcweir     XML_TOK_SERIES_ERROR_INDICATOR
87cdf0e10cSrcweir };
88cdf0e10cSrcweir 
89cdf0e10cSrcweir // ----------------------------------------
90cdf0e10cSrcweir 
91cdf0e10cSrcweir enum SchXMLChartAttrMap
92cdf0e10cSrcweir {
93cdf0e10cSrcweir     XML_TOK_CHART_HREF,
94cdf0e10cSrcweir     XML_TOK_CHART_CLASS,
95cdf0e10cSrcweir 	XML_TOK_CHART_WIDTH,
96cdf0e10cSrcweir 	XML_TOK_CHART_HEIGHT,
97cdf0e10cSrcweir 	XML_TOK_CHART_STYLE_NAME,
98cdf0e10cSrcweir 	XML_TOK_CHART_ADDIN_NAME,
99cdf0e10cSrcweir     XML_TOK_CHART_COL_MAPPING,
100cdf0e10cSrcweir     XML_TOK_CHART_ROW_MAPPING
101cdf0e10cSrcweir };
102cdf0e10cSrcweir 
103cdf0e10cSrcweir enum SchXMLPlotAreaAttrTokenMap
104cdf0e10cSrcweir {
105cdf0e10cSrcweir 	XML_TOK_PA_X,
106cdf0e10cSrcweir 	XML_TOK_PA_Y,
107cdf0e10cSrcweir 	XML_TOK_PA_WIDTH,
108cdf0e10cSrcweir 	XML_TOK_PA_HEIGHT,
109cdf0e10cSrcweir 	XML_TOK_PA_STYLE_NAME,
110cdf0e10cSrcweir 	XML_TOK_PA_TRANSFORM,
111cdf0e10cSrcweir     XML_TOK_PA_CHART_ADDRESS,
112cdf0e10cSrcweir     XML_TOK_PA_TABLE_NUMBER_LIST,
113cdf0e10cSrcweir     XML_TOK_PA_DS_HAS_LABELS,
114cdf0e10cSrcweir     XML_TOK_PA_VRP,
115cdf0e10cSrcweir     XML_TOK_PA_VPN,
116cdf0e10cSrcweir     XML_TOK_PA_VUP,
117cdf0e10cSrcweir     XML_TOK_PA_PROJECTION,
118cdf0e10cSrcweir     XML_TOK_PA_DISTANCE,
119cdf0e10cSrcweir     XML_TOK_PA_FOCAL_LENGTH,
120cdf0e10cSrcweir     XML_TOK_PA_SHADOW_SLANT,
121cdf0e10cSrcweir     XML_TOK_PA_SHADE_MODE,
122cdf0e10cSrcweir     XML_TOK_PA_AMBIENT_COLOR,
123cdf0e10cSrcweir     XML_TOK_PA_LIGHTING_MODE
124cdf0e10cSrcweir };
125cdf0e10cSrcweir 
126cdf0e10cSrcweir enum SchXMLAutoStyleAttrMap
127cdf0e10cSrcweir {
128cdf0e10cSrcweir 	XML_TOK_AS_FAMILY,
129cdf0e10cSrcweir 	XML_TOK_AS_NAME
130cdf0e10cSrcweir };
131cdf0e10cSrcweir 
132cdf0e10cSrcweir enum SchXMLCellAttrMap
133cdf0e10cSrcweir {
134cdf0e10cSrcweir 	XML_TOK_CELL_VAL_TYPE,
135cdf0e10cSrcweir 	XML_TOK_CELL_VALUE
136cdf0e10cSrcweir };
137cdf0e10cSrcweir 
138cdf0e10cSrcweir enum SchXMLSeriesAttrMap
139cdf0e10cSrcweir {
140cdf0e10cSrcweir 	XML_TOK_SERIES_CELL_RANGE,
141cdf0e10cSrcweir 	XML_TOK_SERIES_LABEL_ADDRESS,
142cdf0e10cSrcweir 	XML_TOK_SERIES_ATTACHED_AXIS,
143cdf0e10cSrcweir 	XML_TOK_SERIES_STYLE_NAME,
144cdf0e10cSrcweir 	XML_TOK_SERIES_CHART_CLASS
145cdf0e10cSrcweir };
146cdf0e10cSrcweir 
147cdf0e10cSrcweir enum SchXMLRegEquationAttrMap
148cdf0e10cSrcweir {
149cdf0e10cSrcweir     XML_TOK_REGEQ_STYLE_NAME,
150cdf0e10cSrcweir     XML_TOK_REGEQ_DISPLAY_EQUATION,
151cdf0e10cSrcweir     XML_TOK_REGEQ_DISPLAY_R_SQUARE,
152cdf0e10cSrcweir     XML_TOK_REGEQ_POS_X,
153cdf0e10cSrcweir     XML_TOK_REGEQ_POS_Y
154cdf0e10cSrcweir };
155cdf0e10cSrcweir 
156cdf0e10cSrcweir class SchXMLImport : public SvXMLImport
157cdf0e10cSrcweir {
158cdf0e10cSrcweir private:
159cdf0e10cSrcweir 	com::sun::star::uno::Reference< com::sun::star::task::XStatusIndicator > mxStatusIndicator;
160cdf0e10cSrcweir 
161cdf0e10cSrcweir 	SchXMLImportHelper maImportHelper;
162cdf0e10cSrcweir 
163cdf0e10cSrcweir protected:
164cdf0e10cSrcweir 	virtual SvXMLImportContext *CreateContext(
165cdf0e10cSrcweir 		sal_uInt16 nPrefix,
166cdf0e10cSrcweir 		const ::rtl::OUString& rLocalName,
167cdf0e10cSrcweir 		const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList );
168cdf0e10cSrcweir 
169cdf0e10cSrcweir public:
170cdf0e10cSrcweir 	// #110680#
171cdf0e10cSrcweir 	SchXMLImport(
172cdf0e10cSrcweir 		const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
173cdf0e10cSrcweir 		sal_uInt16 nImportFlags = IMPORT_ALL );
174cdf0e10cSrcweir 
175cdf0e10cSrcweir 	// #110680#
176cdf0e10cSrcweir 	SchXMLImport(
177cdf0e10cSrcweir 		const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
178cdf0e10cSrcweir 		com::sun::star::uno::Reference< com::sun::star::frame::XModel > xModel,
179cdf0e10cSrcweir 		com::sun::star::uno::Reference< com::sun::star::document::XGraphicObjectResolver > &,
180cdf0e10cSrcweir 		sal_Bool bLoadDoc, sal_Bool bShowProgress );
181cdf0e10cSrcweir 
182cdf0e10cSrcweir 	virtual ~SchXMLImport() throw ();
183cdf0e10cSrcweir 
184cdf0e10cSrcweir     // XServiceInfo ( : SvXMLExport )
185cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException );
186cdf0e10cSrcweir 
187cdf0e10cSrcweir     SvXMLImportContext* CreateStylesContext( const ::rtl::OUString& rLocalName,
188cdf0e10cSrcweir         const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList );
189cdf0e10cSrcweir 
190cdf0e10cSrcweir     // XImporter
191cdf0e10cSrcweir     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);
192cdf0e10cSrcweir };
193cdf0e10cSrcweir 
194cdf0e10cSrcweir #endif	// SCH_XMLIMPORT_HXX_
195