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