Update ooo320-m1
[ooovba.git] / svx / source / cui / page.hxx
blob5be2c4d63fc61cb0555f8a8f43cd6aebbad76dca
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: page.hxx,v $
10 * $Revision: 1.8 $
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 ************************************************************************/
30 #ifndef _SVX_PAGE_HXX
31 #define _SVX_PAGE_HXX
34 #include <sfx2/tabdlg.hxx>
36 #ifndef _FIELD_HXX //autogen
37 #include <vcl/field.hxx>
38 #endif
40 #ifndef _FIXED_HXX //autogen
41 #include <vcl/fixed.hxx>
42 #endif
44 #ifndef _GROUP_HXX //autogen
45 #include <vcl/group.hxx>
46 #endif
48 #ifndef _LSTBOX_HXX //autogen
49 #include <vcl/lstbox.hxx>
50 #endif
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
64 //CHINA001 {
65 //CHINA001 SVX_PAGE_MODE_STANDARD,
66 //CHINA001 SVX_PAGE_MODE_CENTER,
67 //CHINA001 SVX_PAGE_MODE_PRESENTATION
68 //CHINA001 };
70 // class SvxPageDescPage -------------------------------------------------
72 /* {k:\svx\prototyp\dialog\page.bmp}
74 [Beschreibung]
75 TabPage zur Einstellung einer Seite (Groesse, Raender, ...)
77 [Items]
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>
105 struct SvxPage_Impl;
106 typedef USHORT MarginPosition;
108 class SvxPageDescPage : public SfxTabPage
110 using TabPage::ActivatePage;
111 using TabPage::DeactivatePage;
113 // paper format
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;
135 // Margins
136 FixedLine aMarginFl;
137 FixedText aLeftMarginLbl;
138 MetricField aLeftMarginEdit;
139 FixedText aRightMarginLbl;
140 MetricField aRightMarginEdit;
141 FixedText aTopMarginLbl;
142 MetricField aTopMarginEdit;
143 FixedText aBottomMarginLbl;
144 MetricField aBottomMarginEdit;
146 // layout settings
147 FixedLine aLayoutFL;
148 FixedText aPageText;
149 ListBox aLayoutBox;
150 FixedText aNumberFormatText;
151 ListBox aNumberFormatBox;
153 FixedLine aBottomSeparatorFl;
155 //Extras Calc
156 FixedText aTblAlignFT;
157 CheckBox aHorzBox;
158 CheckBox aVertBox;
160 // Impress and Draw
161 CheckBox aAdaptBox;
163 //Register Writer
164 CheckBox aRegisterCB;
165 FixedText aRegisterFT;
166 ListBox aRegisterLB;
168 String sStandardRegister;
170 String aInsideText;
171 String aOutsideText;
172 String aLeftText;
173 String aRightText;
174 String aPrintRangeQueryText;
176 long nFirstLeftMargin;
177 long nFirstRightMargin;
178 long nFirstTopMargin;
179 long nFirstBottomMargin;
180 long nLastLeftMargin;
181 long nLastRightMargin;
182 long nLastTopMargin;
183 long nLastBottomMargin;
185 Size aMaxSize;
186 BOOL bLandscape;
187 FASTBOOL bBorderModified;
188 SvxModeType eMode;
189 Paper ePaperStart;
190 Paper ePaperEnd;
192 SvxPage_Impl* pImpl;
194 #ifdef _SVX_PAGE_CXX
195 void Init_Impl();
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 );
205 // Papiergroesse
206 DECL_LINK( PaperSizeSelect_Impl, ListBox* );
207 DECL_LINK( PaperSizeModify_Impl, Edit* );
209 DECL_LINK( FrameDirectionModify_Impl, ListBox* );
211 // Hintergrund
212 void ResetBackground_Impl( const SfxItemSet& rSet );
214 // Grenzwerte
215 DECL_LINK( RangeHdl_Impl, Edit* );
216 void CalcMargin_Impl();
218 // Registerhaltigkeit
219 DECL_LINK( RegisterModify, CheckBox * );
221 // page direction
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();
229 #endif
231 SvxPageDescPage( Window* pParent, const SfxItemSet& rSet );
233 protected:
234 virtual void ActivatePage( const SfxItemSet& rSet );
235 virtual int DeactivatePage( SfxItemSet* pSet = 0 );
237 public:
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