LibreOffice Module cui (master) 1
page.hxx
Go to the documentation of this file.
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#pragma once
20
21#include <sfx2/tabdlg.hxx>
22#include <svx/pagectrl.hxx>
25#include <svx/frmdirlbox.hxx>
26#include <i18nutil/paper.hxx>
27#include <svx/flagsdef.hxx>
28#include <vcl/print.hxx>
29
30// class SvxPageDescPage -------------------------------------------------
31/*
32 [Description]
33 TabPage for page settings (size, margins, ...)
34
35 [Items]
36 <SvxPageItem>: <SID_ATTR_PAGE>
37 <SvxSizeItem>: <SID_ATTR_SIZE>
38 <SvxSizeItem>: <SID_ATTR_MAXSIZE>
39 <SvxULSpaceItem>: <SID_ATTR_LRSPACE>
40 <SvxLRSpaceItem>: <SID_ATTR_ULSPACE>
41 <SvxPaperBinItem>: <SID_ATTR_PAPERBIN>
42 <SvxBoolItem>: <SID_ATTR_EXT1>
43 <SvxBoolItem>: <SID_ATTR_EXT2>
44
45 <SfxSetItem>: <SID_ATTR_HEADERSET>
46 <SfxBoolItem>: <SID_ATTR_ON>
47 <SfxBoolItem>: <SID_ATTR_DYNAMIC>
48 <SfxBoolItem>: <SID_ATTR_SHARED>
49 <SvxSizeItem>: <SID_ATTR_SIZE>
50 <SvxULSpaceItem>: <SID_ATTR_ULSPACE>
51 <SvxLRSpaceItem>: <SID_ATTR_LRSPACE>
52
53 <SfxSetItem>: <SID_ATTR_FOOTERSET>
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
62typedef sal_uInt16 MarginPosition;
63
65{
67private:
77
82
85
86 bool mbDelPrinter : 1;
88
90
91 // paper format
92 std::unique_ptr<SvxPaperSizeListBox> m_xPaperSizeBox;
93 std::unique_ptr<weld::MetricSpinButton> m_xPaperWidthEdit;
94 std::unique_ptr<weld::MetricSpinButton> m_xPaperHeightEdit;
95 std::unique_ptr<weld::RadioButton> m_xPortraitBtn;
96 std::unique_ptr<weld::RadioButton> m_xLandscapeBtn;
97 std::unique_ptr<weld::Label> m_xTextFlowLbl;
98 std::unique_ptr<svx::FrameDirectionListBox> m_xTextFlowBox;
99 std::unique_ptr<weld::ComboBox> m_xPaperTrayBox;
100 // Margins
101 std::unique_ptr<weld::Label> m_xLeftMarginLbl;
102 std::unique_ptr<weld::MetricSpinButton> m_xLeftMarginEdit;
103 std::unique_ptr<weld::Label> m_xRightMarginLbl;
104 std::unique_ptr<weld::MetricSpinButton> m_xRightMarginEdit;
105 std::unique_ptr<weld::MetricSpinButton> m_xTopMarginEdit;
106 std::unique_ptr<weld::MetricSpinButton> m_xBottomMarginEdit;
107 std::unique_ptr<weld::Label> m_xGutterMarginLbl;
108 std::unique_ptr<weld::MetricSpinButton> m_xGutterMarginEdit;
109 // layout settings
110 std::unique_ptr<weld::Label> m_xPageText;
111 std::unique_ptr<weld::ComboBox> m_xLayoutBox;
112 std::unique_ptr<weld::Label> m_xNumberFormatText;
113 std::unique_ptr<SvxPageNumberListBox> m_xNumberFormatBox;
114 //Extras Calc
115 std::unique_ptr<weld::Label> m_xTblAlignFT;
116 std::unique_ptr<weld::CheckButton> m_xHorzBox;
117 std::unique_ptr<weld::CheckButton> m_xVertBox;
118 // Impress and Draw
119 std::unique_ptr<weld::CheckButton> m_xAdaptBox;
120 //Register Writer
121 std::unique_ptr<weld::CheckButton> m_xRegisterCB;
122 std::unique_ptr<weld::Label> m_xRegisterFT;
123 std::unique_ptr<weld::ComboBox> m_xRegisterLB;
124 std::unique_ptr<weld::Label> m_xGutterPositionFT;
125 std::unique_ptr<weld::ComboBox> m_xGutterPositionLB;
126 std::unique_ptr<weld::CheckButton> m_xRtlGutterCB;
127 std::unique_ptr<weld::CheckButton> m_xBackgroundFullSizeCB;
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;
132
133 void Init_Impl();
134 DECL_LINK(LayoutHdl_Impl, weld::ComboBox&, void);
135 DECL_LINK(GutterPositionHdl_Impl, weld::ComboBox&, void);
136 DECL_LINK(PaperBinHdl_Impl, weld::Widget&, void);
137 DECL_LINK(SwapOrientation_Impl, weld::Toggleable&, void);
138 void SwapFirstValues_Impl( bool bSet );
139 DECL_LINK(BorderModify_Impl, weld::MetricSpinButton&, void);
140 void InitHeadFoot_Impl( const SfxItemSet& rSet );
141 DECL_LINK(CenterHdl_Impl, weld::Toggleable&, void);
142 void UpdateExample_Impl( bool bResetbackground = false );
143
144 DECL_LINK(PaperSizeSelect_Impl, weld::ComboBox&, void );
145 DECL_LINK(PaperSizeModify_Impl, weld::MetricSpinButton&, void);
146
147 DECL_LINK(FrameDirectionModify_Impl, weld::ComboBox&, void );
148
149 void ResetBackground_Impl( const SfxItemSet& rSet );
150
151 void RangeHdl_Impl();
152 void CalcMargin_Impl();
153
154 DECL_LINK(RegisterModify, weld::Toggleable&, void);
155
156 // page direction
159
161 tools::Long nLastMargin, MarginPosition nPos);
162 void CheckMarginEdits( bool _bClear );
163 bool IsMarginOutOfRange() const;
164
165protected:
166 virtual void ActivatePage( const SfxItemSet& rSet ) override;
167 virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
168
169public:
170 SvxPageDescPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet);
171 static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rSet );
172 virtual ~SvxPageDescPage() override;
173
174 // returns the range of the Which values
176
177 virtual bool FillItemSet( SfxItemSet* rOutSet ) override;
178 virtual void Reset( const SfxItemSet* rSet ) override;
179 virtual void FillUserData() override;
180
182 { ePaperStart = eStart; }
183
184 void SetCollectionList(const std::vector<OUString> &aList);
185 virtual void PageCreated(const SfxAllItemSet& aSet) override;
186};
187
188/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< weld::ComboBox > m_xGutterPositionLB
Definition: page.hxx:125
OUString sStandardRegister
Definition: page.hxx:68
std::unique_ptr< weld::Label > m_xInsideLbl
Definition: page.hxx:128
std::unique_ptr< weld::CheckButton > m_xRtlGutterCB
Definition: page.hxx:126
std::unique_ptr< weld::RadioButton > m_xPortraitBtn
Definition: page.hxx:95
std::unique_ptr< weld::Label > m_xGutterPositionFT
Definition: page.hxx:124
tools::Long nFirstTopMargin
Definition: page.hxx:71
DECL_LINK(GutterPositionHdl_Impl, weld::ComboBox &, void)
std::unique_ptr< weld::Label > m_xPageText
Definition: page.hxx:110
DECL_LINK(LayoutHdl_Impl, weld::ComboBox &, void)
std::unique_ptr< weld::CheckButton > m_xVertBox
Definition: page.hxx:117
tools::Long nFirstLeftMargin
Definition: page.hxx:69
std::unique_ptr< weld::MetricSpinButton > m_xPaperHeightEdit
Definition: page.hxx:94
tools::Long nFirstRightMargin
Definition: page.hxx:70
std::unique_ptr< weld::Label > m_xOutsideLbl
Definition: page.hxx:129
virtual ~SvxPageDescPage() override
Definition: page.cxx:295
virtual bool FillItemSet(SfxItemSet *rOutSet) override
Definition: page.cxx:617
std::unique_ptr< SvxPageNumberListBox > m_xNumberFormatBox
Definition: page.hxx:113
std::unique_ptr< weld::Label > m_xPrintRangeQueryText
Definition: page.hxx:130
bool mbDelPrinter
Definition: page.hxx:86
MarginPosition m_nPos
Definition: page.hxx:83
std::unique_ptr< weld::Label > m_xGutterMarginLbl
Definition: page.hxx:107
std::unique_ptr< weld::Label > m_xRegisterFT
Definition: page.hxx:122
tools::Long nLastTopMargin
Definition: page.hxx:75
std::unique_ptr< weld::ComboBox > m_xPaperTrayBox
Definition: page.hxx:99
std::unique_ptr< weld::Label > m_xNumberFormatText
Definition: page.hxx:112
bool bBorderModified
Definition: page.hxx:79
static WhichRangesContainer GetRanges()
Definition: page.hxx:175
std::unique_ptr< weld::ComboBox > m_xRegisterLB
Definition: page.hxx:123
void InitHeadFoot_Impl(const SfxItemSet &rSet)
Definition: page.cxx:1227
SvxPageWindow m_aBspWin
Definition: page.hxx:89
std::unique_ptr< weld::MetricSpinButton > m_xBottomMarginEdit
Definition: page.hxx:106
std::unique_ptr< weld::CheckButton > m_xRegisterCB
Definition: page.hxx:121
void DisableVerticalPageDir()
Disables vertical page direction entries in the text flow listbox.
Definition: page.cxx:1552
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: page.cxx:1346
DECL_LINK(CenterHdl_Impl, weld::Toggleable &, void)
DECL_LINK(RegisterModify, weld::Toggleable &, void)
DECL_LINK(BorderModify_Impl, weld::MetricSpinButton &, void)
std::unique_ptr< weld::CheckButton > m_xHorzBox
Definition: page.hxx:116
tools::Long nLastLeftMargin
Definition: page.hxx:73
std::unique_ptr< SvxPaperSizeListBox > m_xPaperSizeBox
Definition: page.hxx:92
void SetPaperFormatRanges(Paper eStart)
Definition: page.hxx:181
bool mbEnableDrawingLayerFillStyles
Definition: page.hxx:87
bool bLandscape
Definition: page.hxx:78
DECL_LINK(FrameDirectionModify_Impl, weld::ComboBox &, void)
tools::Long nFirstBottomMargin
Definition: page.hxx:72
VclPtr< Printer > mpDefPrinter
Definition: page.hxx:84
std::unique_ptr< weld::Label > m_xTextFlowLbl
Definition: page.hxx:97
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: page.cxx:1354
DECL_LINK(PaperBinHdl_Impl, weld::Widget &, void)
DECL_LINK(PaperSizeModify_Impl, weld::MetricSpinButton &, void)
void CalcMargin_Impl()
Definition: page.cxx:1475
bool IsMarginOutOfRange() const
Definition: page.cxx:1609
virtual void Reset(const SfxItemSet *rSet) override
Definition: page.cxx:327
SvxModeType eMode
Definition: page.hxx:80
std::unique_ptr< weld::MetricSpinButton > m_xLeftMarginEdit
Definition: page.hxx:102
void RangeHdl_Impl()
Definition: page.cxx:1409
tools::Long nLastBottomMargin
Definition: page.hxx:76
SvxPageDescPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: page.cxx:140
std::unique_ptr< weld::Label > m_xLeftMarginLbl
Definition: page.hxx:101
void CheckMarginEdits(bool _bClear)
Check if a value of a margin edit is outside the printer paper margins and save this information.
Definition: page.cxx:1590
std::unique_ptr< weld::CheckButton > m_xAdaptBox
Definition: page.hxx:119
std::unique_ptr< weld::Label > m_xTblAlignFT
Definition: page.hxx:115
tools::Long nLastRightMargin
Definition: page.hxx:74
void UpdateExample_Impl(bool bResetbackground=false)
Definition: page.cxx:1095
std::unique_ptr< weld::Label > m_xRightMarginLbl
Definition: page.hxx:103
std::unique_ptr< svx::FrameDirectionListBox > m_xTextFlowBox
Definition: page.hxx:98
std::unique_ptr< weld::MetricSpinButton > m_xTopMarginEdit
Definition: page.hxx:105
void Init_Impl()
Definition: page.cxx:304
DECL_LINK(PaperSizeSelect_Impl, weld::ComboBox &, void)
static const WhichRangesContainer pRanges
Definition: page.hxx:66
void SetCollectionList(const std::vector< OUString > &aList)
Definition: page.cxx:1523
void SwapFirstValues_Impl(bool bSet)
Definition: page.cxx:1027
std::unique_ptr< weld::CustomWeld > m_xBspWin
Definition: page.hxx:131
void ResetBackground_Impl(const SfxItemSet &rSet)
Definition: page.cxx:1128
virtual void PageCreated(const SfxAllItemSet &aSet) override
Definition: page.cxx:1630
std::unique_ptr< weld::RadioButton > m_xLandscapeBtn
Definition: page.hxx:96
std::unique_ptr< weld::CheckButton > m_xBackgroundFullSizeCB
Definition: page.hxx:127
Paper ePaperStart
Definition: page.hxx:81
std::unique_ptr< weld::MetricSpinButton > m_xGutterMarginEdit
Definition: page.hxx:108
virtual void FillUserData() override
Definition: page.cxx:610
std::unique_ptr< weld::MetricSpinButton > m_xPaperWidthEdit
Definition: page.hxx:93
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
Definition: page.cxx:135
std::unique_ptr< weld::MetricSpinButton > m_xRightMarginEdit
Definition: page.hxx:104
bool IsPrinterRangeOverflow(weld::MetricSpinButton &rField, tools::Long nFirstMargin, tools::Long nLastMargin, MarginPosition nPos)
Definition: page.cxx:1570
std::unique_ptr< weld::ComboBox > m_xLayoutBox
Definition: page.hxx:111
DECL_LINK(SwapOrientation_Impl, weld::Toggleable &, void)
SvxModeType
long Long
sal_uInt16 MarginPosition
Definition: page.hxx:62
Paper
DeactivateRC