Coverage Report

Created: 2026-10-14 09:33

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/chart2/source/controller/sidebar/ChartAxisPanel.hxx
Line
Count
Source
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
 */
10
11
#pragma once
12
13
#include <sfx2/sidebar/ControllerItem.hxx>
14
#include <sfx2/sidebar/IContextChangeReceiver.hxx>
15
#include <sfx2/sidebar/SidebarModelUpdate.hxx>
16
#include <sfx2/sidebar/PanelLayout.hxx>
17
#include <vcl/weld/CheckButton.hxx>
18
#include <vcl/weld/ComboBox.hxx>
19
#include <vcl/weld/FormattedSpinButton.hxx>
20
#include <vcl/weld/MetricSpinButton.hxx>
21
#include <vcl/weld/RadioButton.hxx>
22
#include "ChartSidebarModifyListener.hxx"
23
#include "ChartSidebarSelectionListener.hxx"
24
25
namespace com::sun::star::util { class XModifyListener; }
26
namespace com::sun::star::view { class XSelectionChangeListener; }
27
28
namespace chart {
29
30
class ChartController;
31
32
namespace sidebar {
33
34
class ChartAxisPanel : public PanelLayout,
35
    public ::sfx2::sidebar::IContextChangeReceiver,
36
    public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface,
37
    public sfx2::sidebar::SidebarModelUpdate,
38
    public ChartSidebarModifyListenerParent,
39
    public ChartSidebarSelectionListenerParent
40
{
41
public:
42
    static std::unique_ptr<PanelLayout> Create(
43
        weld::Widget* pParent,
44
        ChartController* pController);
45
46
    virtual void DataChanged(
47
        const DataChangedEvent& rEvent) override;
48
49
    virtual void HandleContextChange(
50
        const vcl::EnumContext& rContext) override;
51
52
    virtual void NotifyItemUpdate(
53
        const sal_uInt16 nSId,
54
        const SfxItemState eState,
55
        const SfxPoolItem* pState) override;
56
57
    virtual void GetControlState(
58
        const sal_uInt16 /*nSId*/,
59
0
        boost::property_tree::ptree& /*rState*/) override {};
60
61
    // constructor/destructor
62
    ChartAxisPanel(
63
        weld::Widget* pParent,
64
        ChartController* pController);
65
    virtual ~ChartAxisPanel() override;
66
67
    virtual void updateData() override;
68
    virtual void modelInvalid() override;
69
70
    virtual void selectionChanged(bool bCorrectType) override;
71
72
    virtual void updateModel(css::uno::Reference<css::frame::XModel> xModel) override;
73
74
private:
75
    //ui controls
76
    std::unique_ptr<weld::CheckButton> mxCBShowLabel;
77
    std::unique_ptr<weld::CheckButton> mxCBReverse;
78
    std::unique_ptr<weld::ComboBox> mxLBLabelPos;
79
    std::unique_ptr<weld::Widget> mxGridLabel;
80
    std::unique_ptr<weld::MetricSpinButton> mxNFRotation;
81
82
    std::unique_ptr<weld::Widget> mxBxHistogramBinning;
83
    std::unique_ptr<weld::RadioButton> mxRBHistogramAutomatic;
84
    std::unique_ptr<weld::RadioButton> mxRBHistogramBinWidth;
85
    std::unique_ptr<weld::FormattedSpinButton> mxHistogramBinWidth;
86
    std::unique_ptr<weld::RadioButton> mxRBHistogramBinCount;
87
    std::unique_ptr<weld::SpinButton> mxHistogramBinCount;
88
    std::unique_ptr<weld::CheckButton> mxCBHistogramOverflow;
89
    std::unique_ptr<weld::FormattedSpinButton> mxHistogramOverflow;
90
    std::unique_ptr<weld::CheckButton> mxCBHistogramUnderflow;
91
    std::unique_ptr<weld::FormattedSpinButton> mxHistogramUnderflow;
92
93
    rtl::Reference<::chart::ChartModel> mxModel;
94
    css::uno::Reference<css::util::XModifyListener> mxModifyListener;
95
    css::uno::Reference<css::view::XSelectionChangeListener> mxSelectionListener;
96
97
    bool mbModelValid;
98
    // True while the panel is writing widget values from the model.
99
    bool mbUpdating;
100
101
    void Initialize();
102
    void doUpdateModel(const rtl::Reference<::chart::ChartModel>& xModel);
103
    void updateHistogramControlSensitivity();
104
105
    DECL_LINK(CheckBoxHdl, weld::Toggleable&, void);
106
    DECL_LINK(ListBoxHdl, weld::ComboBox&, void);
107
    DECL_LINK(TextRotationHdl, weld::MetricSpinButton&, void);
108
    DECL_LINK(HistogramToggleHdl, weld::Toggleable&, void);
109
    DECL_LINK(HistogramValueHdl, weld::FormattedSpinButton&, void);
110
    DECL_LINK(HistogramBinCountHdl, weld::SpinButton&, void);
111
};
112
113
} } // end of namespace ::chart::sidebar
114
115
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */