LibreOffice Module sw (master)  1
PageFormatPanel.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_SW_SOURCE_UIBASE_SIDEBAR_PAGEFORMATPANEL_HXX
20 #define INCLUDED_SW_SOURCE_UIBASE_SIDEBAR_PAGEFORMATPANEL_HXX
21 
22 #include <com/sun/star/frame/XFrame.hpp>
23 
25 
27 
28 #include <svx/pageitem.hxx>
29 #include <svx/rulritem.hxx>
30 #include <svx/papersizelistbox.hxx>
31 
32 #include <tools/fldunit.hxx>
33 #include <svl/poolitem.hxx>
34 #include <svx/relfld.hxx>
35 
36 #include <memory>
37 
38 namespace sw::sidebar {
39 
41  public PanelLayout,
43 {
44 public:
46  vcl::Window* pParent,
47  const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxFrame,
48  SfxBindings* pBindings);
49 
50  virtual void NotifyItemUpdate(
51  const sal_uInt16 nSId,
52  const SfxItemState eState,
53  const SfxPoolItem* pState) override;
54 
55  virtual void GetControlState(
56  const sal_uInt16 /*nSId*/,
57  boost::property_tree::ptree& /*rState*/) override {};
58 
60  vcl::Window* pParent,
61  const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxFrame,
62  SfxBindings* pBindings);
63  virtual ~PageFormatPanel() override;
64  virtual void dispose() override;
65 
66  static FieldUnit GetCurrentUnit( SfxItemState eState, const SfxPoolItem* pState );
67 
68 private:
69 
71 
72  std::unique_ptr<SvxPaperSizeListBox> mxPaperSizeBox;
73  std::unique_ptr<SvxRelativeField> mxPaperWidth;
74  std::unique_ptr<SvxRelativeField> mxPaperHeight;
75  std::unique_ptr<weld::ComboBox> mxPaperOrientation;
76  std::unique_ptr<weld::ComboBox> mxMarginSelectBox;
77  std::unique_ptr<weld::Label> mxCustomEntry;
78 
84 
85  std::unique_ptr<SvxPageItem> mpPageItem;
86  std::unique_ptr<SvxLongLRSpaceItem> mpPageLRMarginItem;
87  std::unique_ptr<SvxLongULSpaceItem> mpPageULMarginItem;
88 
91 
96  OUString aCustomEntry;
97 
98  void Initialize();
99  void SetMarginFieldUnit();
100  void UpdateMarginBox();
101  void ExecuteMarginLRChange( const long nPageLeftMargin, const long nPageRightMargin );
102  void ExecuteMarginULChange( const long nPageTopMargin, const long nPageBottomMargin);
103  DECL_LINK(PaperFormatModifyHdl, weld::ComboBox&, void);
104  DECL_LINK(PaperSizeModifyHdl, weld::MetricSpinButton&, void);
105  DECL_LINK(PaperModifyMarginHdl, weld::ComboBox&, void );
106 };
107 
108 } //end of namespace sw::sidebar
109 
110 #endif
111 
112 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
::sfx2::sidebar::ControllerItem maPaperOrientationController
FieldUnit
std::unique_ptr< weld::ComboBox > mxMarginSelectBox
void ExecuteMarginULChange(const long nPageTopMargin, const long nPageBottomMargin)
virtual void NotifyItemUpdate(const sal_uInt16 nSId, const SfxItemState eState, const SfxPoolItem *pState) override
::sfx2::sidebar::ControllerItem maSwPageLRControl
DECL_LINK(PaperFormatModifyHdl, weld::ComboBox &, void)
void ExecuteMarginLRChange(const long nPageLeftMargin, const long nPageRightMargin)
::sfx2::sidebar::ControllerItem maSwPageULControl
static FieldUnit GetCurrentUnit(SfxItemState eState, const SfxPoolItem *pState)
std::unique_ptr< SvxRelativeField > mxPaperWidth
std::unique_ptr< SvxRelativeField > mxPaperHeight
std::unique_ptr< SvxPageItem > mpPageItem
std::unique_ptr< SvxLongLRSpaceItem > mpPageLRMarginItem
::sfx2::sidebar::ControllerItem maMetricController
PageFormatPanel(vcl::Window *pParent, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > &rxFrame, SfxBindings *pBindings)
SfxItemState
std::unique_ptr< SvxLongULSpaceItem > mpPageULMarginItem
std::unique_ptr< weld::ComboBox > mxPaperOrientation
virtual ~PageFormatPanel() override
std::unique_ptr< SvxPaperSizeListBox > mxPaperSizeBox
MapUnit
virtual void GetControlState(const sal_uInt16, boost::property_tree::ptree &) override
::sfx2::sidebar::ControllerItem maPaperSizeController
std::unique_ptr< weld::Label > mxCustomEntry
virtual void dispose() override
static VclPtr< vcl::Window > Create(vcl::Window *pParent, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > &rxFrame, SfxBindings *pBindings)