xref: /aoo42x/main/cui/source/inc/page.hxx (revision cdf0e10c)
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 _SVX_PAGE_HXX
28 #define _SVX_PAGE_HXX
29 
30 
31 #include <sfx2/tabdlg.hxx>
32 #include <vcl/field.hxx>
33 #include <vcl/fixed.hxx>
34 #include <vcl/group.hxx>
35 #include <vcl/lstbox.hxx>
36 #include <svtools/stdctrl.hxx>
37 #include <svx/pagectrl.hxx>
38 #include <svx/frmdirlbox.hxx>
39 #include <editeng/svxenum.hxx>
40 #include <i18npool/paper.hxx>
41 #include <svx/flagsdef.hxx>
42 
43 // enum ------------------------------------------------------------------
44 
45 //CHINA001 enum SvxModeType
46 //CHINA001 {
47 //CHINA001 	SVX_PAGE_MODE_STANDARD,
48 //CHINA001 	SVX_PAGE_MODE_CENTER,
49 //CHINA001 	SVX_PAGE_MODE_PRESENTATION
50 //CHINA001 };
51 
52 // class SvxPageDescPage -------------------------------------------------
53 
54 /*  {k:\svx\prototyp\dialog\page.bmp}
55 
56 	[Beschreibung]
57 	TabPage zur Einstellung einer Seite (Groesse, Raender, ...)
58 
59 	[Items]
60 	<SvxPageItem>:          <SID_ATTR_PAGE>
61 	<SvxSizeItem>:          <SID_ATTR_SIZE>
62 	<SvxSizeItem>:          <SID_ATTR_MAXSIZE>
63 	<SvxULSpaceItem>:       <SID_ATTR_LRSPACE>
64 	<SvxLRSpaceItem>:       <SID_ATTR_ULSPACE>
65 	<SfxAllEnumItem>:       <SID_ATTR_PAPERTRAY>
66 	<SvxPaperBinItem>:      <SID_ATTR_PAPERBIN>
67 	<SvxBoolItem>:          <SID_ATTR_EXT1>
68 	<SvxBoolItem>:          <SID_ATTR_EXT2>
69 
70 	<SfxSetItem>:           <SID_ATTR_HEADERSET>
71 		<SfxBoolItem>:          <SID_ATTR_ON>
72 		<SfxBoolItem>:          <SID_ATTR_DYNAMIC>
73 		<SfxBoolItem>:          <SID_ATTR_SHARED>
74 		<SvxSizeItem>:          <SID_ATTR_SIZE>
75 		<SvxULSpaceItem>:       <SID_ATTR_ULSPACE>
76 		<SvxLRSpaceItem>:       <SID_ATTR_LRSPACE>
77 
78 	<SfxSetItem>:           <SID_ATTR_FOOTERSET>
79 		<SfxBoolItem>:          <SID_ATTR_ON>
80 		<SfxBoolItem>:          <SID_ATTR_DYNAMIC>
81 		<SfxBoolItem>:          <SID_ATTR_SHARED>
82 		<SvxSizeItem>:          <SID_ATTR_SIZE>
83 		<SvxULSpaceItem>:       <SID_ATTR_ULSPACE>
84 		<SvxLRSpaceItem>:       <SID_ATTR_LRSPACE>
85 */
86 
87 struct	SvxPage_Impl;
88 typedef	sal_uInt16 MarginPosition;
89 
90 class SvxPageDescPage : public SfxTabPage
91 {
92 	using TabPage::ActivatePage;
93 	using TabPage::DeactivatePage;
94 
95     // paper format
96     FixedLine           aPaperSizeFl;
97     FixedText           aPaperFormatText;
98 	ListBox             aPaperSizeBox;
99 
100     FixedText           aPaperWidthText;
101 	MetricField         aPaperWidthEdit;
102 	FixedText           aPaperHeightText;
103 	MetricField         aPaperHeightEdit;
104 
105     FixedText           aOrientationFT;
106     RadioButton         aPortraitBtn;
107 	RadioButton         aLandscapeBtn;
108 
109     SvxPageWindow       aBspWin;
110 
111     FixedText           		aTextFlowLbl;
112     svx::FrameDirectionListBox	aTextFlowBox;
113 
114     FixedText           aPaperTrayLbl;
115 	ListBox             aPaperTrayBox;
116 
117     // Margins
118     FixedLine           aMarginFl;
119     FixedText           aLeftMarginLbl;
120 	MetricField         aLeftMarginEdit;
121 	FixedText           aRightMarginLbl;
122 	MetricField         aRightMarginEdit;
123 	FixedText           aTopMarginLbl;
124 	MetricField         aTopMarginEdit;
125 	FixedText           aBottomMarginLbl;
126 	MetricField         aBottomMarginEdit;
127 
128 	FixedLine           aBottomSeparatorFl;
129     // layout settings
130     FixedLine           aLayoutFL;
131 	FixedText           aPageText;
132     ListBox             aLayoutBox;
133 	FixedText			aNumberFormatText;
134     ListBox             aNumberFormatBox;
135 
136 
137     //Extras Calc
138     FixedText           aTblAlignFT;
139     CheckBox            aHorzBox;
140 	CheckBox            aVertBox;
141 
142     // Impress and Draw
143 	CheckBox            aAdaptBox;
144 
145 	//Register Writer
146 	CheckBox			aRegisterCB;
147 	FixedText			aRegisterFT;
148 	ListBox				aRegisterLB;
149 
150 	String				sStandardRegister;
151 
152 	String              aInsideText;
153 	String              aOutsideText;
154 	String              aLeftText;
155 	String              aRightText;
156 	String				aPrintRangeQueryText;
157 
158 	long				nFirstLeftMargin;
159 	long				nFirstRightMargin;
160 	long				nFirstTopMargin;
161 	long				nFirstBottomMargin;
162 	long				nLastLeftMargin;
163 	long				nLastRightMargin;
164 	long				nLastTopMargin;
165 	long				nLastBottomMargin;
166 
167 	Size                aMaxSize;
168 	sal_Bool                bLandscape;
169 	FASTBOOL            bBorderModified;
170 	SvxModeType         eMode;
171 	Paper               ePaperStart;
172 	Paper               ePaperEnd;
173 
174 	SvxPage_Impl*		pImpl;
175 
176 #ifdef _SVX_PAGE_CXX
177 	void                Init_Impl();
178 	DECL_LINK( 			LayoutHdl_Impl, ListBox* );
179 	DECL_LINK( 			PaperBinHdl_Impl, ListBox* );
180 	DECL_LINK( 			SwapOrientation_Impl, RadioButton* );
181 	void                SwapFirstValues_Impl( FASTBOOL bSet );
182 	DECL_LINK( 			BorderModify_Impl, MetricField* );
183 	void                InitHeadFoot_Impl( const SfxItemSet& rSet );
184 	DECL_LINK( 			CenterHdl_Impl, CheckBox* );
185     void                UpdateExample_Impl( bool bResetbackground = false );
186 
187 	// Papiergroesse
188 	DECL_LINK(			PaperSizeSelect_Impl, ListBox* );
189 	DECL_LINK(			PaperSizeModify_Impl, Edit* );
190 
191     DECL_LINK(			FrameDirectionModify_Impl, ListBox* );
192 
193     // Hintergrund
194 	void                ResetBackground_Impl( const SfxItemSet& rSet );
195 
196 	// Grenzwerte
197 	DECL_LINK(			RangeHdl_Impl, Edit* );
198 	void                CalcMargin_Impl();
199 
200 	// Registerhaltigkeit
201 	DECL_LINK(			RegisterModify, CheckBox * );
202 
203     // page direction
204     /** Disables vertical page direction entries in the text flow listbox. */
205     void                DisableVerticalPageDir();
206 
207 	bool				IsPrinterRangeOverflow( MetricField& rField, long nFirstMargin,
208 												long nLastMargin, MarginPosition nPos );
209 	void				CheckMarginEdits( bool _bClear );
210 	bool				IsMarginOutOfRange();
211 #endif
212 
213 	SvxPageDescPage( Window* pParent, const SfxItemSet& rSet );
214 
215 protected:
216 	virtual void        ActivatePage( const SfxItemSet& rSet );
217 	virtual int         DeactivatePage( SfxItemSet* pSet = 0 );
218 
219 public:
220 	static SfxTabPage*  Create( Window* pParent, const SfxItemSet& rSet );
221 	static sal_uInt16*      GetRanges();
222 
223 	virtual sal_Bool        FillItemSet( SfxItemSet& rOutSet );
224 	virtual void        Reset( const SfxItemSet& rSet );
225 	virtual void        FillUserData();
226 
227 	virtual ~SvxPageDescPage();
228 
229 	void                SetMode( SvxModeType eMType ) { eMode = eMType; }
230 	void                SetPaperFormatRanges( Paper eStart, Paper eEnd )
231 							{ ePaperStart = eStart, ePaperEnd = eEnd; }
232 
233 	void				SetCollectionList(const List* pList);
234 	virtual void		PageCreated (SfxAllItemSet aSet); //add CHINA001
235 };
236 
237 #endif // #ifndef _SVX_PAGE_HXX
238 
239