Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / chart2 / source / controller / inc / res_ErrorBar.hxx
blob18fc12362663d856d3791ac61dc66e9eae84833d
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 .
19 #ifndef INCLUDED_CHART2_SOURCE_CONTROLLER_INC_RES_ERRORBAR_HXX
20 #define INCLUDED_CHART2_SOURCE_CONTROLLER_INC_RES_ERRORBAR_HXX
22 #include <memory>
23 #include <tools/link.hxx>
24 #include <svl/itemset.hxx>
25 #include <svx/chrtitem.hxx>
26 #include "RangeSelectionListener.hxx"
28 namespace com { namespace sun { namespace star { namespace chart2 { class XChartDocument; } } } }
29 namespace weld { class Builder; }
30 namespace weld { class Button; }
31 namespace weld { class CheckButton; }
32 namespace weld { class ComboBox; }
33 namespace weld { class DialogController; }
34 namespace weld { class Entry; }
35 namespace weld { class Frame; }
36 namespace weld { class Image; }
37 namespace weld { class Label; }
38 namespace weld { class MetricSpinButton; }
39 namespace weld { class RadioButton; }
40 namespace weld { class ToggleButton; }
41 namespace weld { class Widget; }
43 namespace chart
46 class RangeSelectionHelper;
48 class ErrorBarResources : public RangeSelectionListenerParent
50 public:
51 enum tErrorBarType
53 ERROR_BAR_X,
54 ERROR_BAR_Y
57 ErrorBarResources(
58 weld::Builder* pParent, weld::DialogController* pControllerDialog, const SfxItemSet& rInAttrs, bool bNoneAvailable, chart::ErrorBarResources::tErrorBarType eType = ERROR_BAR_Y);
59 virtual ~ErrorBarResources();
61 void SetAxisMinorStepWidthForErrorBarDecimals( double fMinorStepWidth );
62 void SetErrorBarType( tErrorBarType eNewType );
63 void SetChartDocumentForRangeChoosing(
64 const css::uno::Reference< css::chart2::XChartDocument > & xChartDocument );
65 void Reset(const SfxItemSet& rInAttrs);
66 void FillItemSet(SfxItemSet& rOutAttrs) const;
68 void FillValueSets();
70 // ____ RangeSelectionListenerParent ____
71 virtual void listeningFinished( const OUString & rNewRange ) override;
72 virtual void disposingRangeSelection() override;
74 private:
75 SvxChartKindError m_eErrorKind;
76 SvxChartIndicate m_eIndicate;
78 bool m_bErrorKindUnique;
79 bool m_bIndicatorUnique;
80 bool m_bRangePosUnique;
81 bool m_bRangeNegUnique;
83 tErrorBarType m_eErrorBarType;
84 sal_uInt16 m_nConstDecimalDigits;
85 sal_Int64 m_nConstSpinSize;
86 double m_fPlusValue;
87 double m_fMinusValue;
89 weld::DialogController* m_pController;
90 std::unique_ptr< RangeSelectionHelper > m_apRangeSelectionHelper;
91 weld::Entry* m_pCurrentRangeChoosingField;
92 bool m_bHasInternalDataProvider;
93 bool m_bEnableDataTableDialog;
96 // category
97 std::unique_ptr<weld::RadioButton> m_xRbNone;
98 std::unique_ptr<weld::RadioButton> m_xRbConst;
99 std::unique_ptr<weld::RadioButton> m_xRbPercent;
100 std::unique_ptr<weld::RadioButton> m_xRbFunction;
101 std::unique_ptr<weld::RadioButton> m_xRbRange;
102 std::unique_ptr<weld::ComboBox> m_xLbFunction;
104 // parameters
105 std::unique_ptr<weld::Frame> m_xFlParameters;
106 std::unique_ptr<weld::Widget> m_xBxPositive;
107 std::unique_ptr<weld::MetricSpinButton> m_xMfPositive;
108 std::unique_ptr<weld::Entry> m_xEdRangePositive;
109 std::unique_ptr<weld::Button> m_xIbRangePositive;
110 std::unique_ptr<weld::Widget> m_xBxNegative;
111 std::unique_ptr<weld::MetricSpinButton> m_xMfNegative;
112 std::unique_ptr<weld::Entry> m_xEdRangeNegative;
113 std::unique_ptr<weld::Button> m_xIbRangeNegative;
114 std::unique_ptr<weld::CheckButton> m_xCbSyncPosNeg;
116 // indicator
117 std::unique_ptr<weld::RadioButton> m_xRbBoth;
118 std::unique_ptr<weld::RadioButton> m_xRbPositive;
119 std::unique_ptr<weld::RadioButton> m_xRbNegative;
120 std::unique_ptr<weld::Image> m_xFiBoth;
121 std::unique_ptr<weld::Image> m_xFiPositive;
122 std::unique_ptr<weld::Image> m_xFiNegative;
124 std::unique_ptr<weld::Label> m_xUIStringPos;
125 std::unique_ptr<weld::Label> m_xUIStringNeg;
126 std::unique_ptr<weld::Label> m_xUIStringRbRange;
128 DECL_LINK( CategoryChosen, weld::ToggleButton&, void );
129 DECL_LINK( CategoryChosen2, weld::ComboBox&, void );
130 DECL_LINK( SynchronizePosAndNeg, weld::ToggleButton&, void );
131 DECL_LINK( PosValueChanged, weld::MetricSpinButton&, void );
132 DECL_LINK( IndicatorChanged, weld::ToggleButton&, void );
133 DECL_LINK( ChooseRange, weld::Button&, void );
134 DECL_LINK( RangeChanged, weld::Entry&, void );
136 void UpdateControlStates();
137 void isRangeFieldContentValid(weld::Entry& rEdit);
140 } //namespace chart
142 #endif
144 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */