1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_SW_SOURCE_UIBASE_SIDEBAR_PAGEFORMATPANEL_HXX
20 #define INCLUDED_SW_SOURCE_UIBASE_SIDEBAR_PAGEFORMATPANEL_HXX
22 #include <com/sun/star/frame/XFrame.hpp>
24 #include <sfx2/sidebar/PanelLayout.hxx>
26 #include <sfx2/sidebar/ControllerItem.hxx>
28 #include <svx/pageitem.hxx>
29 #include <svx/rulritem.hxx>
30 #include <svx/papersizelistbox.hxx>
32 #include <tools/fldunit.hxx>
33 #include <svl/poolitem.hxx>
34 #include <svx/relfld.hxx>
38 namespace sw::sidebar
{
40 class PageFormatPanel
:
42 public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
45 static VclPtr
<vcl::Window
> Create(
47 const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame
>& rxFrame
,
48 SfxBindings
* pBindings
);
50 virtual void NotifyItemUpdate(
51 const sal_uInt16 nSId
,
52 const SfxItemState eState
,
53 const SfxPoolItem
* pState
) override
;
55 virtual void GetControlState(
56 const sal_uInt16
/*nSId*/,
57 boost::property_tree::ptree
& /*rState*/) override
{};
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
;
66 static FieldUnit
GetCurrentUnit( SfxItemState eState
, const SfxPoolItem
* pState
);
70 SfxBindings
* mpBindings
;
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
;
79 ::sfx2::sidebar::ControllerItem maPaperSizeController
;
80 ::sfx2::sidebar::ControllerItem maPaperOrientationController
;
81 ::sfx2::sidebar::ControllerItem maMetricController
;
82 ::sfx2::sidebar::ControllerItem maSwPageLRControl
;
83 ::sfx2::sidebar::ControllerItem maSwPageULControl
;
85 std::unique_ptr
<SvxPageItem
> mpPageItem
;
86 std::unique_ptr
<SvxLongLRSpaceItem
> mpPageLRMarginItem
;
87 std::unique_ptr
<SvxLongULSpaceItem
> mpPageULMarginItem
;
92 tools::Long mnPageLeftMargin
;
93 tools::Long mnPageRightMargin
;
94 tools::Long mnPageTopMargin
;
95 tools::Long mnPageBottomMargin
;
96 OUString aCustomEntry
;
99 void SetMarginFieldUnit();
100 void UpdateMarginBox();
101 void ExecuteMarginLRChange( const tools::Long nPageLeftMargin
, const tools::Long nPageRightMargin
);
102 void ExecuteMarginULChange( const tools::Long nPageTopMargin
, const tools::Long nPageBottomMargin
);
103 DECL_LINK(PaperFormatModifyHdl
, weld::ComboBox
&, void);
104 DECL_LINK(PaperSizeModifyHdl
, weld::MetricSpinButton
&, void);
105 DECL_LINK(PaperModifyMarginHdl
, weld::ComboBox
&, void );
108 } //end of namespace sw::sidebar
112 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */