Debian Codegraph @

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