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>
24 #include <svx/papersizelistbox.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  <SfxAllEnumItem>: <SID_ATTR_PAPERTRAY>
42  <SvxPaperBinItem>: <SID_ATTR_PAPERBIN>
43  <SvxBoolItem>: <SID_ATTR_EXT1>
44  <SvxBoolItem>: <SID_ATTR_EXT2>
45 
46  <SfxSetItem>: <SID_ATTR_HEADERSET>
47  <SfxBoolItem>: <SID_ATTR_ON>
48  <SfxBoolItem>: <SID_ATTR_DYNAMIC>
49  <SfxBoolItem>: <SID_ATTR_SHARED>
50  <SvxSizeItem>: <SID_ATTR_SIZE>
51  <SvxULSpaceItem>: <SID_ATTR_ULSPACE>
52  <SvxLRSpaceItem>: <SID_ATTR_LRSPACE>
53 
54  <SfxSetItem>: <SID_ATTR_FOOTERSET>
55  <SfxBoolItem>: <SID_ATTR_ON>
56  <SfxBoolItem>: <SID_ATTR_DYNAMIC>
57  <SfxBoolItem>: <SID_ATTR_SHARED>
58  <SvxSizeItem>: <SID_ATTR_SIZE>
59  <SvxULSpaceItem>: <SID_ATTR_ULSPACE>
60  <SvxLRSpaceItem>: <SID_ATTR_LRSPACE>
61 */
62 
63 typedef sal_uInt16 MarginPosition;
64 
66 {
68 private:
78 
79  bool bLandscape;
83 
86 
87  bool mbDelPrinter : 1;
89 
91 
92  // paper format
93  std::unique_ptr<SvxPaperSizeListBox> m_xPaperSizeBox;
94  std::unique_ptr<weld::MetricSpinButton> m_xPaperWidthEdit;
95  std::unique_ptr<weld::MetricSpinButton> m_xPaperHeightEdit;
96  std::unique_ptr<weld::Label> m_xOrientationFT;
97  std::unique_ptr<weld::RadioButton> m_xPortraitBtn;
98  std::unique_ptr<weld::RadioButton> m_xLandscapeBtn;
99  std::unique_ptr<weld::Label> m_xTextFlowLbl;
100  std::unique_ptr<svx::FrameDirectionListBox> m_xTextFlowBox;
101  std::unique_ptr<weld::ComboBox> m_xPaperTrayBox;
102  // Margins
103  std::unique_ptr<weld::Label> m_xLeftMarginLbl;
104  std::unique_ptr<weld::MetricSpinButton> m_xLeftMarginEdit;
105  std::unique_ptr<weld::Label> m_xRightMarginLbl;
106  std::unique_ptr<weld::MetricSpinButton> m_xRightMarginEdit;
107  std::unique_ptr<weld::MetricSpinButton> m_xTopMarginEdit;
108  std::unique_ptr<weld::MetricSpinButton> m_xBottomMarginEdit;
109  std::unique_ptr<weld::Label> m_xGutterMarginLbl;
110  std::unique_ptr<weld::MetricSpinButton> m_xGutterMarginEdit;
111  // layout settings
112  std::unique_ptr<weld::Label> m_xPageText;
113  std::unique_ptr<weld::ComboBox> m_xLayoutBox;
114  std::unique_ptr<weld::Label> m_xNumberFormatText;
115  std::unique_ptr<SvxPageNumberListBox> m_xNumberFormatBox;
116  //Extras Calc
117  std::unique_ptr<weld::Label> m_xTblAlignFT;
118  std::unique_ptr<weld::CheckButton> m_xHorzBox;
119  std::unique_ptr<weld::CheckButton> m_xVertBox;
120  // Impress and Draw
121  std::unique_ptr<weld::CheckButton> m_xAdaptBox;
122  //Register Writer
123  std::unique_ptr<weld::CheckButton> m_xRegisterCB;
124  std::unique_ptr<weld::Label> m_xRegisterFT;
125  std::unique_ptr<weld::ComboBox> m_xRegisterLB;
126  std::unique_ptr<weld::Label> m_xGutterPositionFT;
127  std::unique_ptr<weld::ComboBox> m_xGutterPositionLB;
128  std::unique_ptr<weld::CheckButton> m_xRtlGutterCB;
129  std::unique_ptr<weld::CheckButton> m_xBackgroundFullSizeCB;
130  std::unique_ptr<weld::Label> m_xInsideLbl;
131  std::unique_ptr<weld::Label> m_xOutsideLbl;
132  std::unique_ptr<weld::Label> m_xPrintRangeQueryText;
133  std::unique_ptr<weld::CustomWeld> m_xBspWin;
134 
135  void Init_Impl();
136  DECL_LINK(LayoutHdl_Impl, weld::ComboBox&, void);
137  DECL_LINK(GutterPositionHdl_Impl, weld::ComboBox&, void);
138  DECL_LINK(PaperBinHdl_Impl, weld::Widget&, void);
139  DECL_LINK(SwapOrientation_Impl, weld::Toggleable&, void);
140  void SwapFirstValues_Impl( bool bSet );
141  DECL_LINK(BorderModify_Impl, weld::MetricSpinButton&, void);
142  void InitHeadFoot_Impl( const SfxItemSet& rSet );
143  DECL_LINK(CenterHdl_Impl, weld::Toggleable&, void);
144  void UpdateExample_Impl( bool bResetbackground = false );
145 
146  DECL_LINK(PaperSizeSelect_Impl, weld::ComboBox&, void );
147  DECL_LINK(PaperSizeModify_Impl, weld::MetricSpinButton&, void);
148 
149  DECL_LINK(FrameDirectionModify_Impl, weld::ComboBox&, void );
150 
151  void ResetBackground_Impl( const SfxItemSet& rSet );
152 
153  void RangeHdl_Impl();
154  void CalcMargin_Impl();
155 
156  DECL_LINK(RegisterModify, weld::Toggleable&, void);
157 
158  // page direction
160  void DisableVerticalPageDir();
161 
162  bool IsPrinterRangeOverflow(weld::MetricSpinButton& rField, tools::Long nFirstMargin,
163  tools::Long nLastMargin, MarginPosition nPos);
164  void CheckMarginEdits( bool _bClear );
165  bool IsMarginOutOfRange() const;
166 
167 protected:
168  virtual void ActivatePage( const SfxItemSet& rSet ) override;
169  virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
170 
171 public:
172  SvxPageDescPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet);
173  static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rSet );
174  virtual ~SvxPageDescPage() override;
175 
176  // returns the range of the Which values
178 
179  virtual bool FillItemSet( SfxItemSet* rOutSet ) override;
180  virtual void Reset( const SfxItemSet* rSet ) override;
181  virtual void FillUserData() override;
182 
184  { ePaperStart = eStart; }
185 
186  void SetCollectionList(const std::vector<OUString> &aList);
187  virtual void PageCreated(const SfxAllItemSet& aSet) override;
188 };
189 
190 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< weld::CheckButton > m_xBackgroundFullSizeCB
Definition: page.hxx:129
std::unique_ptr< weld::MetricSpinButton > m_xPaperWidthEdit
Definition: page.hxx:94
std::unique_ptr< weld::Label > m_xGutterMarginLbl
Definition: page.hxx:109
std::unique_ptr< weld::RadioButton > m_xPortraitBtn
Definition: page.hxx:97
std::unique_ptr< weld::MetricSpinButton > m_xPaperHeightEdit
Definition: page.hxx:95
const SfxItemSet * pSet
void RangeHdl_Impl()
Definition: page.cxx:1413
long Long
bool mbDelPrinter
Definition: page.hxx:87
tools::Long nFirstRightMargin
Definition: page.hxx:71
static const WhichRangesContainer pRanges
Definition: page.hxx:67
sal_uInt16 MarginPosition
Definition: page.hxx:63
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: page.cxx:1358
std::unique_ptr< weld::MetricSpinButton > m_xRightMarginEdit
Definition: page.hxx:106
SvxModeType eMode
Definition: page.hxx:81
MarginPosition m_nPos
Definition: page.hxx:84
OUString sStandardRegister
Definition: page.hxx:69
std::unique_ptr< weld::Label > m_xRegisterFT
Definition: page.hxx:124
VclPtr< Printer > mpDefPrinter
Definition: page.hxx:85
std::unique_ptr< weld::Label > m_xNumberFormatText
Definition: page.hxx:114
tools::Long nLastBottomMargin
Definition: page.hxx:77
std::unique_ptr< SvxPageNumberListBox > m_xNumberFormatBox
Definition: page.hxx:115
bool IsMarginOutOfRange() const
Definition: page.cxx:1613
std::unique_ptr< SvxPaperSizeListBox > m_xPaperSizeBox
Definition: page.hxx:93
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: page.cxx:1350
void ResetBackground_Impl(const SfxItemSet &rSet)
Definition: page.cxx:1132
tools::Long nLastTopMargin
Definition: page.hxx:76
void Init_Impl()
Definition: page.cxx:305
SvxPageWindow m_aBspWin
Definition: page.hxx:90
bool bLandscape
Definition: page.hxx:79
void SetCollectionList(const std::vector< OUString > &aList)
Definition: page.cxx:1527
static WhichRangesContainer GetRanges()
Definition: page.hxx:177
std::unique_ptr< weld::Label > m_xOrientationFT
Definition: page.hxx:96
std::unique_ptr< weld::Label > m_xGutterPositionFT
Definition: page.hxx:126
virtual ~SvxPageDescPage() override
Definition: page.cxx:296
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
Definition: page.cxx:133
std::unique_ptr< weld::CustomWeld > m_xBspWin
Definition: page.hxx:133
virtual void PageCreated(const SfxAllItemSet &aSet) override
Definition: page.cxx:1634
tools::Long nFirstTopMargin
Definition: page.hxx:72
tools::Long nLastLeftMargin
Definition: page.hxx:74
tools::Long nLastRightMargin
Definition: page.hxx:75
std::unique_ptr< weld::Label > m_xTextFlowLbl
Definition: page.hxx:99
Paper ePaperStart
Definition: page.hxx:82
void UpdateExample_Impl(bool bResetbackground=false)
Definition: page.cxx:1099
void SwapFirstValues_Impl(bool bSet)
Definition: page.cxx:1031
std::unique_ptr< weld::Label > m_xLeftMarginLbl
Definition: page.hxx:103
Paper
std::unique_ptr< weld::RadioButton > m_xLandscapeBtn
Definition: page.hxx:98
std::unique_ptr< weld::ComboBox > m_xRegisterLB
Definition: page.hxx:125
std::unique_ptr< weld::Label > m_xTblAlignFT
Definition: page.hxx:117
std::unique_ptr< weld::Label > m_xPageText
Definition: page.hxx:112
std::unique_ptr< weld::CheckButton > m_xRtlGutterCB
Definition: page.hxx:128
SvxModeType
bool bBorderModified
Definition: page.hxx:80
std::unique_ptr< weld::Label > m_xInsideLbl
Definition: page.hxx:130
std::unique_ptr< weld::CheckButton > m_xHorzBox
Definition: page.hxx:118
bool IsPrinterRangeOverflow(weld::MetricSpinButton &rField, tools::Long nFirstMargin, tools::Long nLastMargin, MarginPosition nPos)
Definition: page.cxx:1574
SvxPageDescPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: page.cxx:138
virtual bool FillItemSet(SfxItemSet *rOutSet) override
Definition: page.cxx:620
std::unique_ptr< weld::MetricSpinButton > m_xGutterMarginEdit
Definition: page.hxx:110
virtual void FillUserData() override
Definition: page.cxx:613
std::unique_ptr< weld::MetricSpinButton > m_xLeftMarginEdit
Definition: page.hxx:104
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:1594
std::unique_ptr< weld::MetricSpinButton > m_xTopMarginEdit
Definition: page.hxx:107
void SetPaperFormatRanges(Paper eStart)
Definition: page.hxx:183
std::unique_ptr< weld::MetricSpinButton > m_xBottomMarginEdit
Definition: page.hxx:108
std::unique_ptr< svx::FrameDirectionListBox > m_xTextFlowBox
Definition: page.hxx:100
bool mbEnableDrawingLayerFillStyles
Definition: page.hxx:88
void CalcMargin_Impl()
Definition: page.cxx:1479
DeactivateRC
std::unique_ptr< weld::Label > m_xOutsideLbl
Definition: page.hxx:131
tools::Long nFirstLeftMargin
Definition: page.hxx:70
std::unique_ptr< weld::ComboBox > m_xGutterPositionLB
Definition: page.hxx:127
std::unique_ptr< weld::ComboBox > m_xLayoutBox
Definition: page.hxx:113
std::unique_ptr< weld::Label > m_xPrintRangeQueryText
Definition: page.hxx:132
std::unique_ptr< weld::ComboBox > m_xPaperTrayBox
Definition: page.hxx:101
virtual void Reset(const SfxItemSet *rSet) override
Definition: page.cxx:328
void InitHeadFoot_Impl(const SfxItemSet &rSet)
Definition: page.cxx:1231
void DisableVerticalPageDir()
Disables vertical page direction entries in the text flow listbox.
Definition: page.cxx:1556
std::unique_ptr< weld::CheckButton > m_xVertBox
Definition: page.hxx:119
tools::Long nFirstBottomMargin
Definition: page.hxx:73
std::unique_ptr< weld::CheckButton > m_xRegisterCB
Definition: page.hxx:123
DECL_LINK(LayoutHdl_Impl, weld::ComboBox &, void)
std::unique_ptr< weld::CheckButton > m_xAdaptBox
Definition: page.hxx:121
std::unique_ptr< weld::Label > m_xRightMarginLbl
Definition: page.hxx:105