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