1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: RangeHighlighter.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef CHART2_RANGEHIGHLIGHTER_HXX
31 #define CHART2_RANGEHIGHLIGHTER_HXX
33 #include "MutexContainer.hxx"
34 #include <cppuhelper/compbase2.hxx>
35 #include <com/sun/star/chart2/data/XRangeHighlighter.hpp>
36 #include <com/sun/star/view/XSelectionSupplier.hpp>
37 #include <com/sun/star/beans/XPropertySet.hpp>
39 namespace com
{ namespace sun
{ namespace star
{
51 typedef ::cppu::WeakComponentImplHelper2
<
52 ::com::sun::star::chart2::data::XRangeHighlighter
,
53 ::com::sun::star::view::XSelectionChangeListener
55 RangeHighlighter_Base
;
58 class RangeHighlighter
:
59 public MutexContainer
,
60 public impl::RangeHighlighter_Base
63 explicit RangeHighlighter(
64 const ::com::sun::star::uno::Reference
<
65 ::com::sun::star::view::XSelectionSupplier
> & xSelectionSupplier
);
66 virtual ~RangeHighlighter();
69 // ____ XRangeHighlighter ____
70 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::chart2::data::HighlightedRange
> SAL_CALL
getSelectedRanges()
71 throw (::com::sun::star::uno::RuntimeException
);
72 virtual void SAL_CALL
addSelectionChangeListener(
73 const ::com::sun::star::uno::Reference
< ::com::sun::star::view::XSelectionChangeListener
>& xListener
)
74 throw (::com::sun::star::uno::RuntimeException
);
75 virtual void SAL_CALL
removeSelectionChangeListener(
76 const ::com::sun::star::uno::Reference
< ::com::sun::star::view::XSelectionChangeListener
>& xListener
)
77 throw (::com::sun::star::uno::RuntimeException
);
79 // ____ XSelectionChangeListener ____
80 virtual void SAL_CALL
selectionChanged(
81 const ::com::sun::star::lang::EventObject
& aEvent
)
82 throw (::com::sun::star::uno::RuntimeException
);
84 // ____ XEventListener (base of XSelectionChangeListener) ____
85 virtual void SAL_CALL
disposing(
86 const ::com::sun::star::lang::EventObject
& Source
)
87 throw (::com::sun::star::uno::RuntimeException
);
89 // ____ WeakComponentImplHelperBase ____
90 // is called when dispose() is called at this component
91 virtual void SAL_CALL
disposing();
94 void fireSelectionEvent();
95 void startListening();
97 void determineRanges();
99 void fillRangesForDiagram( const ::com::sun::star::uno::Reference
< ::com::sun::star::chart2::XDiagram
> & xDiagram
);
100 void fillRangesForDataSeries( const ::com::sun::star::uno::Reference
< ::com::sun::star::chart2::XDataSeries
> & xSeries
);
101 void fillRangesForCategories( const ::com::sun::star::uno::Reference
< ::com::sun::star::chart2::XAxis
> & xAxis
);
102 void fillRangesForDataPoint( const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
> & xDataSeries
, sal_Int32 nIndex
);
103 void fillRangesForErrorBars( const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> & xErrorBar
,
104 const ::com::sun::star::uno::Reference
< ::com::sun::star::chart2::XDataSeries
> & xDataSeries
);
106 ::com::sun::star::uno::Reference
< ::com::sun::star::view::XSelectionSupplier
>
107 m_xSelectionSupplier
;
108 ::com::sun::star::uno::Reference
< ::com::sun::star::view::XSelectionChangeListener
>
110 ::com::sun::star::uno::Sequence
< ::com::sun::star::chart2::data::HighlightedRange
>
112 sal_Int32 m_nAddedListenerCount
;
113 bool m_bIncludeHiddenCells
;
118 // CHART2_RANGEHIGHLIGHTER_HXX