1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
22 #include <tools/link.hxx>
23 #include <svl/itemset.hxx>
24 #include <svx/chrtitem.hxx>
25 #include "RangeSelectionListener.hxx"
27 namespace com::sun::star::chart2
{ class XChartDocument
; }
28 namespace weld
{ class Builder
; }
29 namespace weld
{ class Button
; }
30 namespace weld
{ class CheckButton
; }
31 namespace weld
{ class ComboBox
; }
32 namespace weld
{ class DialogController
; }
33 namespace weld
{ class Entry
; }
34 namespace weld
{ class Frame
; }
35 namespace weld
{ class Image
; }
36 namespace weld
{ class Label
; }
37 namespace weld
{ class MetricSpinButton
; }
38 namespace weld
{ class RadioButton
; }
39 namespace weld
{ class ToggleButton
; }
40 namespace weld
{ class Widget
; }
45 class RangeSelectionHelper
;
47 class ErrorBarResources
: public RangeSelectionListenerParent
57 weld::Builder
* pParent
, weld::DialogController
* pControllerDialog
, const SfxItemSet
& rInAttrs
, bool bNoneAvailable
, chart::ErrorBarResources::tErrorBarType eType
= ERROR_BAR_Y
);
58 virtual ~ErrorBarResources();
60 void SetAxisMinorStepWidthForErrorBarDecimals( double fMinorStepWidth
);
61 void SetErrorBarType( tErrorBarType eNewType
);
62 void SetChartDocumentForRangeChoosing(
63 const css::uno::Reference
< css::chart2::XChartDocument
> & xChartDocument
);
64 void Reset(const SfxItemSet
& rInAttrs
);
65 void FillItemSet(SfxItemSet
& rOutAttrs
) const;
69 // ____ RangeSelectionListenerParent ____
70 virtual void listeningFinished( const OUString
& rNewRange
) override
;
71 virtual void disposingRangeSelection() override
;
74 SvxChartKindError m_eErrorKind
;
75 SvxChartIndicate m_eIndicate
;
77 bool m_bErrorKindUnique
;
78 bool m_bIndicatorUnique
;
79 bool m_bRangePosUnique
;
80 bool m_bRangeNegUnique
;
82 tErrorBarType m_eErrorBarType
;
83 sal_uInt16 m_nConstDecimalDigits
;
84 sal_Int64 m_nConstSpinSize
;
88 weld::DialogController
* m_pController
;
89 std::unique_ptr
< RangeSelectionHelper
> m_apRangeSelectionHelper
;
90 weld::Entry
* m_pCurrentRangeChoosingField
;
91 bool m_bHasInternalDataProvider
;
92 bool m_bEnableDataTableDialog
;
96 std::unique_ptr
<weld::RadioButton
> m_xRbNone
;
97 std::unique_ptr
<weld::RadioButton
> m_xRbConst
;
98 std::unique_ptr
<weld::RadioButton
> m_xRbPercent
;
99 std::unique_ptr
<weld::RadioButton
> m_xRbFunction
;
100 std::unique_ptr
<weld::RadioButton
> m_xRbRange
;
101 std::unique_ptr
<weld::ComboBox
> m_xLbFunction
;
104 std::unique_ptr
<weld::Frame
> m_xFlParameters
;
105 std::unique_ptr
<weld::Widget
> m_xBxPositive
;
106 std::unique_ptr
<weld::MetricSpinButton
> m_xMfPositive
;
107 std::unique_ptr
<weld::Entry
> m_xEdRangePositive
;
108 std::unique_ptr
<weld::Button
> m_xIbRangePositive
;
109 std::unique_ptr
<weld::Widget
> m_xBxNegative
;
110 std::unique_ptr
<weld::MetricSpinButton
> m_xMfNegative
;
111 std::unique_ptr
<weld::Entry
> m_xEdRangeNegative
;
112 std::unique_ptr
<weld::Button
> m_xIbRangeNegative
;
113 std::unique_ptr
<weld::CheckButton
> m_xCbSyncPosNeg
;
116 std::unique_ptr
<weld::RadioButton
> m_xRbBoth
;
117 std::unique_ptr
<weld::RadioButton
> m_xRbPositive
;
118 std::unique_ptr
<weld::RadioButton
> m_xRbNegative
;
119 std::unique_ptr
<weld::Image
> m_xFiBoth
;
120 std::unique_ptr
<weld::Image
> m_xFiPositive
;
121 std::unique_ptr
<weld::Image
> m_xFiNegative
;
123 std::unique_ptr
<weld::Label
> m_xUIStringPos
;
124 std::unique_ptr
<weld::Label
> m_xUIStringNeg
;
125 std::unique_ptr
<weld::Label
> m_xUIStringRbRange
;
127 DECL_LINK( CategoryChosen
, weld::ToggleButton
&, void );
128 DECL_LINK( CategoryChosen2
, weld::ComboBox
&, void );
129 DECL_LINK( SynchronizePosAndNeg
, weld::ToggleButton
&, void );
130 DECL_LINK( PosValueChanged
, weld::MetricSpinButton
&, void );
131 DECL_LINK( IndicatorChanged
, weld::ToggleButton
&, void );
132 DECL_LINK( ChooseRange
, weld::Button
&, void );
133 DECL_LINK( RangeChanged
, weld::Entry
&, void );
135 void UpdateControlStates();
136 void isRangeFieldContentValid(weld::Entry
& rEdit
);
141 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */