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