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 _CHART2_CONTROLLER_CHARTMODELHELPER_HXX
24 #define _CHART2_CONTROLLER_CHARTMODELHELPER_HXX
25 
26 #include <com/sun/star/chart2/XChartType.hpp>
27 #include <com/sun/star/chart2/XDataSeries.hpp>
28 #include <com/sun/star/chart2/XDiagram.hpp>
29 #include <com/sun/star/chart2/XChartDocument.hpp>
30 #include <com/sun/star/chart2/data/XDataProvider.hpp>
31 #include <com/sun/star/chart2/data/XRangeHighlighter.hpp>
32 #include <com/sun/star/view/XSelectionSupplier.hpp>
33 
34 #include <com/sun/star/awt/Size.hpp>
35 #include <com/sun/star/frame/XModel.hpp>
36 #include "charttoolsdllapi.hxx"
37 
38 #include <vector>
39 
40 //.............................................................................
41 namespace chart
42 {
43 //.............................................................................
44 
45 //-----------------------------------------------------------------------------
46 /**
47 */
48 
49 class OOO_DLLPUBLIC_CHARTTOOLS ChartModelHelper
50 {
51 public:
52     static ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XRangeHighlighter > createRangeHighlighter(
53             const ::com::sun::star::uno::Reference< ::com::sun::star::view::XSelectionSupplier >& xSelectionSupplier );
54 
55     static ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataProvider > createInternalDataProvider(
56             const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument >& xChartDoc, bool bConnectToModel );
57 
58     static ::com::sun::star::uno::Reference<
59             ::com::sun::star::chart2::XDiagram >
60         findDiagram( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xModel );
61 
62     static ::com::sun::star::uno::Reference<
63             ::com::sun::star::chart2::XDiagram >
64         findDiagram( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument >& xChartDoc );
65 
66     static ::com::sun::star::uno::Reference<
67             ::com::sun::star::chart2::XCoordinateSystem >
68         getFirstCoordinateSystem( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xModel );
69 
70     SAL_DLLPRIVATE static ::std::vector< ::com::sun::star::uno::Reference<
71         ::com::sun::star::chart2::XDataSeries > > getDataSeries(
72             const ::com::sun::star::uno::Reference<
73             ::com::sun::star::chart2::XChartDocument > & xChartDoc );
74     static ::std::vector< ::com::sun::star::uno::Reference<
75         ::com::sun::star::chart2::XDataSeries > > getDataSeries(
76             const ::com::sun::star::uno::Reference<
77             ::com::sun::star::frame::XModel > & xModel );
78 
79 	static ::com::sun::star::uno::Reference<
80 	::com::sun::star::chart2::XChartType >
81 		getChartTypeOfSeries(
82 			const ::com::sun::star::uno::Reference<
83 				::com::sun::star::frame::XModel >& xModel
84 			, const ::com::sun::star::uno::Reference<
85 	            ::com::sun::star::chart2::XDataSeries >& xGivenDataSeries );
86 
87     static ::com::sun::star::awt::Size getDefaultPageSize();
88 
89     static ::com::sun::star::awt::Size getPageSize(
90         const ::com::sun::star::uno::Reference<
91 				::com::sun::star::frame::XModel >& xModel );
92 
93     static void setPageSize( const ::com::sun::star::awt::Size& rSize
94                            , const ::com::sun::star::uno::Reference<
95                                 ::com::sun::star::frame::XModel >& xModel );
96 
97     static void triggerRangeHighlighting( const ::com::sun::star::uno::Reference<
98                                 ::com::sun::star::frame::XModel >& xModel );
99 
100     static bool isIncludeHiddenCells( const ::com::sun::star::uno::Reference<
101                                 ::com::sun::star::frame::XModel >& xChartModel );
102 
103     static bool setIncludeHiddenCells( bool bIncludeHiddenCells, const ::com::sun::star::uno::Reference<
104                                 ::com::sun::star::frame::XModel >& xChartModel );
105 };
106 
107 //.............................................................................
108 } //namespace chart
109 //.............................................................................
110 #endif
111