/src/libreoffice/chart2/source/controller/sidebar/ChartSeriesPanel.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 | | * 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 | | |
21 | | #include <sfx2/sidebar/ControllerItem.hxx> |
22 | | #include <sfx2/sidebar/IContextChangeReceiver.hxx> |
23 | | #include <sfx2/sidebar/SidebarModelUpdate.hxx> |
24 | | #include <sfx2/sidebar/PanelLayout.hxx> |
25 | | #include <vcl/weld/CheckButton.hxx> |
26 | | #include <vcl/weld/ComboBox.hxx> |
27 | | #include <vcl/weld/Label.hxx> |
28 | | #include <vcl/weld/RadioButton.hxx> |
29 | | |
30 | | #include "ChartSidebarModifyListener.hxx" |
31 | | #include "ChartSidebarSelectionListener.hxx" |
32 | | |
33 | | namespace com::sun::star::util { class XModifyListener; } |
34 | | namespace com::sun::star::view { class XSelectionChangeListener; } |
35 | | |
36 | | namespace chart { |
37 | | |
38 | | class ChartController; |
39 | | |
40 | | namespace sidebar { |
41 | | |
42 | | class ChartSeriesPanel : public PanelLayout, |
43 | | public ::sfx2::sidebar::IContextChangeReceiver, |
44 | | public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface, |
45 | | public sfx2::sidebar::SidebarModelUpdate, |
46 | | public ChartSidebarModifyListenerParent, |
47 | | public ChartSidebarSelectionListenerParent |
48 | | { |
49 | | public: |
50 | | static std::unique_ptr<PanelLayout> Create( |
51 | | weld::Widget* pParent, |
52 | | ChartController* pController); |
53 | | |
54 | | virtual void DataChanged( |
55 | | const DataChangedEvent& rEvent) override; |
56 | | |
57 | | virtual void HandleContextChange( |
58 | | const vcl::EnumContext& rContext) override; |
59 | | |
60 | | virtual void NotifyItemUpdate( |
61 | | const sal_uInt16 nSId, |
62 | | const SfxItemState eState, |
63 | | const SfxPoolItem* pState) override; |
64 | | |
65 | | virtual void GetControlState( |
66 | | const sal_uInt16 /*nSId*/, |
67 | 0 | boost::property_tree::ptree& /*rState*/) override {}; |
68 | | |
69 | | // constructor/destructor |
70 | | ChartSeriesPanel( |
71 | | weld::Widget* pParent, |
72 | | ChartController* pController); |
73 | | virtual ~ChartSeriesPanel() override; |
74 | | |
75 | | virtual void updateData() override; |
76 | | virtual void modelInvalid() override; |
77 | | |
78 | | virtual void selectionChanged(bool bCorrectType) override; |
79 | | |
80 | | virtual void updateModel(css::uno::Reference<css::frame::XModel> xModel) override; |
81 | | |
82 | | private: |
83 | | //ui controls |
84 | | std::unique_ptr<weld::CheckButton> mxCBLabel; |
85 | | std::unique_ptr<weld::CheckButton> mxCBTrendline; |
86 | | std::unique_ptr<weld::CheckButton> mxCBXError; |
87 | | std::unique_ptr<weld::CheckButton> mxCBYError; |
88 | | |
89 | | std::unique_ptr<weld::RadioButton> mxRBPrimaryAxis; |
90 | | std::unique_ptr<weld::RadioButton> mxRBSecondaryAxis; |
91 | | |
92 | | std::unique_ptr<weld::Widget> mxBoxLabelPlacement; |
93 | | std::unique_ptr<weld::ComboBox> mxLBLabelPlacement; |
94 | | |
95 | | std::unique_ptr<weld::Label> mxFTSeriesName; |
96 | | std::unique_ptr<weld::Label> mxFTSeriesTemplate; |
97 | | |
98 | | rtl::Reference<::chart::ChartModel> mxModel; |
99 | | css::uno::Reference<css::util::XModifyListener> mxListener; |
100 | | css::uno::Reference<css::view::XSelectionChangeListener> mxSelectionListener; |
101 | | |
102 | | bool mbModelValid; |
103 | | |
104 | | void Initialize(); |
105 | | void doUpdateModel(const rtl::Reference<::chart::ChartModel>& xModel); |
106 | | |
107 | | DECL_LINK(CheckBoxHdl, weld::Toggleable&, void); |
108 | | DECL_LINK(RadioBtnHdl, weld::Toggleable&, void); |
109 | | DECL_LINK(ListBoxHdl, weld::ComboBox&, void); |
110 | | }; |
111 | | |
112 | | } } // end of namespace ::chart::sidebar |
113 | | |
114 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |