1*de7b3f82SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*de7b3f82SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*de7b3f82SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*de7b3f82SAndrew Rist  * distributed with this work for additional information
6*de7b3f82SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*de7b3f82SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*de7b3f82SAndrew Rist  * "License"); you may not use this file except in compliance
9*de7b3f82SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*de7b3f82SAndrew Rist  *
11*de7b3f82SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*de7b3f82SAndrew Rist  *
13*de7b3f82SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*de7b3f82SAndrew Rist  * software distributed under the License is distributed on an
15*de7b3f82SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*de7b3f82SAndrew Rist  * KIND, either express or implied.  See the License for the
17*de7b3f82SAndrew Rist  * specific language governing permissions and limitations
18*de7b3f82SAndrew Rist  * under the License.
19*de7b3f82SAndrew Rist  *
20*de7b3f82SAndrew Rist  *************************************************************/
21*de7b3f82SAndrew Rist 
22*de7b3f82SAndrew Rist 
23cdf0e10cSrcweir #ifndef CHART2_RES_ERRORBAR_HXX
24cdf0e10cSrcweir #define CHART2_RES_ERRORBAR_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include <vcl/button.hxx>
27cdf0e10cSrcweir #include <vcl/fixed.hxx>
28cdf0e10cSrcweir #include <vcl/field.hxx>
29cdf0e10cSrcweir #include <vcl/lstbox.hxx>
30cdf0e10cSrcweir #include <svtools/valueset.hxx>
31cdf0e10cSrcweir #include <svl/itemset.hxx>
32cdf0e10cSrcweir #include <svx/chrtitem.hxx>
33cdf0e10cSrcweir #include "chartview/ChartSfxItemIds.hxx"
34cdf0e10cSrcweir #include "RangeSelectionButton.hxx"
35cdf0e10cSrcweir #include "RangeSelectionListener.hxx"
36cdf0e10cSrcweir #include "RangeEdit.hxx"
37cdf0e10cSrcweir 
38cdf0e10cSrcweir #include <com/sun/star/chart2/XChartDocument.hpp>
39cdf0e10cSrcweir 
40cdf0e10cSrcweir #include <memory>
41cdf0e10cSrcweir 
42cdf0e10cSrcweir class Dialog;
43cdf0e10cSrcweir 
44cdf0e10cSrcweir //.............................................................................
45cdf0e10cSrcweir namespace chart
46cdf0e10cSrcweir {
47cdf0e10cSrcweir //.............................................................................
48cdf0e10cSrcweir 
49cdf0e10cSrcweir class RangeSelectionHelper;
50cdf0e10cSrcweir 
51cdf0e10cSrcweir class ErrorBarResources : public RangeSelectionListenerParent
52cdf0e10cSrcweir {
53cdf0e10cSrcweir public:
54cdf0e10cSrcweir     enum tErrorBarType
55cdf0e10cSrcweir     {
56cdf0e10cSrcweir         ERROR_BAR_X,
57cdf0e10cSrcweir         ERROR_BAR_Y
58cdf0e10cSrcweir     };
59cdf0e10cSrcweir 
60cdf0e10cSrcweir     ErrorBarResources(
61cdf0e10cSrcweir         Window* pParent, Dialog * pParentDialog, const SfxItemSet& rInAttrst,
62cdf0e10cSrcweir         bool bNoneAvailable,
63cdf0e10cSrcweir         tErrorBarType eType = ERROR_BAR_Y );
64cdf0e10cSrcweir     virtual ~ErrorBarResources();
65cdf0e10cSrcweir 
66cdf0e10cSrcweir     void SetAxisMinorStepWidthForErrorBarDecimals( double fMinorStepWidth );
67cdf0e10cSrcweir     void SetErrorBarType( tErrorBarType eNewType );
68cdf0e10cSrcweir     void SetChartDocumentForRangeChoosing(
69cdf0e10cSrcweir         const ::com::sun::star::uno::Reference<
70cdf0e10cSrcweir             ::com::sun::star::chart2::XChartDocument > & xChartDocument );
71cdf0e10cSrcweir     void Reset(const SfxItemSet& rInAttrs);
72cdf0e10cSrcweir     sal_Bool FillItemSet(SfxItemSet& rOutAttrs) const;
73cdf0e10cSrcweir 
74cdf0e10cSrcweir     void FillValueSets();
75cdf0e10cSrcweir 
76cdf0e10cSrcweir     // ____ RangeSelectionListenerParent ____
77cdf0e10cSrcweir     virtual void listeningFinished( const ::rtl::OUString & rNewRange );
78cdf0e10cSrcweir     virtual void disposingRangeSelection();
79cdf0e10cSrcweir 
80cdf0e10cSrcweir private:
81cdf0e10cSrcweir     // category
82cdf0e10cSrcweir     FixedLine            m_aFlErrorCategory;
83cdf0e10cSrcweir     RadioButton          m_aRbNone;
84cdf0e10cSrcweir     RadioButton          m_aRbConst;
85cdf0e10cSrcweir     RadioButton          m_aRbPercent;
86cdf0e10cSrcweir     RadioButton          m_aRbFunction;
87cdf0e10cSrcweir     RadioButton          m_aRbRange;
88cdf0e10cSrcweir     ListBox              m_aLbFunction;
89cdf0e10cSrcweir 
90cdf0e10cSrcweir     // parameters
91cdf0e10cSrcweir     FixedLine            m_aFlParameters;
92cdf0e10cSrcweir     FixedText            m_aFtPositive;
93cdf0e10cSrcweir     MetricField          m_aMfPositive;
94cdf0e10cSrcweir     RangeEdit            m_aEdRangePositive;
95cdf0e10cSrcweir     RangeSelectionButton m_aIbRangePositive;
96cdf0e10cSrcweir     FixedText            m_aFtNegative;
97cdf0e10cSrcweir     MetricField          m_aMfNegative;
98cdf0e10cSrcweir     RangeEdit            m_aEdRangeNegative;
99cdf0e10cSrcweir     RangeSelectionButton m_aIbRangeNegative;
100cdf0e10cSrcweir     CheckBox             m_aCbSyncPosNeg;
101cdf0e10cSrcweir 
102cdf0e10cSrcweir     // indicator
103cdf0e10cSrcweir     FixedLine            m_aFlIndicate;
104cdf0e10cSrcweir     RadioButton          m_aRbBoth;
105cdf0e10cSrcweir     RadioButton          m_aRbPositive;
106cdf0e10cSrcweir     RadioButton          m_aRbNegative;
107cdf0e10cSrcweir     FixedImage           m_aFiBoth;
108cdf0e10cSrcweir     FixedImage           m_aFiPositive;
109cdf0e10cSrcweir     FixedImage           m_aFiNegative;
110cdf0e10cSrcweir 
111cdf0e10cSrcweir     SvxChartKindError    m_eErrorKind;
112cdf0e10cSrcweir     SvxChartIndicate     m_eIndicate;
113cdf0e10cSrcweir     SvxChartRegress      m_eTrendLineType;
114cdf0e10cSrcweir 
115cdf0e10cSrcweir     bool                 m_bErrorKindUnique;
116cdf0e10cSrcweir     bool                 m_bIndicatorUnique;
117cdf0e10cSrcweir     bool                 m_bPlusUnique;
118cdf0e10cSrcweir     bool                 m_bMinusUnique;
119cdf0e10cSrcweir     bool                 m_bRangePosUnique;
120cdf0e10cSrcweir     bool                 m_bRangeNegUnique;
121cdf0e10cSrcweir 
122cdf0e10cSrcweir     bool                 m_bNoneAvailable;
123cdf0e10cSrcweir 
124cdf0e10cSrcweir     tErrorBarType        m_eErrorBarType;
125cdf0e10cSrcweir     sal_uInt16           m_nConstDecimalDigits;
126cdf0e10cSrcweir     sal_Int64            m_nConstSpinSize;
127cdf0e10cSrcweir 
128cdf0e10cSrcweir     Window *             m_pParentWindow;
129cdf0e10cSrcweir     Dialog *             m_pParentDialog;
130cdf0e10cSrcweir     ::std::auto_ptr< RangeSelectionHelper >
131cdf0e10cSrcweir                          m_apRangeSelectionHelper;
132cdf0e10cSrcweir     Edit *               m_pCurrentRangeChoosingField;
133cdf0e10cSrcweir     bool                 m_bHasInternalDataProvider;
134cdf0e10cSrcweir     bool                 m_bDisableDataTableDialog;
135cdf0e10cSrcweir 
136cdf0e10cSrcweir     DECL_LINK( CategoryChosen, void * );
137cdf0e10cSrcweir     DECL_LINK( SynchronizePosAndNeg, void * );
138cdf0e10cSrcweir     DECL_LINK( PosValueChanged, void * );
139cdf0e10cSrcweir     DECL_LINK( IndicatorChanged, void * );
140cdf0e10cSrcweir     DECL_LINK( ChooseRange, RangeSelectionButton * );
141cdf0e10cSrcweir     DECL_LINK( RangeChanged, Edit * );
142cdf0e10cSrcweir 
143cdf0e10cSrcweir     void UpdateControlStates();
144cdf0e10cSrcweir     bool isRangeFieldContentValid( Edit & rEdit );
145cdf0e10cSrcweir };
146cdf0e10cSrcweir 
147cdf0e10cSrcweir //.............................................................................
148cdf0e10cSrcweir } //namespace chart
149cdf0e10cSrcweir //.............................................................................
150cdf0e10cSrcweir 
151cdf0e10cSrcweir #endif
152