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  static const sal_uInt16 pRanges[];
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  // 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_xInsideLbl;
125  std::unique_ptr<weld::Label> m_xOutsideLbl;
126  std::unique_ptr<weld::Label> m_xPrintRangeQueryText;
127  std::unique_ptr<weld::CustomWeld> m_xBspWin;
128 
129  void Init_Impl();
130  DECL_LINK(LayoutHdl_Impl, weld::ComboBox&, void);
131  DECL_LINK(PaperBinHdl_Impl, weld::Widget&, void);
132  DECL_LINK(SwapOrientation_Impl, weld::Button&, void);
133  void SwapFirstValues_Impl( bool bSet );
134  DECL_LINK(BorderModify_Impl, weld::MetricSpinButton&, void);
135  void InitHeadFoot_Impl( const SfxItemSet& rSet );
136  DECL_LINK(CenterHdl_Impl, weld::ToggleButton&, void);
137  void UpdateExample_Impl( bool bResetbackground = false );
138 
139  DECL_LINK(PaperSizeSelect_Impl, weld::ComboBox&, void );
140  DECL_LINK(PaperSizeModify_Impl, weld::MetricSpinButton&, void);
141 
142  DECL_LINK(FrameDirectionModify_Impl, weld::ComboBox&, void );
143 
144  void ResetBackground_Impl( const SfxItemSet& rSet );
145 
146  void RangeHdl_Impl();
147  void CalcMargin_Impl();
148 
149  DECL_LINK(RegisterModify, weld::ToggleButton&, void);
150 
151  // page direction
153  void DisableVerticalPageDir();
154 
155  bool IsPrinterRangeOverflow(weld::MetricSpinButton& rField, long nFirstMargin,
156  long nLastMargin, MarginPosition nPos);
157  void CheckMarginEdits( bool _bClear );
158  bool IsMarginOutOfRange() const;
159 
160 protected:
161  virtual void ActivatePage( const SfxItemSet& rSet ) override;
162  virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
163 
164 public:
165  SvxPageDescPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet);
166  static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rSet );
167  virtual ~SvxPageDescPage() override;
168 
169  // returns the range of the Which values
170  static const sal_uInt16* GetRanges() { return pRanges; }
171 
172  virtual bool FillItemSet( SfxItemSet* rOutSet ) override;
173  virtual void Reset( const SfxItemSet* rSet ) override;
174  virtual void FillUserData() override;
175 
177  { ePaperStart = eStart; }
178 
179  void SetCollectionList(const std::vector<OUString> &aList);
180  virtual void PageCreated(const SfxAllItemSet& aSet) override;
181 };
182 
183 #endif // INCLUDED_CUI_SOURCE_INC_PAGE_HXX
184 
185 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< weld::MetricSpinButton > m_xPaperWidthEdit
Definition: page.hxx:94
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
static const sal_uInt16 pRanges[]
Definition: page.hxx:67
void RangeHdl_Impl()
Definition: page.cxx:1300
bool mbDelPrinter
Definition: page.hxx:87
sal_uInt16 MarginPosition
Definition: page.hxx:63
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: page.cxx:1245
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
long nFirstRightMargin
Definition: page.hxx:71
std::unique_ptr< weld::Label > m_xRegisterFT
Definition: page.hxx:122
VclPtr< Printer > mpDefPrinter
Definition: page.hxx:85
long nFirstLeftMargin
Definition: page.hxx:70
std::unique_ptr< weld::Label > m_xNumberFormatText
Definition: page.hxx:112
std::unique_ptr< SvxPageNumberListBox > m_xNumberFormatBox
Definition: page.hxx:113
bool IsMarginOutOfRange() const
Definition: page.cxx:1500
Paper
std::unique_ptr< SvxPaperSizeListBox > m_xPaperSizeBox
Definition: page.hxx:93
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: page.cxx:1237
void ResetBackground_Impl(const SfxItemSet &rSet)
Definition: page.cxx:1018
void Init_Impl()
Definition: page.cxx:298
SvxPageWindow m_aBspWin
Definition: page.hxx:90
bool bLandscape
Definition: page.hxx:79
void SetCollectionList(const std::vector< OUString > &aList)
Definition: page.cxx:1414
std::unique_ptr< weld::Label > m_xOrientationFT
Definition: page.hxx:96
virtual ~SvxPageDescPage() override
Definition: page.cxx:289
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
Definition: page.cxx:136
std::unique_ptr< weld::CustomWeld > m_xBspWin
Definition: page.hxx:127
virtual void PageCreated(const SfxAllItemSet &aSet) override
Definition: page.cxx:1521
std::unique_ptr< weld::Label > m_xTextFlowLbl
Definition: page.hxx:99
long nLastBottomMargin
Definition: page.hxx:77
Paper ePaperStart
Definition: page.hxx:82
void UpdateExample_Impl(bool bResetbackground=false)
Definition: page.cxx:996
void SwapFirstValues_Impl(bool bSet)
Definition: page.cxx:928
std::unique_ptr< weld::Label > m_xLeftMarginLbl
Definition: page.hxx:103
std::unique_ptr< weld::RadioButton > m_xLandscapeBtn
Definition: page.hxx:98
long nLastRightMargin
Definition: page.hxx:75
std::unique_ptr< weld::ComboBox > m_xRegisterLB
Definition: page.hxx:123
std::unique_ptr< weld::Label > m_xTblAlignFT
Definition: page.hxx:115
long nLastTopMargin
Definition: page.hxx:76
std::unique_ptr< weld::Label > m_xPageText
Definition: page.hxx:110
SvxModeType
bool bBorderModified
Definition: page.hxx:80
std::unique_ptr< weld::Label > m_xInsideLbl
Definition: page.hxx:124
std::unique_ptr< weld::CheckButton > m_xHorzBox
Definition: page.hxx:116
SvxPageDescPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: page.cxx:141
virtual bool FillItemSet(SfxItemSet *rOutSet) override
Definition: page.cxx:559
virtual void FillUserData() override
Definition: page.cxx:552
static const sal_uInt16 * GetRanges()
Definition: page.hxx:170
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:1481
std::unique_ptr< weld::MetricSpinButton > m_xTopMarginEdit
Definition: page.hxx:107
long nLastLeftMargin
Definition: page.hxx:74
void SetPaperFormatRanges(Paper eStart)
Definition: page.hxx:176
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:1366
DeactivateRC
std::unique_ptr< weld::Label > m_xOutsideLbl
Definition: page.hxx:125
std::unique_ptr< weld::ComboBox > m_xLayoutBox
Definition: page.hxx:111
std::unique_ptr< weld::Label > m_xPrintRangeQueryText
Definition: page.hxx:126
std::unique_ptr< weld::ComboBox > m_xPaperTrayBox
Definition: page.hxx:101
virtual void Reset(const SfxItemSet *rSet) override
Definition: page.cxx:319
void InitHeadFoot_Impl(const SfxItemSet &rSet)
Definition: page.cxx:1118
void DisableVerticalPageDir()
Disables vertical page direction entries in the text flow listbox.
Definition: page.cxx:1443
std::unique_ptr< weld::CheckButton > m_xVertBox
Definition: page.hxx:117
std::unique_ptr< weld::CheckButton > m_xRegisterCB
Definition: page.hxx:121
DECL_LINK(LayoutHdl_Impl, weld::ComboBox &, void)
std::unique_ptr< weld::CheckButton > m_xAdaptBox
Definition: page.hxx:119
bool IsPrinterRangeOverflow(weld::MetricSpinButton &rField, long nFirstMargin, long nLastMargin, MarginPosition nPos)
Definition: page.cxx:1461
long nFirstTopMargin
Definition: page.hxx:72
long nFirstBottomMargin
Definition: page.hxx:73
std::unique_ptr< weld::Label > m_xRightMarginLbl
Definition: page.hxx:105