xref: /trunk/main/cui/source/inc/page.hxx (revision 914d351e5f5b84e4342a86d6ab8d4aca7308b9bd)
1c4eee24dSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3c4eee24dSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4c4eee24dSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5c4eee24dSAndrew Rist  * distributed with this work for additional information
6c4eee24dSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7c4eee24dSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8c4eee24dSAndrew Rist  * "License"); you may not use this file except in compliance
9c4eee24dSAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11c4eee24dSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13c4eee24dSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14c4eee24dSAndrew Rist  * software distributed under the License is distributed on an
15c4eee24dSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16c4eee24dSAndrew Rist  * KIND, either express or implied.  See the License for the
17c4eee24dSAndrew Rist  * specific language governing permissions and limitations
18c4eee24dSAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20c4eee24dSAndrew Rist  *************************************************************/
21c4eee24dSAndrew Rist 
22c4eee24dSAndrew 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 
83*56b35d86SArmin Le Grand //UUUU struct   SvxPage_Impl;
84cdf0e10cSrcweir typedef sal_uInt16 MarginPosition;
85cdf0e10cSrcweir 
86cdf0e10cSrcweir class SvxPageDescPage : public SfxTabPage
87cdf0e10cSrcweir {
88cdf0e10cSrcweir     using TabPage::ActivatePage;
89cdf0e10cSrcweir     using TabPage::DeactivatePage;
90cdf0e10cSrcweir 
91*56b35d86SArmin Le Grand private:
92cdf0e10cSrcweir     // paper format
93cdf0e10cSrcweir     FixedLine           aPaperSizeFl;
94cdf0e10cSrcweir     FixedText           aPaperFormatText;
95cdf0e10cSrcweir     ListBox             aPaperSizeBox;
96cdf0e10cSrcweir 
97cdf0e10cSrcweir     FixedText           aPaperWidthText;
98cdf0e10cSrcweir     MetricField         aPaperWidthEdit;
99cdf0e10cSrcweir     FixedText           aPaperHeightText;
100cdf0e10cSrcweir     MetricField         aPaperHeightEdit;
101cdf0e10cSrcweir 
102cdf0e10cSrcweir     FixedText           aOrientationFT;
103cdf0e10cSrcweir     RadioButton         aPortraitBtn;
104cdf0e10cSrcweir     RadioButton         aLandscapeBtn;
105cdf0e10cSrcweir 
106cdf0e10cSrcweir     SvxPageWindow       aBspWin;
107cdf0e10cSrcweir 
108cdf0e10cSrcweir     FixedText                   aTextFlowLbl;
109cdf0e10cSrcweir     svx::FrameDirectionListBox  aTextFlowBox;
110cdf0e10cSrcweir 
111cdf0e10cSrcweir     FixedText           aPaperTrayLbl;
112cdf0e10cSrcweir     ListBox             aPaperTrayBox;
113cdf0e10cSrcweir 
114cdf0e10cSrcweir     // Margins
115cdf0e10cSrcweir     FixedLine           aMarginFl;
116cdf0e10cSrcweir     FixedText           aLeftMarginLbl;
117cdf0e10cSrcweir     MetricField         aLeftMarginEdit;
118cdf0e10cSrcweir     FixedText           aRightMarginLbl;
119cdf0e10cSrcweir     MetricField         aRightMarginEdit;
120cdf0e10cSrcweir     FixedText           aTopMarginLbl;
121cdf0e10cSrcweir     MetricField         aTopMarginEdit;
122cdf0e10cSrcweir     FixedText           aBottomMarginLbl;
123cdf0e10cSrcweir     MetricField         aBottomMarginEdit;
124cdf0e10cSrcweir 
125cdf0e10cSrcweir     FixedLine           aBottomSeparatorFl;
126cdf0e10cSrcweir     // layout settings
127cdf0e10cSrcweir     FixedLine           aLayoutFL;
128cdf0e10cSrcweir     FixedText           aPageText;
129cdf0e10cSrcweir     ListBox             aLayoutBox;
130cdf0e10cSrcweir     FixedText           aNumberFormatText;
131cdf0e10cSrcweir     ListBox             aNumberFormatBox;
132cdf0e10cSrcweir 
133cdf0e10cSrcweir 
134cdf0e10cSrcweir     //Extras Calc
135cdf0e10cSrcweir     FixedText           aTblAlignFT;
136cdf0e10cSrcweir     CheckBox            aHorzBox;
137cdf0e10cSrcweir     CheckBox            aVertBox;
138cdf0e10cSrcweir 
139cdf0e10cSrcweir     // Impress and Draw
140cdf0e10cSrcweir     CheckBox            aAdaptBox;
141cdf0e10cSrcweir 
142cdf0e10cSrcweir     //Register Writer
143cdf0e10cSrcweir     CheckBox            aRegisterCB;
144cdf0e10cSrcweir     FixedText           aRegisterFT;
145cdf0e10cSrcweir     ListBox             aRegisterLB;
146cdf0e10cSrcweir 
147cdf0e10cSrcweir     String              sStandardRegister;
148cdf0e10cSrcweir 
149cdf0e10cSrcweir     String              aInsideText;
150cdf0e10cSrcweir     String              aOutsideText;
151cdf0e10cSrcweir     String              aLeftText;
152cdf0e10cSrcweir     String              aRightText;
153cdf0e10cSrcweir     String              aPrintRangeQueryText;
154cdf0e10cSrcweir 
155cdf0e10cSrcweir     long                nFirstLeftMargin;
156cdf0e10cSrcweir     long                nFirstRightMargin;
157cdf0e10cSrcweir     long                nFirstTopMargin;
158cdf0e10cSrcweir     long                nFirstBottomMargin;
159cdf0e10cSrcweir     long                nLastLeftMargin;
160cdf0e10cSrcweir     long                nLastRightMargin;
161cdf0e10cSrcweir     long                nLastTopMargin;
162cdf0e10cSrcweir     long                nLastBottomMargin;
163cdf0e10cSrcweir 
164cdf0e10cSrcweir     Size                aMaxSize;
165cdf0e10cSrcweir     sal_Bool                bLandscape;
166cdf0e10cSrcweir     FASTBOOL            bBorderModified;
167cdf0e10cSrcweir     SvxModeType         eMode;
168cdf0e10cSrcweir     Paper               ePaperStart;
169cdf0e10cSrcweir     Paper               ePaperEnd;
170cdf0e10cSrcweir 
171*56b35d86SArmin Le Grand     //UUUU SvxPage_Impl*        pImpl;
172*56b35d86SArmin Le Grand     MarginPosition      m_nPos;
173*56b35d86SArmin Le Grand     Printer*            mpDefPrinter;
174*56b35d86SArmin Le Grand 
175*56b35d86SArmin Le Grand     bool                mbDelPrinter : 1;
176*56b35d86SArmin Le Grand 
177*56b35d86SArmin Le Grand     //UUUU
178*56b35d86SArmin Le Grand     bool mbEnableDrawingLayerFillStyles : 1;
179cdf0e10cSrcweir 
180cdf0e10cSrcweir #ifdef _SVX_PAGE_CXX
181cdf0e10cSrcweir     void                Init_Impl();
182cdf0e10cSrcweir     DECL_LINK(          LayoutHdl_Impl, ListBox* );
183cdf0e10cSrcweir     DECL_LINK(          PaperBinHdl_Impl, ListBox* );
184cdf0e10cSrcweir     DECL_LINK(          SwapOrientation_Impl, RadioButton* );
185cdf0e10cSrcweir     void                SwapFirstValues_Impl( FASTBOOL bSet );
186cdf0e10cSrcweir     DECL_LINK(          BorderModify_Impl, MetricField* );
187cdf0e10cSrcweir     void                InitHeadFoot_Impl( const SfxItemSet& rSet );
188cdf0e10cSrcweir     DECL_LINK(          CenterHdl_Impl, CheckBox* );
189cdf0e10cSrcweir     void                UpdateExample_Impl( bool bResetbackground = false );
190cdf0e10cSrcweir 
191cdf0e10cSrcweir     // Papiergroesse
192cdf0e10cSrcweir     DECL_LINK(          PaperSizeSelect_Impl, ListBox* );
193cdf0e10cSrcweir     DECL_LINK(          PaperSizeModify_Impl, Edit* );
194cdf0e10cSrcweir 
195cdf0e10cSrcweir     DECL_LINK(          FrameDirectionModify_Impl, ListBox* );
196cdf0e10cSrcweir 
197cdf0e10cSrcweir     // Hintergrund
198cdf0e10cSrcweir     void                ResetBackground_Impl( const SfxItemSet& rSet );
199cdf0e10cSrcweir 
200cdf0e10cSrcweir     // Grenzwerte
201cdf0e10cSrcweir     DECL_LINK(          RangeHdl_Impl, Edit* );
202cdf0e10cSrcweir     void                CalcMargin_Impl();
203cdf0e10cSrcweir 
204cdf0e10cSrcweir     // Registerhaltigkeit
205cdf0e10cSrcweir     DECL_LINK(          RegisterModify, CheckBox * );
206cdf0e10cSrcweir 
207cdf0e10cSrcweir     // page direction
208cdf0e10cSrcweir     /** Disables vertical page direction entries in the text flow listbox. */
209cdf0e10cSrcweir     void                DisableVerticalPageDir();
210cdf0e10cSrcweir 
211cdf0e10cSrcweir     bool                IsPrinterRangeOverflow( MetricField& rField, long nFirstMargin,
212cdf0e10cSrcweir                                                 long nLastMargin, MarginPosition nPos );
213cdf0e10cSrcweir     void                CheckMarginEdits( bool _bClear );
214cdf0e10cSrcweir     bool                IsMarginOutOfRange();
215cdf0e10cSrcweir #endif
216cdf0e10cSrcweir 
217cdf0e10cSrcweir     SvxPageDescPage( Window* pParent, const SfxItemSet& rSet );
218cdf0e10cSrcweir 
219*56b35d86SArmin Le Grand     //UUUU
EnableDrawingLayerFillStyles(bool bNew)220*56b35d86SArmin Le Grand     void EnableDrawingLayerFillStyles(bool bNew) { mbEnableDrawingLayerFillStyles = bNew; }
221*56b35d86SArmin Le Grand 
222cdf0e10cSrcweir protected:
223cdf0e10cSrcweir     virtual void        ActivatePage( const SfxItemSet& rSet );
224cdf0e10cSrcweir     virtual int         DeactivatePage( SfxItemSet* pSet = 0 );
225cdf0e10cSrcweir 
226cdf0e10cSrcweir public:
227cdf0e10cSrcweir     static SfxTabPage*  Create( Window* pParent, const SfxItemSet& rSet );
228cdf0e10cSrcweir     static sal_uInt16*      GetRanges();
229cdf0e10cSrcweir 
230cdf0e10cSrcweir     virtual sal_Bool        FillItemSet( SfxItemSet& rOutSet );
231cdf0e10cSrcweir     virtual void        Reset( const SfxItemSet& rSet );
232cdf0e10cSrcweir     virtual void        FillUserData();
233cdf0e10cSrcweir 
234cdf0e10cSrcweir     virtual ~SvxPageDescPage();
235cdf0e10cSrcweir 
SetMode(SvxModeType eMType)236cdf0e10cSrcweir     void                SetMode( SvxModeType eMType ) { eMode = eMType; }
SetPaperFormatRanges(Paper eStart,Paper eEnd)237cdf0e10cSrcweir     void                SetPaperFormatRanges( Paper eStart, Paper eEnd )
238cdf0e10cSrcweir                             { ePaperStart = eStart, ePaperEnd = eEnd; }
239cdf0e10cSrcweir 
240cdf0e10cSrcweir     void                SetCollectionList(const List* pList);
241cdf0e10cSrcweir     virtual void        PageCreated (SfxAllItemSet aSet); //add CHINA001
242cdf0e10cSrcweir };
243cdf0e10cSrcweir 
244cdf0e10cSrcweir #endif // #ifndef _SVX_PAGE_HXX
245