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 #ifndef INCLUDED_CUI_SOURCE_INC_PAGE_HXX
20 #define INCLUDED_CUI_SOURCE_INC_PAGE_HXX
21 
22 #include <sfx2/tabdlg.hxx>
23 #include <svx/pagectrl.hxx>
25 #include <svx/papersizelistbox.hxx>
26 #include <svx/frmdirlbox.hxx>
27 #include <i18nutil/paper.hxx>
28 #include <svx/flagsdef.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 {
67  friend class VclPtr<SvxPageDescPage>;
70 
71  static const sal_uInt16 pRanges[];
72 private:
82 
83  bool bLandscape;
87 
90 
91  bool mbDelPrinter : 1;
93 
95 
96  // paper format
97  std::unique_ptr<SvxPaperSizeListBox> m_xPaperSizeBox;
98  std::unique_ptr<weld::MetricSpinButton> m_xPaperWidthEdit;
99  std::unique_ptr<weld::MetricSpinButton> m_xPaperHeightEdit;
100  std::unique_ptr<weld::Label> m_xOrientationFT;
101  std::unique_ptr<weld::RadioButton> m_xPortraitBtn;
102  std::unique_ptr<weld::RadioButton> m_xLandscapeBtn;
103  std::unique_ptr<weld::Label> m_xTextFlowLbl;
104  std::unique_ptr<svx::FrameDirectionListBox> m_xTextFlowBox;
105  std::unique_ptr<weld::ComboBox> m_xPaperTrayBox;
106  // Margins
107  std::unique_ptr<weld::Label> m_xLeftMarginLbl;
108  std::unique_ptr<weld::MetricSpinButton> m_xLeftMarginEdit;
109  std::unique_ptr<weld::Label> m_xRightMarginLbl;
110  std::unique_ptr<weld::MetricSpinButton> m_xRightMarginEdit;
111  std::unique_ptr<weld::MetricSpinButton> m_xTopMarginEdit;
112  std::unique_ptr<weld::MetricSpinButton> m_xBottomMarginEdit;
113  // layout settings
114  std::unique_ptr<weld::Label> m_xPageText;
115  std::unique_ptr<weld::ComboBox> m_xLayoutBox;
116  std::unique_ptr<SvxPageNumberListBox> m_xNumberFormatBox;
117  //Extras Calc
118  std::unique_ptr<weld::Label> m_xTblAlignFT;
119  std::unique_ptr<weld::CheckButton> m_xHorzBox;
120  std::unique_ptr<weld::CheckButton> m_xVertBox;
121  // Impress and Draw
122  std::unique_ptr<weld::CheckButton> m_xAdaptBox;
123  //Register Writer
124  std::unique_ptr<weld::CheckButton> m_xRegisterCB;
125  std::unique_ptr<weld::Label> m_xRegisterFT;
126  std::unique_ptr<weld::ComboBox> m_xRegisterLB;
127  std::unique_ptr<weld::Label> m_xInsideLbl;
128  std::unique_ptr<weld::Label> m_xOutsideLbl;
129  std::unique_ptr<weld::Label> m_xPrintRangeQueryText;
130  std::unique_ptr<weld::CustomWeld> m_xBspWin;
131 
132  void Init_Impl();
133  DECL_LINK(LayoutHdl_Impl, weld::ComboBox&, void);
134  DECL_LINK(PaperBinHdl_Impl, weld::Widget&, void);
135  DECL_LINK(SwapOrientation_Impl, weld::Button&, void);
136  void SwapFirstValues_Impl( bool bSet );
137  DECL_LINK(BorderModify_Impl, weld::MetricSpinButton&, void);
138  void InitHeadFoot_Impl( const SfxItemSet& rSet );
139  DECL_LINK(CenterHdl_Impl, weld::ToggleButton&, void);
140  void UpdateExample_Impl( bool bResetbackground = false );
141 
142  DECL_LINK(PaperSizeSelect_Impl, weld::ComboBox&, void );
143  DECL_LINK(PaperSizeModify_Impl, weld::MetricSpinButton&, void);
144 
145  DECL_LINK(FrameDirectionModify_Impl, weld::ComboBox&, void );
146 
147  void ResetBackground_Impl( const SfxItemSet& rSet );
148 
149  void RangeHdl_Impl();
150  void CalcMargin_Impl();
151 
152  DECL_LINK(RegisterModify, weld::ToggleButton&, void);
153 
154  // page direction
156  void DisableVerticalPageDir();
157 
158  bool IsPrinterRangeOverflow(weld::MetricSpinButton& rField, long nFirstMargin,
159  long nLastMargin, MarginPosition nPos);
160  void CheckMarginEdits( bool _bClear );
161  bool IsMarginOutOfRange() const;
162 
163  SvxPageDescPage(TabPageParent pParent, const SfxItemSet& rSet);
164 
165 protected:
166  virtual void ActivatePage( const SfxItemSet& rSet ) override;
167  virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
168 
169 public:
170  static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rSet );
171  // returns the range of the Which values
172  static const sal_uInt16* GetRanges() { return pRanges; }
173 
174  virtual bool FillItemSet( SfxItemSet* rOutSet ) override;
175  virtual void Reset( const SfxItemSet* rSet ) override;
176  virtual void FillUserData() override;
177 
178  virtual ~SvxPageDescPage() override;
179  virtual void dispose() 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 #endif // INCLUDED_CUI_SOURCE_INC_PAGE_HXX
189 
190 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SvxPageDescPage(TabPageParent pParent, const SfxItemSet &rSet)
Definition: page.cxx:141
std::unique_ptr< weld::MetricSpinButton > m_xPaperWidthEdit
Definition: page.hxx:98
std::unique_ptr< weld::RadioButton > m_xPortraitBtn
Definition: page.hxx:101
std::unique_ptr< weld::MetricSpinButton > m_xPaperHeightEdit
Definition: page.hxx:99
const SfxItemSet * pSet
static const sal_uInt16 pRanges[]
Definition: page.hxx:71
void RangeHdl_Impl()
Definition: page.cxx:1305
bool mbDelPrinter
Definition: page.hxx:91
sal_uInt16 MarginPosition
Definition: page.hxx:63
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: page.cxx:1250
std::unique_ptr< weld::MetricSpinButton > m_xRightMarginEdit
Definition: page.hxx:110
SvxModeType eMode
Definition: page.hxx:85
MarginPosition m_nPos
Definition: page.hxx:88
OUString sStandardRegister
Definition: page.hxx:73
long nFirstRightMargin
Definition: page.hxx:75
std::unique_ptr< weld::Label > m_xRegisterFT
Definition: page.hxx:125
VclPtr< Printer > mpDefPrinter
Definition: page.hxx:89
long nFirstLeftMargin
Definition: page.hxx:74
std::unique_ptr< SvxPageNumberListBox > m_xNumberFormatBox
Definition: page.hxx:116
bool IsMarginOutOfRange() const
Definition: page.cxx:1505
Paper
std::unique_ptr< SvxPaperSizeListBox > m_xPaperSizeBox
Definition: page.hxx:97
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: page.cxx:1242
void ResetBackground_Impl(const SfxItemSet &rSet)
Definition: page.cxx:1023
void Init_Impl()
Definition: page.cxx:303
SvxPageWindow m_aBspWin
Definition: page.hxx:94
static VclPtr< SfxTabPage > Create(TabPageParent pParent, const SfxItemSet *rSet)
Definition: page.cxx:136
bool bLandscape
Definition: page.hxx:83
virtual void ActivatePage()
void SetCollectionList(const std::vector< OUString > &aList)
Definition: page.cxx:1419
std::unique_ptr< weld::Label > m_xOrientationFT
Definition: page.hxx:100
virtual ~SvxPageDescPage() override
Definition: page.cxx:288
std::unique_ptr< weld::CustomWeld > m_xBspWin
Definition: page.hxx:130
virtual void PageCreated(const SfxAllItemSet &aSet) override
Definition: page.cxx:1526
std::unique_ptr< weld::Label > m_xTextFlowLbl
Definition: page.hxx:103
long nLastBottomMargin
Definition: page.hxx:81
Paper ePaperStart
Definition: page.hxx:86
void UpdateExample_Impl(bool bResetbackground=false)
Definition: page.cxx:1001
void SwapFirstValues_Impl(bool bSet)
Definition: page.cxx:933
std::unique_ptr< weld::Label > m_xLeftMarginLbl
Definition: page.hxx:107
std::unique_ptr< weld::RadioButton > m_xLandscapeBtn
Definition: page.hxx:102
long nLastRightMargin
Definition: page.hxx:79
std::unique_ptr< weld::ComboBox > m_xRegisterLB
Definition: page.hxx:126
std::unique_ptr< weld::Label > m_xTblAlignFT
Definition: page.hxx:118
long nLastTopMargin
Definition: page.hxx:80
std::unique_ptr< weld::Label > m_xPageText
Definition: page.hxx:114
SvxModeType
bool bBorderModified
Definition: page.hxx:84
std::unique_ptr< weld::Label > m_xInsideLbl
Definition: page.hxx:127
std::unique_ptr< weld::CheckButton > m_xHorzBox
Definition: page.hxx:119
virtual bool FillItemSet(SfxItemSet *rOutSet) override
Definition: page.cxx:564
virtual void FillUserData() override
Definition: page.cxx:557
static const sal_uInt16 * GetRanges()
Definition: page.hxx:172
std::unique_ptr< weld::MetricSpinButton > m_xLeftMarginEdit
Definition: page.hxx:108
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:1486
std::unique_ptr< weld::MetricSpinButton > m_xTopMarginEdit
Definition: page.hxx:111
long nLastLeftMargin
Definition: page.hxx:78
void SetPaperFormatRanges(Paper eStart)
Definition: page.hxx:181
std::unique_ptr< weld::MetricSpinButton > m_xBottomMarginEdit
Definition: page.hxx:112
std::unique_ptr< svx::FrameDirectionListBox > m_xTextFlowBox
Definition: page.hxx:104
bool mbEnableDrawingLayerFillStyles
Definition: page.hxx:92
void CalcMargin_Impl()
Definition: page.cxx:1371
DeactivateRC
std::unique_ptr< weld::Label > m_xOutsideLbl
Definition: page.hxx:128
std::unique_ptr< weld::ComboBox > m_xLayoutBox
Definition: page.hxx:115
std::unique_ptr< weld::Label > m_xPrintRangeQueryText
Definition: page.hxx:129
virtual void DeactivatePage()
std::unique_ptr< weld::ComboBox > m_xPaperTrayBox
Definition: page.hxx:105
virtual void Reset(const SfxItemSet *rSet) override
Definition: page.cxx:324
void InitHeadFoot_Impl(const SfxItemSet &rSet)
Definition: page.cxx:1123
void DisableVerticalPageDir()
Disables vertical page direction entries in the text flow listbox.
Definition: page.cxx:1448
std::unique_ptr< weld::CheckButton > m_xVertBox
Definition: page.hxx:120
std::unique_ptr< weld::CheckButton > m_xRegisterCB
Definition: page.hxx:124
DECL_LINK(LayoutHdl_Impl, weld::ComboBox &, void)
std::unique_ptr< weld::CheckButton > m_xAdaptBox
Definition: page.hxx:122
bool IsPrinterRangeOverflow(weld::MetricSpinButton &rField, long nFirstMargin, long nLastMargin, MarginPosition nPos)
Definition: page.cxx:1466
virtual void dispose() override
Definition: page.cxx:293
long nFirstTopMargin
Definition: page.hxx:76
long nFirstBottomMargin
Definition: page.hxx:77
std::unique_ptr< weld::Label > m_xRightMarginLbl
Definition: page.hxx:109