1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: page.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
34 #include <sfx2/tabdlg.hxx>
36 #ifndef _FIELD_HXX //autogen
37 #include <vcl/field.hxx>
40 #ifndef _FIXED_HXX //autogen
41 #include <vcl/fixed.hxx>
44 #ifndef _GROUP_HXX //autogen
45 #include <vcl/group.hxx>
48 #ifndef _LSTBOX_HXX //autogen
49 #include <vcl/lstbox.hxx>
51 #include <svtools/stdctrl.hxx>
52 #include <svx/pagectrl.hxx>
53 #include <svx/frmdirlbox.hxx>
55 #include <svx/svxenum.hxx>
57 #include <i18npool/paper.hxx>
59 #include "flagsdef.hxx" //CHINA001
61 // enum ------------------------------------------------------------------
63 //CHINA001 enum SvxModeType
65 //CHINA001 SVX_PAGE_MODE_STANDARD,
66 //CHINA001 SVX_PAGE_MODE_CENTER,
67 //CHINA001 SVX_PAGE_MODE_PRESENTATION
70 // class SvxPageDescPage -------------------------------------------------
72 /* {k:\svx\prototyp\dialog\page.bmp}
75 TabPage zur Einstellung einer Seite (Groesse, Raender, ...)
78 <SvxPageItem>: <SID_ATTR_PAGE>
79 <SvxSizeItem>: <SID_ATTR_SIZE>
80 <SvxSizeItem>: <SID_ATTR_MAXSIZE>
81 <SvxULSpaceItem>: <SID_ATTR_LRSPACE>
82 <SvxLRSpaceItem>: <SID_ATTR_ULSPACE>
83 <SfxAllEnumItem>: <SID_ATTR_PAPERTRAY>
84 <SvxPaperBinItem>: <SID_ATTR_PAPERBIN>
85 <SvxBoolItem>: <SID_ATTR_EXT1>
86 <SvxBoolItem>: <SID_ATTR_EXT2>
88 <SfxSetItem>: <SID_ATTR_HEADERSET>
89 <SfxBoolItem>: <SID_ATTR_ON>
90 <SfxBoolItem>: <SID_ATTR_DYNAMIC>
91 <SfxBoolItem>: <SID_ATTR_SHARED>
92 <SvxSizeItem>: <SID_ATTR_SIZE>
93 <SvxULSpaceItem>: <SID_ATTR_ULSPACE>
94 <SvxLRSpaceItem>: <SID_ATTR_LRSPACE>
96 <SfxSetItem>: <SID_ATTR_FOOTERSET>
97 <SfxBoolItem>: <SID_ATTR_ON>
98 <SfxBoolItem>: <SID_ATTR_DYNAMIC>
99 <SfxBoolItem>: <SID_ATTR_SHARED>
100 <SvxSizeItem>: <SID_ATTR_SIZE>
101 <SvxULSpaceItem>: <SID_ATTR_ULSPACE>
102 <SvxLRSpaceItem>: <SID_ATTR_LRSPACE>
106 typedef USHORT MarginPosition
;
108 class SvxPageDescPage
: public SfxTabPage
110 using TabPage::ActivatePage
;
111 using TabPage::DeactivatePage
;
114 FixedLine aPaperSizeFl
;
115 FixedText aPaperFormatText
;
116 ListBox aPaperSizeBox
;
118 FixedText aPaperWidthText
;
119 MetricField aPaperWidthEdit
;
120 FixedText aPaperHeightText
;
121 MetricField aPaperHeightEdit
;
123 FixedText aOrientationFT
;
124 RadioButton aPortraitBtn
;
125 RadioButton aLandscapeBtn
;
127 SvxPageWindow aBspWin
;
129 FixedText aTextFlowLbl
;
130 svx::FrameDirectionListBox aTextFlowBox
;
132 FixedText aPaperTrayLbl
;
133 ListBox aPaperTrayBox
;
137 FixedText aLeftMarginLbl
;
138 MetricField aLeftMarginEdit
;
139 FixedText aRightMarginLbl
;
140 MetricField aRightMarginEdit
;
141 FixedText aTopMarginLbl
;
142 MetricField aTopMarginEdit
;
143 FixedText aBottomMarginLbl
;
144 MetricField aBottomMarginEdit
;
150 FixedText aNumberFormatText
;
151 ListBox aNumberFormatBox
;
153 FixedLine aBottomSeparatorFl
;
156 FixedText aTblAlignFT
;
164 CheckBox aRegisterCB
;
165 FixedText aRegisterFT
;
168 String sStandardRegister
;
174 String aPrintRangeQueryText
;
176 long nFirstLeftMargin
;
177 long nFirstRightMargin
;
178 long nFirstTopMargin
;
179 long nFirstBottomMargin
;
180 long nLastLeftMargin
;
181 long nLastRightMargin
;
183 long nLastBottomMargin
;
187 FASTBOOL bBorderModified
;
196 DECL_LINK( LayoutHdl_Impl
, ListBox
* );
197 DECL_LINK( PaperBinHdl_Impl
, ListBox
* );
198 DECL_LINK( SwapOrientation_Impl
, RadioButton
* );
199 void SwapFirstValues_Impl( FASTBOOL bSet
);
200 DECL_LINK( BorderModify_Impl
, MetricField
* );
201 void InitHeadFoot_Impl( const SfxItemSet
& rSet
);
202 DECL_LINK( CenterHdl_Impl
, CheckBox
* );
203 void UpdateExample_Impl( bool bResetbackground
= false );
206 DECL_LINK( PaperSizeSelect_Impl
, ListBox
* );
207 DECL_LINK( PaperSizeModify_Impl
, Edit
* );
209 DECL_LINK( FrameDirectionModify_Impl
, ListBox
* );
212 void ResetBackground_Impl( const SfxItemSet
& rSet
);
215 DECL_LINK( RangeHdl_Impl
, Edit
* );
216 void CalcMargin_Impl();
218 // Registerhaltigkeit
219 DECL_LINK( RegisterModify
, CheckBox
* );
222 /** Disables vertical page direction entries in the text flow listbox. */
223 void DisableVerticalPageDir();
225 bool IsPrinterRangeOverflow( MetricField
& rField
, long nFirstMargin
,
226 long nLastMargin
, MarginPosition nPos
);
227 void CheckMarginEdits( bool _bClear
);
228 bool IsMarginOutOfRange();
231 SvxPageDescPage( Window
* pParent
, const SfxItemSet
& rSet
);
234 virtual void ActivatePage( const SfxItemSet
& rSet
);
235 virtual int DeactivatePage( SfxItemSet
* pSet
= 0 );
238 static SfxTabPage
* Create( Window
* pParent
, const SfxItemSet
& rSet
);
239 static USHORT
* GetRanges();
241 virtual BOOL
FillItemSet( SfxItemSet
& rOutSet
);
242 virtual void Reset( const SfxItemSet
& rSet
);
243 virtual void FillUserData();
245 virtual ~SvxPageDescPage();
247 void SetMode( SvxModeType eMType
) { eMode
= eMType
; }
248 void SetPaperFormatRanges( Paper eStart
, Paper eEnd
)
249 { ePaperStart
= eStart
, ePaperEnd
= eEnd
; }
251 void SetCollectionList(const List
* pList
);
252 virtual void PageCreated (SfxAllItemSet aSet
); //add CHINA001
255 #endif // #ifndef _SVX_PAGE_HXX