1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef CHART2_RANGESELECTIONHELPER_HXX
28 #define CHART2_RANGESELECTIONHELPER_HXX
29 
30 #include <com/sun/star/chart2/XChartDocument.hpp>
31 #include <com/sun/star/beans/PropertyValue.hpp>
32 
33 namespace com { namespace sun { namespace star {
34     namespace sheet{
35         class XRangeSelection;
36         class XRangeSelectionListener;
37         class XCellRangesAccess;
38     }
39 }}}
40 
41 namespace chart
42 {
43 
44 class RangeSelectionListenerParent;
45 
46 class RangeSelectionHelper
47 {
48 public:
49 	explicit RangeSelectionHelper(
50         const ::com::sun::star::uno::Reference<
51             ::com::sun::star::chart2::XChartDocument > & xChartDocument );
52     ~RangeSelectionHelper();
53 
54     bool hasRangeSelection();
55     ::com::sun::star::uno::Reference<
56             ::com::sun::star::sheet::XRangeSelection > getRangeSelection();
57     void raiseRangeSelectionDocument();
58     bool chooseRange(
59         const ::rtl::OUString & aCurrentRange,
60         const ::rtl::OUString & aUIString,
61         RangeSelectionListenerParent & rListenerParent );
62     void stopRangeListening( bool bRemoveListener = true );
63     bool verifyCellRange( const ::rtl::OUString & rRangeStr );
64     bool verifyArguments( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rArguments );
65 
66 private:
67     ::com::sun::star::uno::Reference<
68             ::com::sun::star::sheet::XRangeSelection >
69         m_xRangeSelection;
70 
71     ::com::sun::star::uno::Reference<
72             ::com::sun::star::chart2::XChartDocument >
73         m_xChartDocument;
74 
75     ::com::sun::star::uno::Reference<
76             ::com::sun::star::sheet::XCellRangesAccess >
77         m_xCellRangesAccess;
78 
79     ::com::sun::star::uno::Reference<
80             ::com::sun::star::sheet::XRangeSelectionListener >
81         m_xRangeSelectionListener;
82 };
83 
84 } //  namespace chart
85 
86 // CHART2_RANGESELECTIONHELPER_HXX
87 #endif
88