Debian Codegraph @

chart2/source/controller/sidebar/ChartTypePanel.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 * 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/IContextChangeReceiver.hxx>
22 #include <sfx2/sidebar/SidebarModelUpdate.hxx>
23 #include <sfx2/sidebar/PanelLayout.hxx>
24 #include <vcl/EnumContext.hxx>
25 #include "ChartSidebarModifyListener.hxx"
26 #include <ChartTypeDialogController.hxx>
27 #include <ChartTypeTemplateProvider.hxx>
28 #include <TimerTriggeredControllerLock.hxx>
29
30 namespace com::sun::star::util
31 {
32 class XModifyListener;
33 }
34
35 namespace weld
36 {
37 class CustomWeld;
38 }
39
40 namespace chart
41 {
42 class ChartController;
43 class Dim3DLookResourceGroup;
44 class StackingResourceGroup;
45 class SplineResourceGroup;
46 class GeometryResourceGroup;
47 class ChartTypeParameter;
48 class SortByXValuesResourceGroup;
49
50 namespace sidebar
51 {
52 class ChartTypePanel : public ResourceChangeListener,
53 public PanelLayout,
54 public ::sfx2::sidebar::IContextChangeReceiver,
55 public sfx2::sidebar::SidebarModelUpdate,
56 public ChartSidebarModifyListenerParent,
57 public ChartTypeTemplateProvider
58 {
59 public:
60 virtual void DataChanged(const DataChangedEvent& rEvent) override;
61
62 virtual void HandleContextChange(const vcl::EnumContext& rContext) override;
63
64 // constructor/destructor
65 ChartTypePanel(weld::Widget* pParent, ::chart::ChartController* pController);
66
67 virtual ~ChartTypePanel() override;
68
69 virtual void updateData() override;
70 virtual void modelInvalid() override;
71
72 virtual void updateModel(css::uno::Reference<css::frame::XModel> xModel) override;
73
74 virtual rtl::Reference<::chart::ChartTypeTemplate> getCurrentTemplate() const override;
75
76 private:
77 ChartTypeDialogController* getSelectedMainType();
78 void showAllControls(ChartTypeDialogController& rTypeController);
79 void fillAllControls(const ChartTypeParameter& rParameter, bool bAlsoResetSubTypeList = true);
80 ChartTypeParameter getCurrentParameter() const;
81
82 virtual void stateChanged() override;
83
84 void commitToModel(const ChartTypeParameter& rParameter);
85 void selectMainType();
86
87 DECL_LINK(SelectMainTypeHdl, weld::ComboBox&, void);
88 DECL_LINK(SelectSubTypeHdl, ValueSet*, void);
89
90 vcl::EnumContext maContext;
91
92 css::uno::Reference<css::util::XModifyListener> mxListener;
93
94 bool mbModelValid;
95
96 void Initialize();
97 void doUpdateModel(const rtl::Reference<::chart::ChartModel>& xModel);
98
99 std::unique_ptr<Dim3DLookResourceGroup> m_pDim3DLookResourceGroup;
100 std::unique_ptr<StackingResourceGroup> m_pStackingResourceGroup;
101 std::unique_ptr<SplineResourceGroup> m_pSplineResourceGroup;
102 std::unique_ptr<GeometryResourceGroup> m_pGeometryResourceGroup;
103 std::unique_ptr<SortByXValuesResourceGroup> m_pSortByXValuesResourceGroup;
104
105 rtl::Reference<::chart::ChartModel> m_xChartModel;
106
107 std::vector<std::unique_ptr<ChartTypeDialogController>> m_aChartTypeDialogControllerList;
108 ChartTypeDialogController* m_pCurrentMainType;
109
110 sal_Int32 m_nChangingCalls;
111
112 TimerTriggeredControllerLock m_aTimerTriggeredControllerLock;
113
114 std::unique_ptr<weld::ComboBox> m_xMainTypeList;
115 std::unique_ptr<ValueSet> m_xSubTypeList;
116 std::unique_ptr<weld::CustomWeld> m_xSubTypeListWin;
117 };
118 }
119 } // end of namespace ::chart::sidebar
120
121 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */