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