LibreOffice Module svx (master) 1
PosSizePropertyPanel.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_SVX_SOURCE_SIDEBAR_POSSIZE_POSSIZEPROPERTYPANEL_HXX
20#define INCLUDED_SVX_SOURCE_SIDEBAR_POSSIZE_POSSIZEPROPERTYPANEL_HXX
21
24#include <sfx2/weldutils.hxx>
26#include <svl/poolitem.hxx>
27#include <tools/fldunit.hxx>
28#include <tools/fract.hxx>
29#include <com/sun/star/ui/XSidebar.hpp>
31#include <vcl/EnumContext.hxx>
32#include <vcl/customweld.hxx>
33#include <vcl/weld.hxx>
34
35class SdrView;
36
37namespace svx {
38class DialControl;
39};
40
41namespace svx::sidebar {
42
44: public PanelLayout,
45 public ::sfx2::sidebar::IContextChangeReceiver,
47{
48public:
49 virtual ~PosSizePropertyPanel() override;
50
51 static std::unique_ptr<PanelLayout> Create(
52 weld::Widget* pParent,
53 const css::uno::Reference<css::frame::XFrame>& rxFrame,
54 SfxBindings* pBindings,
55 const css::uno::Reference<css::ui::XSidebar>& rxSidebar);
56
57 virtual void HandleContextChange(
58 const vcl::EnumContext& rContext) override;
59
60 virtual void NotifyItemUpdate(
61 const sal_uInt16 nSId,
62 const SfxItemState eState,
63 const SfxPoolItem* pState) override;
64
65 virtual void DumpAsPropertyTree(tools::JsonWriter&) override;
66
68
69 // constructor/destructor
71 weld::Widget* pParent,
72 const css::uno::Reference<css::frame::XFrame>& rxFrame,
73 SfxBindings* pBindings,
74 css::uno::Reference<css::ui::XSidebar> xSidebar);
75
76 virtual void GetControlState(
77 const sal_uInt16 nSId,
78 boost::property_tree::ptree& rState) override;
79
80private:
81 //Position
82 std::unique_ptr<weld::Label> mxFtPosX;
83 std::unique_ptr<weld::MetricSpinButton> mxMtrPosX;
84 std::unique_ptr<weld::Label> mxFtPosY;
85 std::unique_ptr<weld::MetricSpinButton> mxMtrPosY;
86
87 // size
88 std::unique_ptr<weld::Label> mxFtWidth;
89 std::unique_ptr<weld::MetricSpinButton> mxMtrWidth;
90 std::unique_ptr<weld::Label> mxFtHeight;
91 std::unique_ptr<weld::MetricSpinButton> mxMtrHeight;
92 std::unique_ptr<weld::CheckButton> mxCbxScale;
93
94 //rotation
95 std::unique_ptr<weld::Label> mxFtAngle;
96 std::unique_ptr<weld::MetricSpinButton> mxMtrAngle;
97
98 //rotation control
99 std::unique_ptr<svx::DialControl> mxCtrlDial;
100 std::unique_ptr<weld::CustomWeld> mxDial;
101
102 //flip
103 std::unique_ptr<weld::Label> mxFtFlip;
104 std::unique_ptr<weld::Toolbar> mxFlipTbx;
105 std::unique_ptr<ToolbarUnoDispatcher> mxFlipDispatch;
106
107 std::unique_ptr<weld::Toolbar> mxArrangeTbx;
108 std::unique_ptr<ToolbarUnoDispatcher> mxArrangeDispatch;
109 std::unique_ptr<weld::Toolbar> mxArrangeTbx2;
110 std::unique_ptr<ToolbarUnoDispatcher> mxArrangeDispatch2;
111
112 std::unique_ptr<weld::Toolbar> mxAlignTbx;
113 std::unique_ptr<ToolbarUnoDispatcher> mxAlignDispatch;
114 std::unique_ptr<weld::Toolbar> mxAlignTbx2;
115 std::unique_ptr<ToolbarUnoDispatcher> mxAlignDispatch2;
116
117 //edit objects button for online's mobile view
118 std::unique_ptr<weld::Button> mxBtnEditOLEObject;
119
120 // Internal variables
124 sal_uInt32 mlOldWidth;
125 sal_uInt32 mlOldHeight;
131
132 // Controller Items
137
146
149
152 bool mbAutoWidth : 1;
153 bool mbAutoHeight : 1;
155
156 css::uno::Reference<css::ui::XSidebar> mxSidebar;
157
158 DECL_LINK( ChangePosXHdl, weld::MetricSpinButton&, void );
159 DECL_LINK( ChangePosYHdl, weld::MetricSpinButton&, void );
160 DECL_LINK( ChangeWidthHdl, weld::MetricSpinButton&, void );
161 DECL_LINK( ChangeHeightHdl, weld::MetricSpinButton&, void );
162 DECL_LINK( ClickAutoHdl, weld::Toggleable&, void );
163 DECL_LINK( RotationHdl, svx::DialControl&, void );
164 DECL_STATIC_LINK( PosSizePropertyPanel, ClickObjectEditHdl, weld::Button&, void );
165
166 void Initialize();
167 void executeSize();
168
169 void MetricState( SfxItemState eState, const SfxPoolItem* pState );
170 static FieldUnit GetCurrentUnit( SfxItemState eState, const SfxPoolItem* pState );
171 void DisableControls();
172 void SetPosSizeMinMax();
173
184 void UpdateUIScale();
185};
186
187
188} // end of namespace svx::sidebar
189
190
191#endif // INCLUDED_SVX_SOURCE_SIDEBAR_POSSIZE_POSSIZEPROPERTYPANEL_HXX
192
193/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This control allows to input a rotation angle, visualized by a dial.
Definition: dialcontrol.hxx:76
std::unique_ptr< weld::Label > mxFtHeight
std::unique_ptr< weld::Label > mxFtAngle
DECL_LINK(ChangePosYHdl, weld::MetricSpinButton &, void)
::sfx2::sidebar::ControllerItem maAutoWidthControl
std::unique_ptr< weld::Button > mxBtnEditOLEObject
::sfx2::sidebar::ControllerItem maTransfPosYControl
::sfx2::sidebar::ControllerItem maSvxAngleControl
::sfx2::sidebar::ControllerItem maRotYControl
std::unique_ptr< ToolbarUnoDispatcher > mxAlignDispatch
::sfx2::sidebar::ControllerItem maTransfHeightControl
std::unique_ptr< weld::MetricSpinButton > mxMtrWidth
std::unique_ptr< weld::MetricSpinButton > mxMtrPosY
::sfx2::sidebar::ControllerItem m_aMetricCtl
::sfx2::sidebar::ControllerItem maRotXControl
std::unique_ptr< weld::MetricSpinButton > mxMtrPosX
::sfx2::sidebar::ControllerItem maTransfWidthControl
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)
css::uno::Reference< css::ui::XSidebar > mxSidebar
std::unique_ptr< weld::Label > mxFtPosY
std::unique_ptr< weld::MetricSpinButton > mxMtrAngle
std::unique_ptr< weld::CheckButton > mxCbxScale
DECL_STATIC_LINK(PosSizePropertyPanel, ClickObjectEditHdl, weld::Button &, void)
std::unique_ptr< weld::Label > mxFtPosX
std::unique_ptr< weld::Toolbar > mxArrangeTbx
std::unique_ptr< weld::CustomWeld > mxDial
std::unique_ptr< ToolbarUnoDispatcher > mxAlignDispatch2
std::unique_ptr< weld::Label > mxFtWidth
DECL_LINK(ChangePosXHdl, weld::MetricSpinButton &, void)
virtual void DumpAsPropertyTree(tools::JsonWriter &) override
std::unique_ptr< weld::Toolbar > mxFlipTbx
std::unique_ptr< weld::Label > mxFtFlip
std::unique_ptr< weld::Toolbar > mxArrangeTbx2
std::unique_ptr< weld::Toolbar > mxAlignTbx2
virtual void GetControlState(const sal_uInt16 nSId, boost::property_tree::ptree &rState) override
void MetricState(SfxItemState eState, const SfxPoolItem *pState)
std::unique_ptr< weld::Toolbar > mxAlignTbx
std::unique_ptr< svx::DialControl > mxCtrlDial
std::unique_ptr< ToolbarUnoDispatcher > mxFlipDispatch
::sfx2::sidebar::ControllerItem maTransfPosXControl
static FieldUnit GetCurrentUnit(SfxItemState eState, const SfxPoolItem *pState)
DECL_LINK(ClickAutoHdl, weld::Toggleable &, void)
::sfx2::sidebar::ControllerItem maProPosControl
DECL_LINK(ChangeWidthHdl, weld::MetricSpinButton &, void)
::sfx2::sidebar::ControllerItem maProSizeControl
std::unique_ptr< weld::MetricSpinButton > mxMtrHeight
virtual void NotifyItemUpdate(const sal_uInt16 nSId, const SfxItemState eState, const SfxPoolItem *pState) override
::sfx2::sidebar::ControllerItem maAutoHeightControl
DECL_LINK(RotationHdl, svx::DialControl &, void)
DECL_LINK(ChangeHeightHdl, weld::MetricSpinButton &, void)
virtual void HandleContextChange(const vcl::EnumContext &rContext) override
std::unique_ptr< ToolbarUnoDispatcher > mxArrangeDispatch2
std::unique_ptr< ToolbarUnoDispatcher > mxArrangeDispatch
PosSizePropertyPanel(weld::Widget *pParent, const css::uno::Reference< css::frame::XFrame > &rxFrame, SfxBindings *pBindings, css::uno::Reference< css::ui::XSidebar > xSidebar)
void UpdateUIScale()
Check if the UI scale has changed and handle such a change.
FieldUnit
MapUnit
long Long
SfxItemState