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#pragma once
20
23
24#include <svx/pageitem.hxx>
25#include <svx/rulritem.hxx>
27
28#include <tools/fldunit.hxx>
29#include <svl/poolitem.hxx>
30#include <svx/relfld.hxx>
31
32#include <memory>
33
34namespace sw::sidebar {
35
37 public PanelLayout,
39{
40public:
41 static std::unique_ptr<PanelLayout> Create(
42 weld::Widget* pParent,
43 SfxBindings* pBindings);
44
45 virtual void NotifyItemUpdate(
46 const sal_uInt16 nSId,
47 const SfxItemState eState,
48 const SfxPoolItem* pState) override;
49
50 virtual void GetControlState(
51 const sal_uInt16 /*nSId*/,
52 boost::property_tree::ptree& /*rState*/) override {};
53
55 weld::Widget* pParent,
56 SfxBindings* pBindings);
57 virtual ~PageFormatPanel() override;
58
59 static FieldUnit GetCurrentUnit( SfxItemState eState, const SfxPoolItem* pState );
60
61private:
62
64
65 std::unique_ptr<SvxPaperSizeListBox> mxPaperSizeBox;
66 std::unique_ptr<SvxRelativeField> mxPaperWidth;
67 std::unique_ptr<SvxRelativeField> mxPaperHeight;
68 std::unique_ptr<weld::ComboBox> mxPaperOrientation;
69 std::unique_ptr<weld::ComboBox> mxMarginSelectBox;
70 std::unique_ptr<weld::Label> mxCustomEntry;
71
77
78 std::unique_ptr<SvxPageItem> mpPageItem;
79 std::unique_ptr<SvxLongLRSpaceItem> mpPageLRMarginItem;
80 std::unique_ptr<SvxLongULSpaceItem> mpPageULMarginItem;
81
84
90
91 void Initialize();
92 void SetMarginFieldUnit();
93 void UpdateMarginBox();
94 void ExecuteMarginLRChange( const tools::Long nPageLeftMargin, const tools::Long nPageRightMargin );
95 void ExecuteMarginULChange( const tools::Long nPageTopMargin, const tools::Long nPageBottomMargin);
96 DECL_LINK(PaperFormatModifyHdl, weld::ComboBox&, void);
97 DECL_LINK(PaperSizeModifyHdl, weld::MetricSpinButton&, void);
98 DECL_LINK(PaperModifyMarginHdl, weld::ComboBox&, void );
99};
100
101} //end of namespace sw::sidebar
102
103/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
PageFormatPanel(weld::Widget *pParent, SfxBindings *pBindings)
DECL_LINK(PaperFormatModifyHdl, weld::ComboBox &, void)
static std::unique_ptr< PanelLayout > Create(weld::Widget *pParent, SfxBindings *pBindings)
virtual void GetControlState(const sal_uInt16, boost::property_tree::ptree &) override
std::unique_ptr< SvxRelativeField > mxPaperWidth
DECL_LINK(PaperSizeModifyHdl, weld::MetricSpinButton &, void)
virtual ~PageFormatPanel() override
::sfx2::sidebar::ControllerItem maSwPageLRControl
::sfx2::sidebar::ControllerItem maSwPageULControl
::sfx2::sidebar::ControllerItem maPaperSizeController
std::unique_ptr< SvxLongULSpaceItem > mpPageULMarginItem
std::unique_ptr< SvxPaperSizeListBox > mxPaperSizeBox
virtual void NotifyItemUpdate(const sal_uInt16 nSId, const SfxItemState eState, const SfxPoolItem *pState) override
void ExecuteMarginULChange(const tools::Long nPageTopMargin, const tools::Long nPageBottomMargin)
std::unique_ptr< SvxPageItem > mpPageItem
DECL_LINK(PaperModifyMarginHdl, weld::ComboBox &, void)
std::unique_ptr< weld::Label > mxCustomEntry
std::unique_ptr< weld::ComboBox > mxMarginSelectBox
::sfx2::sidebar::ControllerItem maPaperOrientationController
void ExecuteMarginLRChange(const tools::Long nPageLeftMargin, const tools::Long nPageRightMargin)
std::unique_ptr< weld::ComboBox > mxPaperOrientation
static FieldUnit GetCurrentUnit(SfxItemState eState, const SfxPoolItem *pState)
std::unique_ptr< SvxLongLRSpaceItem > mpPageLRMarginItem
::sfx2::sidebar::ControllerItem maMetricController
std::unique_ptr< SvxRelativeField > mxPaperHeight
FieldUnit
MapUnit
long Long
SfxItemState