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