1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_CUI_SOURCE_INC_PAGE_HXX
20 #define INCLUDED_CUI_SOURCE_INC_PAGE_HXX
22 #include <sfx2/tabdlg.hxx>
23 #include <svx/pagectrl.hxx>
24 #include <svx/pagenumberlistbox.hxx>
25 #include <svx/papersizelistbox.hxx>
26 #include <svx/frmdirlbox.hxx>
27 #include <editeng/svxenum.hxx>
28 #include <i18nutil/paper.hxx>
29 #include <svx/flagsdef.hxx>
31 // class SvxPageDescPage -------------------------------------------------
34 TabPage for page settings (size, margins, ...)
37 <SvxPageItem>: <SID_ATTR_PAGE>
38 <SvxSizeItem>: <SID_ATTR_SIZE>
39 <SvxSizeItem>: <SID_ATTR_MAXSIZE>
40 <SvxULSpaceItem>: <SID_ATTR_LRSPACE>
41 <SvxLRSpaceItem>: <SID_ATTR_ULSPACE>
42 <SfxAllEnumItem>: <SID_ATTR_PAPERTRAY>
43 <SvxPaperBinItem>: <SID_ATTR_PAPERBIN>
44 <SvxBoolItem>: <SID_ATTR_EXT1>
45 <SvxBoolItem>: <SID_ATTR_EXT2>
47 <SfxSetItem>: <SID_ATTR_HEADERSET>
48 <SfxBoolItem>: <SID_ATTR_ON>
49 <SfxBoolItem>: <SID_ATTR_DYNAMIC>
50 <SfxBoolItem>: <SID_ATTR_SHARED>
51 <SvxSizeItem>: <SID_ATTR_SIZE>
52 <SvxULSpaceItem>: <SID_ATTR_ULSPACE>
53 <SvxLRSpaceItem>: <SID_ATTR_LRSPACE>
55 <SfxSetItem>: <SID_ATTR_FOOTERSET>
56 <SfxBoolItem>: <SID_ATTR_ON>
57 <SfxBoolItem>: <SID_ATTR_DYNAMIC>
58 <SfxBoolItem>: <SID_ATTR_SHARED>
59 <SvxSizeItem>: <SID_ATTR_SIZE>
60 <SvxULSpaceItem>: <SID_ATTR_ULSPACE>
61 <SvxLRSpaceItem>: <SID_ATTR_LRSPACE>
64 typedef sal_uInt16 MarginPosition
;
66 class SvxPageDescPage
: public SfxTabPage
68 friend class VclPtr
<SvxPageDescPage
>;
69 using TabPage::ActivatePage
;
70 using TabPage::DeactivatePage
;
72 static const sal_uInt16 pRanges
[];
74 OUString sStandardRegister
;
75 long nFirstLeftMargin
;
76 long nFirstRightMargin
;
78 long nFirstBottomMargin
;
80 long nLastRightMargin
;
82 long nLastBottomMargin
;
89 MarginPosition m_nPos
;
90 VclPtr
<Printer
> mpDefPrinter
;
92 bool mbDelPrinter
: 1;
93 bool mbEnableDrawingLayerFillStyles
: 1;
95 SvxPageWindow m_aBspWin
;
98 std::unique_ptr
<SvxPaperSizeListBox
> m_xPaperSizeBox
;
99 std::unique_ptr
<weld::MetricSpinButton
> m_xPaperWidthEdit
;
100 std::unique_ptr
<weld::MetricSpinButton
> m_xPaperHeightEdit
;
101 std::unique_ptr
<weld::Label
> m_xOrientationFT
;
102 std::unique_ptr
<weld::RadioButton
> m_xPortraitBtn
;
103 std::unique_ptr
<weld::RadioButton
> m_xLandscapeBtn
;
104 std::unique_ptr
<weld::Label
> m_xTextFlowLbl
;
105 std::unique_ptr
<svx::FrameDirectionListBox
> m_xTextFlowBox
;
106 std::unique_ptr
<weld::ComboBox
> m_xPaperTrayBox
;
108 std::unique_ptr
<weld::Label
> m_xLeftMarginLbl
;
109 std::unique_ptr
<weld::MetricSpinButton
> m_xLeftMarginEdit
;
110 std::unique_ptr
<weld::Label
> m_xRightMarginLbl
;
111 std::unique_ptr
<weld::MetricSpinButton
> m_xRightMarginEdit
;
112 std::unique_ptr
<weld::MetricSpinButton
> m_xTopMarginEdit
;
113 std::unique_ptr
<weld::MetricSpinButton
> m_xBottomMarginEdit
;
115 std::unique_ptr
<weld::Label
> m_xPageText
;
116 std::unique_ptr
<weld::ComboBox
> m_xLayoutBox
;
117 std::unique_ptr
<SvxPageNumberListBox
> m_xNumberFormatBox
;
119 std::unique_ptr
<weld::Label
> m_xTblAlignFT
;
120 std::unique_ptr
<weld::CheckButton
> m_xHorzBox
;
121 std::unique_ptr
<weld::CheckButton
> m_xVertBox
;
123 std::unique_ptr
<weld::CheckButton
> m_xAdaptBox
;
125 std::unique_ptr
<weld::CheckButton
> m_xRegisterCB
;
126 std::unique_ptr
<weld::Label
> m_xRegisterFT
;
127 std::unique_ptr
<weld::ComboBox
> m_xRegisterLB
;
128 std::unique_ptr
<weld::Label
> m_xInsideLbl
;
129 std::unique_ptr
<weld::Label
> m_xOutsideLbl
;
130 std::unique_ptr
<weld::Label
> m_xPrintRangeQueryText
;
131 std::unique_ptr
<weld::CustomWeld
> m_xBspWin
;
134 DECL_LINK(LayoutHdl_Impl
, weld::ComboBox
&, void);
135 DECL_LINK(PaperBinHdl_Impl
, weld::Widget
&, void);
136 DECL_LINK(SwapOrientation_Impl
, weld::Button
&, void);
137 void SwapFirstValues_Impl( bool bSet
);
138 DECL_LINK(BorderModify_Impl
, weld::MetricSpinButton
&, void);
139 void InitHeadFoot_Impl( const SfxItemSet
& rSet
);
140 DECL_LINK(CenterHdl_Impl
, weld::ToggleButton
&, void);
141 void UpdateExample_Impl( bool bResetbackground
= false );
143 DECL_LINK(PaperSizeSelect_Impl
, weld::ComboBox
&, void );
144 DECL_LINK(PaperSizeModify_Impl
, weld::MetricSpinButton
&, void);
146 DECL_LINK(FrameDirectionModify_Impl
, weld::ComboBox
&, void );
148 void ResetBackground_Impl( const SfxItemSet
& rSet
);
150 void RangeHdl_Impl();
151 void CalcMargin_Impl();
153 DECL_LINK(RegisterModify
, weld::ToggleButton
&, void);
156 /** Disables vertical page direction entries in the text flow listbox. */
157 void DisableVerticalPageDir();
159 bool IsPrinterRangeOverflow(weld::MetricSpinButton
& rField
, long nFirstMargin
,
160 long nLastMargin
, MarginPosition nPos
);
161 void CheckMarginEdits( bool _bClear
);
162 bool IsMarginOutOfRange();
164 SvxPageDescPage(TabPageParent pParent
, const SfxItemSet
& rSet
);
167 virtual void ActivatePage( const SfxItemSet
& rSet
) override
;
168 virtual DeactivateRC
DeactivatePage( SfxItemSet
* pSet
) override
;
171 static VclPtr
<SfxTabPage
> Create( TabPageParent pParent
, const SfxItemSet
* rSet
);
172 // returns the range of the Which values
173 static const sal_uInt16
* GetRanges() { return pRanges
; }
175 virtual bool FillItemSet( SfxItemSet
* rOutSet
) override
;
176 virtual void Reset( const SfxItemSet
* rSet
) override
;
177 virtual void FillUserData() override
;
179 virtual ~SvxPageDescPage() override
;
180 virtual void dispose() override
;
182 void SetPaperFormatRanges( Paper eStart
)
183 { ePaperStart
= eStart
; }
185 void SetCollectionList(const std::vector
<OUString
> &aList
);
186 virtual void PageCreated(const SfxAllItemSet
& aSet
) override
;
189 #endif // INCLUDED_CUI_SOURCE_INC_PAGE_HXX
191 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */