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 : ListBox* m_pPaperSizeBox;
80 :
81 : MetricField* m_pPaperWidthEdit;
82 : MetricField* m_pPaperHeightEdit;
83 :
84 : FixedText* m_pOrientationFT;
85 : RadioButton* m_pPortraitBtn;
86 : RadioButton* m_pLandscapeBtn;
87 :
88 : SvxPageWindow* m_pBspWin;
89 :
90 : FixedText* m_pTextFlowLbl;
91 : svx::FrameDirectionListBox* m_pTextFlowBox;
92 :
93 : ListBox* m_pPaperTrayBox;
94 :
95 : // Margins
96 : FixedText* m_pLeftMarginLbl;
97 : MetricField* m_pLeftMarginEdit;
98 : FixedText* m_pRightMarginLbl;
99 : MetricField* m_pRightMarginEdit;
100 : MetricField* m_pTopMarginEdit;
101 : MetricField* m_pBottomMarginEdit;
102 :
103 : // layout settings
104 : FixedText* m_pPageText;
105 : ListBox* m_pLayoutBox;
106 : ListBox* m_pNumberFormatBox;
107 :
108 : //Extras Calc
109 : FixedText* m_pTblAlignFT;
110 : CheckBox* m_pHorzBox;
111 : CheckBox* m_pVertBox;
112 :
113 : // Impress and Draw
114 : CheckBox* m_pAdaptBox;
115 :
116 : //Register Writer
117 : CheckBox* m_pRegisterCB;
118 : FixedText* m_pRegisterFT;
119 : ListBox* m_pRegisterLB;
120 :
121 : OUString sStandardRegister;
122 :
123 : FixedText* m_pInsideLbl;
124 : FixedText* m_pOutsideLbl;
125 : FixedText* m_pPrintRangeQueryText;
126 :
127 : long nFirstLeftMargin;
128 : long nFirstRightMargin;
129 : long nFirstTopMargin;
130 : long nFirstBottomMargin;
131 : long nLastLeftMargin;
132 : long nLastRightMargin;
133 : long nLastTopMargin;
134 : long nLastBottomMargin;
135 :
136 : Size aMaxSize;
137 : sal_Bool bLandscape;
138 : bool bBorderModified;
139 : SvxModeType eMode;
140 : Paper ePaperStart;
141 : Paper ePaperEnd;
142 :
143 : SvxPage_Impl* pImpl;
144 :
145 : void Init_Impl();
146 : DECL_LINK(LayoutHdl_Impl, void *);
147 : DECL_LINK(PaperBinHdl_Impl, void *);
148 : DECL_LINK( SwapOrientation_Impl, RadioButton* );
149 : void SwapFirstValues_Impl( bool bSet );
150 : DECL_LINK(BorderModify_Impl, void *);
151 : void InitHeadFoot_Impl( const SfxItemSet& rSet );
152 : DECL_LINK(CenterHdl_Impl, void *);
153 : void UpdateExample_Impl( bool bResetbackground = false );
154 :
155 : DECL_LINK( PaperSizeSelect_Impl, ListBox* );
156 : DECL_LINK(PaperSizeModify_Impl, void *);
157 :
158 : DECL_LINK( FrameDirectionModify_Impl, ListBox* );
159 :
160 : void ResetBackground_Impl( const SfxItemSet& rSet );
161 :
162 : DECL_LINK(RangeHdl_Impl, void *);
163 : void CalcMargin_Impl();
164 :
165 : DECL_LINK( RegisterModify, CheckBox * );
166 :
167 : // page direction
168 : /** Disables vertical page direction entries in the text flow listbox. */
169 : void DisableVerticalPageDir();
170 :
171 : bool IsPrinterRangeOverflow( MetricField& rField, long nFirstMargin,
172 : long nLastMargin, MarginPosition nPos );
173 : void CheckMarginEdits( bool _bClear );
174 : bool IsMarginOutOfRange();
175 :
176 : SvxPageDescPage( Window* pParent, const SfxItemSet& rSet );
177 :
178 : protected:
179 : virtual void ActivatePage( const SfxItemSet& rSet );
180 : virtual int DeactivatePage( SfxItemSet* pSet = 0 );
181 :
182 : public:
183 : static SfxTabPage* Create( Window* pParent, const SfxItemSet& rSet );
184 : static sal_uInt16* GetRanges();
185 :
186 : virtual sal_Bool FillItemSet( SfxItemSet& rOutSet );
187 : virtual void Reset( const SfxItemSet& rSet );
188 : virtual void FillUserData();
189 :
190 : virtual ~SvxPageDescPage();
191 :
192 0 : void SetMode( SvxModeType eMType ) { eMode = eMType; }
193 0 : void SetPaperFormatRanges( Paper eStart, Paper eEnd )
194 0 : { ePaperStart = eStart, ePaperEnd = eEnd; }
195 :
196 : void SetCollectionList(const std::vector<OUString> &aList);
197 : virtual void PageCreated (SfxAllItemSet aSet);
198 : };
199 :
200 : #endif // #ifndef _SVX_PAGE_HXX
201 :
202 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|