fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / chart2 / source / inc / RangeHighlighter.hxx
blobe27c6d11ec496f311d9ee9ef06fe54c1cad3b214
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 .
19 #ifndef INCLUDED_CHART2_SOURCE_INC_RANGEHIGHLIGHTER_HXX
20 #define INCLUDED_CHART2_SOURCE_INC_RANGEHIGHLIGHTER_HXX
22 #include "MutexContainer.hxx"
23 #include <cppuhelper/compbase2.hxx>
24 #include <com/sun/star/chart2/data/XRangeHighlighter.hpp>
25 #include <com/sun/star/view/XSelectionSupplier.hpp>
26 #include <com/sun/star/beans/XPropertySet.hpp>
28 namespace com { namespace sun { namespace star {
29 namespace chart2 {
30 class XDiagram;
31 class XDataSeries;
32 class XAxis;
33 }}}}
35 namespace chart
38 namespace impl
40 typedef ::cppu::WeakComponentImplHelper2<
41 ::com::sun::star::chart2::data::XRangeHighlighter,
42 ::com::sun::star::view::XSelectionChangeListener
44 RangeHighlighter_Base;
47 class RangeHighlighter :
48 public MutexContainer,
49 public impl::RangeHighlighter_Base
51 public:
52 explicit RangeHighlighter(
53 const ::com::sun::star::uno::Reference<
54 ::com::sun::star::view::XSelectionSupplier > & xSelectionSupplier );
55 virtual ~RangeHighlighter();
57 protected:
58 // ____ XRangeHighlighter ____
59 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::chart2::data::HighlightedRange > SAL_CALL getSelectedRanges()
60 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
61 virtual void SAL_CALL addSelectionChangeListener(
62 const ::com::sun::star::uno::Reference< ::com::sun::star::view::XSelectionChangeListener >& xListener )
63 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
64 virtual void SAL_CALL removeSelectionChangeListener(
65 const ::com::sun::star::uno::Reference< ::com::sun::star::view::XSelectionChangeListener >& xListener )
66 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
68 // ____ XSelectionChangeListener ____
69 virtual void SAL_CALL selectionChanged(
70 const ::com::sun::star::lang::EventObject& aEvent )
71 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
73 // ____ XEventListener (base of XSelectionChangeListener) ____
74 virtual void SAL_CALL disposing(
75 const ::com::sun::star::lang::EventObject& Source )
76 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
78 // ____ WeakComponentImplHelperBase ____
79 // is called when dispose() is called at this component
80 virtual void SAL_CALL disposing() SAL_OVERRIDE;
82 private:
83 void fireSelectionEvent();
84 void startListening();
85 void stopListening();
86 void determineRanges();
88 void fillRangesForDiagram( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDiagram > & xDiagram );
89 void fillRangesForDataSeries( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries > & xSeries );
90 void fillRangesForCategories( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XAxis > & xAxis );
91 void fillRangesForDataPoint( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > & xDataSeries, sal_Int32 nIndex );
92 void fillRangesForErrorBars( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & xErrorBar,
93 const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries > & xDataSeries );
95 ::com::sun::star::uno::Reference< ::com::sun::star::view::XSelectionSupplier >
96 m_xSelectionSupplier;
97 ::com::sun::star::uno::Reference< ::com::sun::star::view::XSelectionChangeListener >
98 m_xListener;
99 ::com::sun::star::uno::Sequence< ::com::sun::star::chart2::data::HighlightedRange >
100 m_aSelectedRanges;
101 sal_Int32 m_nAddedListenerCount;
102 bool m_bIncludeHiddenCells;
105 } // namespace chart
107 // INCLUDED_CHART2_SOURCE_INC_RANGEHIGHLIGHTER_HXX
108 #endif
110 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */