LibreOffice Module svx (master) 1
ParaPropertyPanel.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
24#include <svx/relfld.hxx>
25
26#include <com/sun/star/frame/XFrame.hpp>
27#include <com/sun/star/ui/XSidebar.hpp>
28
29#include <svl/poolitem.hxx>
30#include <tools/fldunit.hxx>
31#include <vcl/EnumContext.hxx>
32
34
35namespace svx::sidebar {
36
38 : public PanelLayout,
39 public ::sfx2::sidebar::IContextChangeReceiver,
41{
42public:
43 virtual ~ParaPropertyPanel() override;
44
45 static std::unique_ptr<PanelLayout> Create (
46 weld::Widget* pParent,
47 const css::uno::Reference<css::frame::XFrame>& rxFrame,
48 SfxBindings* pBindings,
49 const css::uno::Reference<css::ui::XSidebar>& rxSidebar);
50
52
53 virtual void HandleContextChange (
54 const vcl::EnumContext& rContext) override;
55
56 virtual void NotifyItemUpdate(
57 const sal_uInt16 nSId,
58 const SfxItemState eState,
59 const SfxPoolItem* pState) override;
60
61 virtual void GetControlState(
62 const sal_uInt16 /*nSId*/,
63 boost::property_tree::ptree& /*rState*/) override {};
64
65 static FieldUnit GetCurrentUnit( SfxItemState eState, const SfxPoolItem* pState );
66
68 weld::Widget* pParent,
69 const css::uno::Reference<css::frame::XFrame>& rxFrame,
70 SfxBindings* pBindings,
71 css::uno::Reference<css::ui::XSidebar> xSidebar);
72
73private:
74 // UI controls
75 //Alignment
76 std::unique_ptr<weld::Toolbar> mxTBxHorzAlign;
77 std::unique_ptr<ToolbarUnoDispatcher> mxHorzAlignDispatch;
78 std::unique_ptr<weld::Toolbar> mxTBxVertAlign;
79 std::unique_ptr<ToolbarUnoDispatcher> mxVertAlignDispatch;
80 //NumBullet&Backcolor
81 std::unique_ptr<weld::Toolbar> mxTBxNumBullet;
82 std::unique_ptr<ToolbarUnoDispatcher> mxNumBulletDispatch;
83 std::unique_ptr<weld::Toolbar> mxTBxBackColor;
84 std::unique_ptr<ToolbarUnoDispatcher> mxBackColorDispatch;
85
86 std::unique_ptr<weld::Toolbar> mxTBxWriteDirection;
87 std::unique_ptr<ToolbarUnoDispatcher> mxWriteDirectionDispatch;
88 std::unique_ptr<weld::Toolbar> mxTBxParaSpacing;
89 std::unique_ptr<ToolbarUnoDispatcher> mxParaSpacingDispatch;
90 std::unique_ptr<weld::Toolbar> mxTBxLineSpacing;
91 std::unique_ptr<ToolbarUnoDispatcher> mxLineSpacingDispatch;
92 std::unique_ptr<weld::Toolbar> mxTBxIndent;
93 std::unique_ptr<ToolbarUnoDispatcher> mxIndentDispatch;
94
95 //Paragraph spacing
96 std::optional<SvxRelativeField> mxTopDist;
97 std::optional<SvxRelativeField> mxBottomDist;
98 std::optional<SvxRelativeField> mxLeftIndent;
99 std::optional<SvxRelativeField> mxRightIndent;
100 std::optional<SvxRelativeField> mxFLineIndent;
101
102 // Data Member
106
111 // Control Items
115
118 css::uno::Reference<css::ui::XSidebar> mxSidebar;
119
120 DECL_LINK(ModifyIndentHdl_Impl, weld::MetricSpinButton&, void);
121 DECL_LINK(ULSpaceHdl_Impl, weld::MetricSpinButton&, void);
122
123 void StateChangedIndentImpl( SfxItemState eState, const SfxPoolItem* pState );
124 void StateChangedULImpl( SfxItemState eState, const SfxPoolItem* pState );
125
126 void initial();
127 void ReSize();
128 void InitToolBoxIndent();
129 void InitToolBoxSpacing();
130 void limitMetricWidths();
131};
132
133} // end of namespace svx::sidebar
134
135/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< ToolbarUnoDispatcher > mxNumBulletDispatch
::sfx2::sidebar::ControllerItem m_aMetricCtl
std::unique_ptr< weld::Toolbar > mxTBxHorzAlign
void StateChangedIndentImpl(SfxItemState eState, const SfxPoolItem *pState)
std::unique_ptr< weld::Toolbar > mxTBxLineSpacing
virtual void GetControlState(const sal_uInt16, boost::property_tree::ptree &) override
std::optional< SvxRelativeField > mxFLineIndent
std::unique_ptr< ToolbarUnoDispatcher > mxBackColorDispatch
DECL_LINK(ULSpaceHdl_Impl, weld::MetricSpinButton &, void)
virtual void NotifyItemUpdate(const sal_uInt16 nSId, const SfxItemState eState, const SfxPoolItem *pState) override
std::unique_ptr< weld::Toolbar > mxTBxVertAlign
std::optional< SvxRelativeField > mxLeftIndent
DECL_LINK(ModifyIndentHdl_Impl, weld::MetricSpinButton &, void)
std::unique_ptr< ToolbarUnoDispatcher > mxLineSpacingDispatch
css::uno::Reference< css::ui::XSidebar > mxSidebar
std::unique_ptr< ToolbarUnoDispatcher > mxParaSpacingDispatch
std::optional< SvxRelativeField > mxTopDist
std::unique_ptr< weld::Toolbar > mxTBxBackColor
static FieldUnit GetCurrentUnit(SfxItemState eState, const SfxPoolItem *pState)
std::unique_ptr< weld::Toolbar > mxTBxIndent
std::unique_ptr< weld::Toolbar > mxTBxParaSpacing
static std::unique_ptr< PanelLayout > Create(weld::Widget *pParent, const css::uno::Reference< css::frame::XFrame > &rxFrame, SfxBindings *pBindings, const css::uno::Reference< css::ui::XSidebar > &rxSidebar)
std::unique_ptr< ToolbarUnoDispatcher > mxVertAlignDispatch
std::optional< SvxRelativeField > mxBottomDist
std::unique_ptr< ToolbarUnoDispatcher > mxWriteDirectionDispatch
std::unique_ptr< ToolbarUnoDispatcher > mxHorzAlignDispatch
::sfx2::sidebar::ControllerItem maULSpaceControl
std::unique_ptr< weld::Toolbar > mxTBxWriteDirection
::sfx2::sidebar::ControllerItem maLRSpaceControl
std::optional< SvxRelativeField > mxRightIndent
ParaPropertyPanel(weld::Widget *pParent, const css::uno::Reference< css::frame::XFrame > &rxFrame, SfxBindings *pBindings, css::uno::Reference< css::ui::XSidebar > xSidebar)
void StateChangedULImpl(SfxItemState eState, const SfxPoolItem *pState)
virtual void HandleContextChange(const vcl::EnumContext &rContext) override
std::unique_ptr< weld::Toolbar > mxTBxNumBullet
std::unique_ptr< ToolbarUnoDispatcher > mxIndentDispatch
FieldUnit
MapUnit
long Long
SfxItemState