xref: /trunk/main/sc/source/ui/inc/tptable.hxx (revision 1ecadb572e7010ff3b3382ad9bf179dbc6efadbb)
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 
28 #ifndef SC_TPTABLE_HXX
29 #define SC_TPTABLE_HXX
30 
31 #include <sfx2/tabdlg.hxx>
32 #include <vcl/fixed.hxx>
33 #include <vcl/lstbox.hxx>
34 #include <vcl/field.hxx>
35 
36 //===================================================================
37 
38 /** A vcl/NumericField that additionally supports empty text.
39     @descr  Value 0 is set as empty text, and empty text is returned as 0. */
40 class EmptyNumericField : public NumericField
41 {
42 public:
43     inline explicit     EmptyNumericField( Window* pParent, WinBits nWinStyle ) :
44                             NumericField( pParent, nWinStyle ) {}
45     inline explicit     EmptyNumericField( Window* pParent, const ResId& rResId ) :
46                             NumericField( pParent, rResId ) {}
47 
48     virtual void        Modify();
49     virtual void        SetValue( sal_Int64 nValue );
50     virtual sal_Int64   GetValue() const;
51 };
52 
53 //===================================================================
54 
55 class ScTablePage : public SfxTabPage
56 {
57 public:
58     static  SfxTabPage* Create          ( Window*           pParent,
59                                           const SfxItemSet& rCoreSet );
60     static  sal_uInt16*     GetRanges       ();
61     virtual sal_Bool        FillItemSet     ( SfxItemSet& rCoreSet );
62     virtual void        Reset           ( const SfxItemSet& rCoreSet );
63     using SfxTabPage::DeactivatePage;
64     virtual int         DeactivatePage  ( SfxItemSet* pSet = NULL );
65     virtual void        DataChanged     ( const DataChangedEvent& rDCEvt );
66 
67 private:
68                     ScTablePage( Window* pParent, const SfxItemSet& rCoreSet );
69     virtual         ~ScTablePage();
70 
71     void            ShowImage();
72 
73 private:
74     FixedLine       aFlPageDir;
75     RadioButton     aBtnTopDown;
76     RadioButton     aBtnLeftRight;
77     FixedImage      aBmpPageDir;
78     Image           aImgLeftRight;
79     Image           aImgTopDown;
80     Image           aImgLeftRightHC;
81     Image           aImgTopDownHC;
82     CheckBox        aBtnPageNo;
83     NumericField    aEdPageNo;
84 
85     FixedLine       aFlPrint;
86     CheckBox        aBtnHeaders;
87     CheckBox        aBtnGrid;
88     CheckBox        aBtnNotes;
89     CheckBox        aBtnObjects;
90     CheckBox        aBtnCharts;
91     CheckBox        aBtnDrawings;
92     CheckBox        aBtnFormulas;
93     CheckBox        aBtnNullVals;
94 
95     FixedLine           aFlScale;
96     FixedText           aFtScaleMode;
97     ListBox             aLbScaleMode;
98     FixedText           aFtScaleAll;
99     MetricField         aEdScaleAll;
100     FixedText           aFtScalePageWidth;
101     EmptyNumericField   aEdScalePageWidth;
102     FixedText           aFtScalePageHeight;
103     EmptyNumericField   aEdScalePageHeight;
104     FixedText           aFtScalePageNum;
105     NumericField        aEdScalePageNum;
106 
107 private:
108     //------------------------------------
109     // Handler:
110     DECL_LINK( PageDirHdl,      RadioButton* );
111     DECL_LINK( PageNoHdl,       CheckBox* );
112     DECL_LINK( ScaleHdl,        ListBox* );
113 };
114 
115 #endif // SC_TPTABLE_HXX
116