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