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