xref: /AOO41X/main/chart2/source/controller/inc/res_ErrorBar.hxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
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.
14  *
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).
20  *
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.
25  *
26  ************************************************************************/
27 #ifndef CHART2_RES_ERRORBAR_HXX
28 #define CHART2_RES_ERRORBAR_HXX
29 
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"
41 
42 #include <com/sun/star/chart2/XChartDocument.hpp>
43 
44 #include <memory>
45 
46 class Dialog;
47 
48 //.............................................................................
49 namespace chart
50 {
51 //.............................................................................
52 
53 class RangeSelectionHelper;
54 
55 class ErrorBarResources : public RangeSelectionListenerParent
56 {
57 public:
58     enum tErrorBarType
59     {
60         ERROR_BAR_X,
61         ERROR_BAR_Y
62     };
63 
64     ErrorBarResources(
65         Window* pParent, Dialog * pParentDialog, const SfxItemSet& rInAttrst,
66         bool bNoneAvailable,
67         tErrorBarType eType = ERROR_BAR_Y );
68     virtual ~ErrorBarResources();
69 
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     sal_Bool FillItemSet(SfxItemSet& rOutAttrs) const;
77 
78     void FillValueSets();
79 
80     // ____ RangeSelectionListenerParent ____
81     virtual void listeningFinished( const ::rtl::OUString & rNewRange );
82     virtual void disposingRangeSelection();
83 
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;
93 
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;
105 
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;
114 
115     SvxChartKindError    m_eErrorKind;
116     SvxChartIndicate     m_eIndicate;
117     SvxChartRegress      m_eTrendLineType;
118 
119     bool                 m_bErrorKindUnique;
120     bool                 m_bIndicatorUnique;
121     bool                 m_bPlusUnique;
122     bool                 m_bMinusUnique;
123     bool                 m_bRangePosUnique;
124     bool                 m_bRangeNegUnique;
125 
126     bool                 m_bNoneAvailable;
127 
128     tErrorBarType        m_eErrorBarType;
129     sal_uInt16           m_nConstDecimalDigits;
130     sal_Int64            m_nConstSpinSize;
131 
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;
139 
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 * );
146 
147     void UpdateControlStates();
148     bool isRangeFieldContentValid( Edit & rEdit );
149 };
150 
151 //.............................................................................
152 } //namespace chart
153 //.............................................................................
154 
155 #endif
156