merged tag ooo/OOO330_m14
[LibreOffice.git] / chart2 / source / controller / inc / res_ErrorBar.hxx
blob0b5f33b5c1283ea66da01c0c1d4a99544f7d1765
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
27 #ifndef CHART2_RES_ERRORBAR_HXX
28 #define CHART2_RES_ERRORBAR_HXX
30 #include <vcl/button.hxx>
31 #include <vcl/fixed.hxx>
32 #include <vcl/field.hxx>
33 #include <vcl/lstbox.hxx>
34 #include <svtools/valueset.hxx>
35 #include <svl/itemset.hxx>
36 #include <svx/chrtitem.hxx>
37 #include "chartview/ChartSfxItemIds.hxx"
38 #include "RangeSelectionButton.hxx"
39 #include "RangeSelectionListener.hxx"
40 #include "RangeEdit.hxx"
42 #include <com/sun/star/chart2/XChartDocument.hpp>
44 #include <memory>
46 class Dialog;
48 //.............................................................................
49 namespace chart
51 //.............................................................................
53 class RangeSelectionHelper;
55 class ErrorBarResources : public RangeSelectionListenerParent
57 public:
58 enum tErrorBarType
60 ERROR_BAR_X,
61 ERROR_BAR_Y
64 ErrorBarResources(
65 Window* pParent, Dialog * pParentDialog, const SfxItemSet& rInAttrst,
66 bool bNoneAvailable,
67 tErrorBarType eType = ERROR_BAR_Y );
68 virtual ~ErrorBarResources();
70 void SetAxisMinorStepWidthForErrorBarDecimals( double fMinorStepWidth );
71 void SetErrorBarType( tErrorBarType eNewType );
72 void SetChartDocumentForRangeChoosing(
73 const ::com::sun::star::uno::Reference<
74 ::com::sun::star::chart2::XChartDocument > & xChartDocument );
75 void Reset(const SfxItemSet& rInAttrs);
76 BOOL FillItemSet(SfxItemSet& rOutAttrs) const;
78 void FillValueSets();
80 // ____ RangeSelectionListenerParent ____
81 virtual void listeningFinished( const ::rtl::OUString & rNewRange );
82 virtual void disposingRangeSelection();
84 private:
85 // category
86 FixedLine m_aFlErrorCategory;
87 RadioButton m_aRbNone;
88 RadioButton m_aRbConst;
89 RadioButton m_aRbPercent;
90 RadioButton m_aRbFunction;
91 RadioButton m_aRbRange;
92 ListBox m_aLbFunction;
94 // parameters
95 FixedLine m_aFlParameters;
96 FixedText m_aFtPositive;
97 MetricField m_aMfPositive;
98 RangeEdit m_aEdRangePositive;
99 RangeSelectionButton m_aIbRangePositive;
100 FixedText m_aFtNegative;
101 MetricField m_aMfNegative;
102 RangeEdit m_aEdRangeNegative;
103 RangeSelectionButton m_aIbRangeNegative;
104 CheckBox m_aCbSyncPosNeg;
106 // indicator
107 FixedLine m_aFlIndicate;
108 RadioButton m_aRbBoth;
109 RadioButton m_aRbPositive;
110 RadioButton m_aRbNegative;
111 FixedImage m_aFiBoth;
112 FixedImage m_aFiPositive;
113 FixedImage m_aFiNegative;
115 SvxChartKindError m_eErrorKind;
116 SvxChartIndicate m_eIndicate;
117 SvxChartRegress m_eTrendLineType;
119 bool m_bErrorKindUnique;
120 bool m_bIndicatorUnique;
121 bool m_bPlusUnique;
122 bool m_bMinusUnique;
123 bool m_bRangePosUnique;
124 bool m_bRangeNegUnique;
126 bool m_bNoneAvailable;
128 tErrorBarType m_eErrorBarType;
129 sal_uInt16 m_nConstDecimalDigits;
130 sal_Int64 m_nConstSpinSize;
132 Window * m_pParentWindow;
133 Dialog * m_pParentDialog;
134 ::std::auto_ptr< RangeSelectionHelper >
135 m_apRangeSelectionHelper;
136 Edit * m_pCurrentRangeChoosingField;
137 bool m_bHasInternalDataProvider;
138 bool m_bDisableDataTableDialog;
140 DECL_LINK( CategoryChosen, void * );
141 DECL_LINK( SynchronizePosAndNeg, void * );
142 DECL_LINK( PosValueChanged, void * );
143 DECL_LINK( IndicatorChanged, void * );
144 DECL_LINK( ChooseRange, RangeSelectionButton * );
145 DECL_LINK( RangeChanged, Edit * );
147 void UpdateControlStates();
148 bool isRangeFieldContentValid( Edit & rEdit );
151 //.............................................................................
152 } //namespace chart
153 //.............................................................................
155 #endif