LibreOffice Module sw (master)  1
PageHeaderPanel.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 
20 #pragma once
21 
22 #include <memory>
25 #include <svl/intitem.hxx>
26 #include <svl/poolitem.hxx>
27 #include <svl/eitem.hxx>
28 #include <svx/rulritem.hxx>
29 
30 namespace sw::sidebar {
31 
33  public PanelLayout,
35 {
36 public:
37  static std::unique_ptr<PanelLayout> Create(
38  weld::Widget* pParent,
39  SfxBindings* pBindings);
40 
41  virtual void NotifyItemUpdate(
42  const sal_uInt16 nSId,
43  const SfxItemState eState,
44  const SfxPoolItem* pState) override;
45 
46  virtual void GetControlState(
47  const sal_uInt16 /*nSId*/,
48  boost::property_tree::ptree& /*rState*/) override {};
49 
50  SfxBindings* GetBindings() const { return mpBindings; }
52  weld::Widget* pParent,
53  SfxBindings* pBindings);
54  virtual ~PageHeaderPanel() override;
55 
56 private:
57 
59 
65 
67 
68  OUString aCustomEntry;
69 
70  void Initialize();
72  void UpdateHeaderCheck();
73  void UpdateMarginControl();
74  void UpdateSpacingControl();
75  void UpdateLayoutControl();
76 
77  ::std::unique_ptr<SfxBoolItem> mpHeaderItem;
78  ::std::unique_ptr<SvxLongLRSpaceItem> mpHeaderLRMarginItem;
79  ::std::unique_ptr<SvxLongULSpaceItem> mpHeaderSpacingItem;
80  ::std::unique_ptr<SfxInt16Item> mpHeaderLayoutItem;
81 
82  std::unique_ptr<weld::CheckButton> mxHeaderToggle;
83  std::unique_ptr<weld::ComboBox> mxHeaderSpacingLB;
84  std::unique_ptr<weld::ComboBox> mxHeaderMarginPresetLB;
85  std::unique_ptr<weld::ComboBox> mxHeaderLayoutLB;
86  std::unique_ptr<weld::Label> mxCustomEntry;
87 
88  static FieldUnit GetCurrentUnit(SfxItemState eState, const SfxPoolItem* pState);
89 
90  DECL_LINK( HeaderToggleHdl, weld::Toggleable&, void );
91  DECL_LINK( HeaderLRMarginHdl, weld::ComboBox&, void);
92  DECL_LINK( HeaderSpacingHdl, weld::ComboBox&, void);
93  DECL_LINK( HeaderLayoutHdl, weld::ComboBox&, void);
94 };
95 
96 } //end of namespace sw::sidebar
97 
98 
99 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
FieldUnit
std::unique_ptr< weld::ComboBox > mxHeaderSpacingLB
::sfx2::sidebar::ControllerItem maHFToggleController
::sfx2::sidebar::ControllerItem maHeaderLayoutController
::sfx2::sidebar::ControllerItem maMetricController
PageHeaderPanel(weld::Widget *pParent, SfxBindings *pBindings)
virtual void NotifyItemUpdate(const sal_uInt16 nSId, const SfxItemState eState, const SfxPoolItem *pState) override
std::unique_ptr< weld::ComboBox > mxHeaderMarginPresetLB
virtual ~PageHeaderPanel() override
std::unique_ptr< weld::CheckButton > mxHeaderToggle
static FieldUnit GetCurrentUnit(SfxItemState eState, const SfxPoolItem *pState)
static std::unique_ptr< PanelLayout > Create(weld::Widget *pParent, SfxBindings *pBindings)
::std::unique_ptr< SfxInt16Item > mpHeaderLayoutItem
std::unique_ptr< weld::ComboBox > mxHeaderLayoutLB
SfxBindings * GetBindings() const
::std::unique_ptr< SvxLongLRSpaceItem > mpHeaderLRMarginItem
::sfx2::sidebar::ControllerItem maHeaderSpacingController
SfxItemState
::std::unique_ptr< SfxBoolItem > mpHeaderItem
::sfx2::sidebar::ControllerItem maHeaderLRMarginController
virtual void GetControlState(const sal_uInt16, boost::property_tree::ptree &) override
DECL_LINK(HeaderToggleHdl, weld::Toggleable &, void)
std::unique_ptr< weld::Label > mxCustomEntry
::std::unique_ptr< SvxLongULSpaceItem > mpHeaderSpacingItem