Avoid potential negative array index access to cached text.
[LibreOffice.git] / chart2 / source / inc / ChartResourceGroups.hxx
blob9ae397d84f2f4002ca2958ab06f608b1057c8295
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #pragma once
22 #include "res_BarGeometry.hxx"
23 #include "ChangingResource.hxx"
24 #include "ChartTypeDialogController.hxx"
25 #include "ChartResourceGroupDlgs.hxx"
27 namespace chart
29 using namespace ::com::sun::star;
30 using namespace ::com::sun::star::chart2;
32 class SplinePropertiesDialog;
33 class SteppedPropertiesDialog;
35 enum
37 POS_3DSCHEME_SIMPLE = 0,
38 POS_3DSCHEME_REALISTIC = 1
41 class Dim3DLookResourceGroup final : public ChangingResource
43 public:
44 explicit Dim3DLookResourceGroup(weld::Builder* pBuilder);
46 void showControls(bool bShow);
48 void fillControls(const ChartTypeParameter& rParameter);
49 void fillParameter(ChartTypeParameter& rParameter);
51 private:
52 DECL_LINK(Dim3DLookCheckHdl, weld::Toggleable&, void);
53 DECL_LINK(SelectSchemeHdl, weld::ComboBox&, void);
55 private:
56 std::unique_ptr<weld::CheckButton> m_xCB_3DLook;
57 std::unique_ptr<weld::ComboBox> m_xLB_Scheme;
60 class SortByXValuesResourceGroup final : public ChangingResource
62 public:
63 explicit SortByXValuesResourceGroup(weld::Builder* pBuilder);
65 void showControls(bool bShow);
67 void fillControls(const ChartTypeParameter& rParameter);
68 void fillParameter(ChartTypeParameter& rParameter);
70 private:
71 DECL_LINK(SortByXValuesCheckHdl, weld::Toggleable&, void);
73 private:
74 std::unique_ptr<weld::CheckButton> m_xCB_XValueSorting;
77 class StackingResourceGroup final : public ChangingResource
79 public:
80 explicit StackingResourceGroup(weld::Builder* pBuilder);
82 void showControls(bool bShow);
84 void fillControls(const ChartTypeParameter& rParameter);
85 void fillParameter(ChartTypeParameter& rParameter);
87 private:
88 DECL_LINK(StackingChangeHdl, weld::Toggleable&, void);
89 DECL_LINK(StackingEnableHdl, weld::Toggleable&, void);
91 private:
92 std::unique_ptr<weld::CheckButton> m_xCB_Stacked;
93 std::unique_ptr<weld::RadioButton> m_xRB_Stack_Y;
94 std::unique_ptr<weld::RadioButton> m_xRB_Stack_Y_Percent;
95 std::unique_ptr<weld::RadioButton> m_xRB_Stack_Z;
98 #define POS_LINETYPE_STRAIGHT 0
99 #define POS_LINETYPE_SMOOTH 1
100 #define POS_LINETYPE_STEPPED 2
102 class SplineResourceGroup final : public ChangingResource
104 public:
105 explicit SplineResourceGroup(weld::Builder* pBuilder, weld::Window* pParent);
107 void showControls(bool bShow);
109 void fillControls(const ChartTypeParameter& rParameter);
110 void fillParameter(ChartTypeParameter& rParameter);
112 private:
113 DECL_LINK(LineTypeChangeHdl, weld::ComboBox&, void);
114 DECL_LINK(SplineDetailsDialogHdl, weld::Button&, void);
115 DECL_LINK(SteppedDetailsDialogHdl, weld::Button&, void);
116 std::shared_ptr<SplinePropertiesDialog> getSplinePropertiesDialog();
117 std::shared_ptr<SteppedPropertiesDialog> getSteppedPropertiesDialog();
119 private:
120 weld::Window* m_pParent;
121 std::unique_ptr<weld::Label> m_xFT_LineType;
122 std::unique_ptr<weld::ComboBox> m_xLB_LineType;
123 std::unique_ptr<weld::Button> m_xPB_DetailsDialog;
124 std::shared_ptr<SplinePropertiesDialog> m_xSplinePropertiesDialog;
125 std::shared_ptr<SteppedPropertiesDialog> m_xSteppedPropertiesDialog;
128 class GeometryResourceGroup final : public ChangingResource
130 public:
131 explicit GeometryResourceGroup(weld::Builder* pBuilder);
133 void showControls(bool bShow);
135 void fillControls(const ChartTypeParameter& rParameter);
136 void fillParameter(ChartTypeParameter& rParameter);
138 private:
139 DECL_LINK(GeometryChangeHdl, weld::TreeView&, void);
141 private:
142 BarGeometryResources m_aGeometryResources;
145 } //namespace chart
147 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */