LibreOffice Module chart2 (master) 1
RangeHighlighter.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19#pragma once
20
23#include <com/sun/star/chart2/data/XRangeHighlighter.hpp>
24#include <com/sun/star/view/XSelectionChangeListener.hpp>
25#include <rtl/ref.hxx>
26
27namespace com::sun::star {
28 namespace chart2 {
29 class XDiagram;
30 class XDataSeries;
31 class XAxis;
32 }
33}
34namespace com::sun::star::beans { class XPropertySet; }
35namespace com::sun::star::view { class XSelectionSupplier; }
36
37namespace chart
38{
39class ChartModel;
40class DataSeries;
41class Diagram;
42
43namespace impl
44{
46 css::chart2::data::XRangeHighlighter,
47 css::view::XSelectionChangeListener
48 >
50}
51
52class RangeHighlighter final :
54{
55public:
56 explicit RangeHighlighter(
57 const rtl::Reference< ::chart::ChartModel > & xSelectionSupplier );
58 virtual ~RangeHighlighter() override;
59
60protected:
61 // ____ XRangeHighlighter ____
62 virtual css::uno::Sequence< css::chart2::data::HighlightedRange > SAL_CALL getSelectedRanges() override;
63 virtual void SAL_CALL addSelectionChangeListener(
64 const css::uno::Reference< css::view::XSelectionChangeListener >& xListener ) override;
65 virtual void SAL_CALL removeSelectionChangeListener(
66 const css::uno::Reference< css::view::XSelectionChangeListener >& xListener ) override;
67
68 // ____ XSelectionChangeListener ____
69 virtual void SAL_CALL selectionChanged(
70 const css::lang::EventObject& aEvent ) override;
71
72 // ____ XEventListener (base of XSelectionChangeListener) ____
73 virtual void SAL_CALL disposing(
74 const css::lang::EventObject& Source ) override;
75
76 // ____ WeakComponentImplHelperBase ____
77 // is called when dispose() is called at this component
78 virtual void disposing(std::unique_lock<std::mutex>&) override;
79
80private:
81 void fireSelectionEvent();
82 void startListening();
83 void stopListening();
84 void determineRanges();
85
87 void fillRangesForDataSeries( const css::uno::Reference< css::chart2::XDataSeries > & xSeries );
88 void fillRangesForCategories( const css::uno::Reference< css::chart2::XAxis > & xAxis );
89 void fillRangesForDataPoint( const rtl::Reference< ::chart::DataSeries > & xDataSeries, sal_Int32 nIndex );
90 void fillRangesForErrorBars( const css::uno::Reference< css::beans::XPropertySet > & xErrorBar,
91 const css::uno::Reference< css::chart2::XDataSeries > & xDataSeries );
92
93 css::uno::Reference< css::view::XSelectionSupplier >
96 css::uno::Reference< css::view::XSelectionChangeListener >
98 css::uno::Sequence< css::chart2::data::HighlightedRange >
103};
104
105} // namespace chart
106
107/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
AnyEventRef aEvent
css::uno::Sequence< css::chart2::data::HighlightedRange > m_aSelectedRanges
virtual void SAL_CALL selectionChanged(const css::lang::EventObject &aEvent) override
virtual css::uno::Sequence< css::chart2::data::HighlightedRange > SAL_CALL getSelectedRanges() override
virtual ~RangeHighlighter() override
virtual void SAL_CALL disposing(const css::lang::EventObject &Source) override
void fillRangesForCategories(const css::uno::Reference< css::chart2::XAxis > &xAxis)
void fillRangesForDataPoint(const rtl::Reference< ::chart::DataSeries > &xDataSeries, sal_Int32 nIndex)
RangeHighlighter(const rtl::Reference< ::chart::ChartModel > &xSelectionSupplier)
void fillRangesForDiagram(const rtl::Reference< ::chart::Diagram > &xDiagram)
comphelper::OInterfaceContainerHelper4< css::view::XSelectionChangeListener > maSelectionChangeListeners
css::uno::Reference< css::view::XSelectionSupplier > m_xSelectionSupplier
void fillRangesForDataSeries(const css::uno::Reference< css::chart2::XDataSeries > &xSeries)
css::uno::Reference< css::view::XSelectionChangeListener > m_xListener
void fillRangesForErrorBars(const css::uno::Reference< css::beans::XPropertySet > &xErrorBar, const css::uno::Reference< css::chart2::XDataSeries > &xDataSeries)
virtual void SAL_CALL removeSelectionChangeListener(const css::uno::Reference< css::view::XSelectionChangeListener > &xListener) override
rtl::Reference< ::chart::ChartModel > m_xChartModel
virtual void SAL_CALL addSelectionChangeListener(const css::uno::Reference< css::view::XSelectionChangeListener > &xListener) override
comphelper::WeakComponentImplHelper< css::chart2::data::XRangeHighlighter, css::view::XSelectionChangeListener > RangeHighlighter_Base
class SAL_NO_VTABLE XPropertySet