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_RANGESELECTIONHELPER_HXX
24 #define CHART2_RANGESELECTIONHELPER_HXX
25 
26 #include <com/sun/star/chart2/XChartDocument.hpp>
27 #include <com/sun/star/beans/PropertyValue.hpp>
28 
29 namespace com { namespace sun { namespace star {
30     namespace sheet{
31         class XRangeSelection;
32         class XRangeSelectionListener;
33         class XCellRangesAccess;
34     }
35 }}}
36 
37 namespace chart
38 {
39 
40 class RangeSelectionListenerParent;
41 
42 class RangeSelectionHelper
43 {
44 public:
45 	explicit RangeSelectionHelper(
46         const ::com::sun::star::uno::Reference<
47             ::com::sun::star::chart2::XChartDocument > & xChartDocument );
48     ~RangeSelectionHelper();
49 
50     bool hasRangeSelection();
51     ::com::sun::star::uno::Reference<
52             ::com::sun::star::sheet::XRangeSelection > getRangeSelection();
53     void raiseRangeSelectionDocument();
54     bool chooseRange(
55         const ::rtl::OUString & aCurrentRange,
56         const ::rtl::OUString & aUIString,
57         RangeSelectionListenerParent & rListenerParent );
58     void stopRangeListening( bool bRemoveListener = true );
59     bool verifyCellRange( const ::rtl::OUString & rRangeStr );
60     bool verifyArguments( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rArguments );
61 
62 private:
63     ::com::sun::star::uno::Reference<
64             ::com::sun::star::sheet::XRangeSelection >
65         m_xRangeSelection;
66 
67     ::com::sun::star::uno::Reference<
68             ::com::sun::star::chart2::XChartDocument >
69         m_xChartDocument;
70 
71     ::com::sun::star::uno::Reference<
72             ::com::sun::star::sheet::XCellRangesAccess >
73         m_xCellRangesAccess;
74 
75     ::com::sun::star::uno::Reference<
76             ::com::sun::star::sheet::XRangeSelectionListener >
77         m_xRangeSelectionListener;
78 };
79 
80 } //  namespace chart
81 
82 // CHART2_RANGESELECTIONHELPER_HXX
83 #endif
84