Branch libreoffice-5-0-4
[LibreOffice.git] / include / oox / drawingml / chart / chartconverter.hxx
blob2be69748e99e002ddbabeeca9d3cfa761c7dff62
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_OOX_DRAWINGML_CHART_CHARTCONVERTER_HXX
21 #define INCLUDED_OOX_DRAWINGML_CHART_CHARTCONVERTER_HXX
23 #include <com/sun/star/uno/Reference.hxx>
24 #include <oox/dllapi.h>
26 namespace com { namespace sun { namespace star {
27 namespace awt { struct Point; }
28 namespace awt { struct Size; }
29 namespace drawing { class XShapes; }
30 namespace chart2 { class XChartDocument; }
31 namespace chart2 { namespace data { class XDataProvider; } }
32 namespace chart2 { namespace data { class XDataSequence; } }
33 } } }
35 namespace oox { namespace core { class XmlFilterBase; } }
37 namespace oox {
38 namespace drawingml {
39 namespace chart {
41 struct ChartSpaceModel;
42 struct DataSequenceModel;
46 class OOX_DLLPUBLIC ChartConverter
48 public:
49 explicit ChartConverter();
50 virtual ~ChartConverter();
52 /** Converts the passed OOXML chart model to the passed chart2 document.
54 @param rChartModel The filled MSOOXML chart model structure.
56 @param rxChartDoc The UNO chart document model to be initialized.
58 @param rxExternalPage If null, all embedded shapes will be inserted
59 into the internal drawing page of the chart document. If not null,
60 all embedded shapes will be inserted into this shapes collection.
62 @param rChartPos The position of the chart shape in its drawing page,
63 in 1/100 mm. Will be used only, if parameter rxExternalPage is not
64 null, for correct positioning of the embedded shapes in the
65 external drawing page.
67 @param rChartSize The size of the chart shape in 1/100 mm. Needed for
68 calculation of position and size of the chart elements (diagram,
69 titles, legend, etc.) and embedded shapes.
71 void convertFromModel(
72 ::oox::core::XmlFilterBase& rFilter,
73 ChartSpaceModel& rChartModel,
74 const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument >& rxChartDoc,
75 const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxExternalPage,
76 const ::com::sun::star::awt::Point& rChartPos,
77 const ::com::sun::star::awt::Size& rChartSize );
79 /** Creates an internal data provider. Derived classes may override this
80 function to create an external data provider. */
81 virtual void createDataProvider(
82 const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument >& rxChartDoc );
84 /** Creates a data sequence from a formula. Dummy implementation. Derived
85 classes have to override this function to actually parse the formula. */
86 virtual css::uno::Reference<css::chart2::data::XDataSequence>
87 createDataSequence(
88 const css::uno::Reference<css::chart2::data::XDataProvider>& rxDataProvider,
89 const DataSequenceModel& rDataSeq, const OUString& rRole );
91 private:
92 ChartConverter( const ChartConverter& ) SAL_DELETED_FUNCTION;
93 ChartConverter& operator=( const ChartConverter& ) SAL_DELETED_FUNCTION;
98 } // namespace chart
99 } // namespace drawingml
100 } // namespace oox
102 #endif
104 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */