1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir #ifndef _CHART2_TP_SCALES_HXX
28*cdf0e10cSrcweir #define _CHART2_TP_SCALES_HXX
29*cdf0e10cSrcweir 
30*cdf0e10cSrcweir // header for SfxTabPage
31*cdf0e10cSrcweir #include <sfx2/tabdlg.hxx>
32*cdf0e10cSrcweir // header for class FormattedField
33*cdf0e10cSrcweir #include <svtools/fmtfield.hxx>
34*cdf0e10cSrcweir // header for FixedText
35*cdf0e10cSrcweir #include <vcl/fixed.hxx>
36*cdf0e10cSrcweir // header for CheckBox
37*cdf0e10cSrcweir #include <vcl/button.hxx>
38*cdf0e10cSrcweir // header for MetricField
39*cdf0e10cSrcweir #include <vcl/field.hxx>
40*cdf0e10cSrcweir // header for class ListBox
41*cdf0e10cSrcweir #include <vcl/lstbox.hxx>
42*cdf0e10cSrcweir 
43*cdf0e10cSrcweir //.............................................................................
44*cdf0e10cSrcweir namespace chart
45*cdf0e10cSrcweir {
46*cdf0e10cSrcweir //.............................................................................
47*cdf0e10cSrcweir 
48*cdf0e10cSrcweir class ScaleTabPage : public SfxTabPage
49*cdf0e10cSrcweir {
50*cdf0e10cSrcweir public:
51*cdf0e10cSrcweir 	ScaleTabPage( Window* pParent, const SfxItemSet& rInAttrs );
52*cdf0e10cSrcweir 
53*cdf0e10cSrcweir 	static SfxTabPage* Create( Window* pParent, const SfxItemSet& rInAttrs );
54*cdf0e10cSrcweir 	virtual sal_Bool FillItemSet( SfxItemSet& rOutAttrs );
55*cdf0e10cSrcweir 	virtual void Reset( const SfxItemSet& rInAttrs );
56*cdf0e10cSrcweir     using TabPage::DeactivatePage;
57*cdf0e10cSrcweir 	virtual int DeactivatePage( SfxItemSet* pItemSet = NULL );
58*cdf0e10cSrcweir 
59*cdf0e10cSrcweir 	void SetNumFormatter( SvNumberFormatter* pFormatter );
60*cdf0e10cSrcweir 	void SetNumFormat();
61*cdf0e10cSrcweir 
62*cdf0e10cSrcweir     void ShowAxisOrigin( bool bShowOrigin );
63*cdf0e10cSrcweir 
64*cdf0e10cSrcweir     virtual void StateChanged( StateChangedType nType );
65*cdf0e10cSrcweir 
66*cdf0e10cSrcweir private:
67*cdf0e10cSrcweir 	FixedLine			aFlScale;
68*cdf0e10cSrcweir 
69*cdf0e10cSrcweir     CheckBox            aCbxReverse;
70*cdf0e10cSrcweir 
71*cdf0e10cSrcweir     CheckBox			aCbxLogarithm;
72*cdf0e10cSrcweir 
73*cdf0e10cSrcweir     FixedText			m_aTxt_AxisType;
74*cdf0e10cSrcweir     ListBox             m_aLB_AxisType;
75*cdf0e10cSrcweir 
76*cdf0e10cSrcweir 	FixedText			aTxtMin;
77*cdf0e10cSrcweir 	FormattedField		aFmtFldMin;
78*cdf0e10cSrcweir 	CheckBox			aCbxAutoMin;
79*cdf0e10cSrcweir 
80*cdf0e10cSrcweir 	FixedText			aTxtMax;
81*cdf0e10cSrcweir 	FormattedField		aFmtFldMax;
82*cdf0e10cSrcweir 	CheckBox			aCbxAutoMax;
83*cdf0e10cSrcweir 
84*cdf0e10cSrcweir     FixedText           m_aTxt_TimeResolution;
85*cdf0e10cSrcweir 	ListBox             m_aLB_TimeResolution;
86*cdf0e10cSrcweir 	CheckBox			m_aCbx_AutoTimeResolution;
87*cdf0e10cSrcweir 
88*cdf0e10cSrcweir 	FixedText           aTxtMain;
89*cdf0e10cSrcweir 	FormattedField		aFmtFldStepMain;
90*cdf0e10cSrcweir     MetricField         m_aMt_MainDateStep;
91*cdf0e10cSrcweir 	ListBox             m_aLB_MainTimeUnit;
92*cdf0e10cSrcweir     CheckBox			aCbxAutoStepMain;
93*cdf0e10cSrcweir 
94*cdf0e10cSrcweir     FixedText           aTxtHelpCount;
95*cdf0e10cSrcweir 	FixedText           aTxtHelp;
96*cdf0e10cSrcweir 	MetricField         aMtStepHelp;
97*cdf0e10cSrcweir 	ListBox             m_aLB_HelpTimeUnit;
98*cdf0e10cSrcweir     CheckBox			aCbxAutoStepHelp;
99*cdf0e10cSrcweir 
100*cdf0e10cSrcweir     FixedText           aTxtOrigin;
101*cdf0e10cSrcweir 	FormattedField		aFmtFldOrigin;
102*cdf0e10cSrcweir 	CheckBox			aCbxAutoOrigin;
103*cdf0e10cSrcweir 
104*cdf0e10cSrcweir 	double				fMin;
105*cdf0e10cSrcweir 	double				fMax;
106*cdf0e10cSrcweir 	double				fStepMain;
107*cdf0e10cSrcweir     sal_Int32           nStepHelp;
108*cdf0e10cSrcweir 	double				fOrigin;
109*cdf0e10cSrcweir     sal_Int32           m_nTimeResolution;
110*cdf0e10cSrcweir     sal_Int32           m_nMainTimeUnit;
111*cdf0e10cSrcweir     sal_Int32           m_nHelpTimeUnit;
112*cdf0e10cSrcweir 	int                 m_nAxisType;
113*cdf0e10cSrcweir     bool                m_bAllowDateAxis;
114*cdf0e10cSrcweir 	SvNumberFormatter*	pNumFormatter;
115*cdf0e10cSrcweir 
116*cdf0e10cSrcweir     bool                m_bShowAxisOrigin;
117*cdf0e10cSrcweir 
118*cdf0e10cSrcweir     void AdjustControlPositions();
119*cdf0e10cSrcweir     void EnableControls();
120*cdf0e10cSrcweir     void PlaceIntervalControlsAccordingToAxisType();
121*cdf0e10cSrcweir 
122*cdf0e10cSrcweir     DECL_LINK( SelectAxisTypeHdl, void* );
123*cdf0e10cSrcweir 	DECL_LINK( EnableValueHdl, CheckBox* );
124*cdf0e10cSrcweir     DECL_LINK( FmtFieldModifiedHdl, FormattedField* );
125*cdf0e10cSrcweir 
126*cdf0e10cSrcweir     /** shows a warning window due to an invalid input.
127*cdf0e10cSrcweir 
128*cdf0e10cSrcweir         @param nResIdMessage
129*cdf0e10cSrcweir             The resource identifier that represents the localized warning text.
130*cdf0e10cSrcweir             If this is 0, no warning is shown and false is returned.
131*cdf0e10cSrcweir 
132*cdf0e10cSrcweir         @param pControl
133*cdf0e10cSrcweir             If non-NULL, contains a pointer to the control in which the
134*cdf0e10cSrcweir             errornous value was in.  This method gives this control the focus
135*cdf0e10cSrcweir             and selects its content.
136*cdf0e10cSrcweir 
137*cdf0e10cSrcweir         @return false, if nResIdMessage was 0, true otherwise
138*cdf0e10cSrcweir      */
139*cdf0e10cSrcweir     bool ShowWarning( sal_uInt16 nResIdMessage, Control* pControl = NULL );
140*cdf0e10cSrcweir };
141*cdf0e10cSrcweir 
142*cdf0e10cSrcweir //.............................................................................
143*cdf0e10cSrcweir } //namespace chart
144*cdf0e10cSrcweir //.............................................................................
145*cdf0e10cSrcweir 
146*cdf0e10cSrcweir #endif
147*cdf0e10cSrcweir 
148