Debian Codegraph @

chart2/source/controller/sidebar/ChartErrorBarPanel.hxx

raw
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 "ChartSidebarModifyListener.hxx"
18
19 namespace com::sun::star::util { class XModifyListener; }
20
21 namespace chart {
22
23 class ChartController;
24 class ChartModel;
25
26 namespace sidebar {
27
28 class ChartErrorBarPanel : public PanelLayout,
29 public ::sfx2::sidebar::IContextChangeReceiver,
30 public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface,
31 public sfx2::sidebar::SidebarModelUpdate,
32 public ChartSidebarModifyListenerParent
33 {
34 public:
35 static std::unique_ptr<PanelLayout> Create(
36 weld::Widget* pParent,
37 ChartController* pController);
38
39 virtual void DataChanged(
40 const DataChangedEvent& rEvent) override;
41
42 virtual void HandleContextChange(
43 const vcl::EnumContext& rContext) override;
44
45 virtual void NotifyItemUpdate(
46 const sal_uInt16 nSId,
47 const SfxItemState eState,
48 const SfxPoolItem* pState) override;
49
50 virtual void GetControlState(
51 const sal_uInt16 /*nSId*/,
52 boost::property_tree::ptree& /*rState*/) override {};
53
54 // constructor/destructor
55 ChartErrorBarPanel(
56 weld::Widget* pParent,
57 ChartController* pController);
58 virtual ~ChartErrorBarPanel() override;
59
60 virtual void updateData() override;
61 virtual void modelInvalid() override;
62
63 virtual void updateModel(css::uno::Reference<css::frame::XModel> xModel) override;
64
65 private:
66 //ui controls
67 std::unique_ptr<weld::RadioButton> mxRBPosAndNeg;
68 std::unique_ptr<weld::RadioButton> mxRBPos;
69 std::unique_ptr<weld::RadioButton> mxRBNeg;
70
71 std::unique_ptr<weld::ComboBox> mxLBType;
72
73 std::unique_ptr<weld::SpinButton> mxMFPos;
74 std::unique_ptr<weld::SpinButton> mxMFNeg;
75
76 rtl::Reference<::chart::ChartModel> mxModel;
77 css::uno::Reference<css::util::XModifyListener> mxListener;
78
79 bool mbModelValid;
80
81 void Initialize();
82 void doUpdateModel(const rtl::Reference<::chart::ChartModel>& xModel);
83
84 DECL_LINK(RadioBtnHdl, weld::Toggleable&, void);
85 DECL_LINK(ListBoxHdl, weld::ComboBox&, void);
86 DECL_LINK(NumericFieldHdl, weld::SpinButton&, void);
87 };
88
89 } } // end of namespace ::chart::sidebar
90
91 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */