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 
35 class SdrView;
36 
37 namespace svx {
38 class DialControl;
39 };
40 
41 namespace svx::sidebar {
42 
44 : public PanelLayout,
47 {
48 public:
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  const css::uno::Reference<css::ui::XSidebar>& rxSidebar);
75 
76  virtual void GetControlState(
77  const sal_uInt16 nSId,
78  boost::property_tree::ptree& rState) override;
79 
80 private:
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 charts button for online's mobile view
118  std::unique_ptr<weld::Button> mxBtnEditChart;
119 
120  // Internal variables
123  const SdrView* mpView;
124  sal_uInt32 mlOldWidth;
125  sal_uInt32 mlOldHeight;
131 
132  // Controller Items
137 
146 
149 
150  bool mbSizeProtected : 1;
152  bool mbAutoWidth : 1;
153  bool mbAutoHeight : 1;
154  bool mbAdjustEnabled : 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::ToggleButton&, void );
163  DECL_LINK( RotationHdl, svx::DialControl&, void );
164  DECL_STATIC_LINK( PosSizePropertyPanel, ClickChartEditHdl, 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: */
std::unique_ptr< weld::MetricSpinButton > mxMtrAngle
void UpdateUIScale()
Check if the UI scale has changed and handle such a change.
FieldUnit
::sfx2::sidebar::ControllerItem maAutoHeightControl
::sfx2::sidebar::ControllerItem maProPosControl
void MetricState(SfxItemState eState, const SfxPoolItem *pState)
::sfx2::sidebar::ControllerItem maTransfPosXControl
This control allows to input a rotation angle, visualized by a dial.
Definition: dialcontrol.hxx:75
std::unique_ptr< ToolbarUnoDispatcher > mxFlipDispatch
long Long
std::unique_ptr< weld::Toolbar > mxAlignTbx2
std::unique_ptr< weld::MetricSpinButton > mxMtrHeight
virtual void HandleContextChange(const vcl::EnumContext &rContext) override
::sfx2::sidebar::ControllerItem maSvxAngleControl
std::unique_ptr< weld::MetricSpinButton > mxMtrWidth
DECL_STATIC_LINK(PosSizePropertyPanel, ClickChartEditHdl, weld::Button &, void)
virtual void DumpAsPropertyTree(tools::JsonWriter &) override
std::unique_ptr< ToolbarUnoDispatcher > mxAlignDispatch
::sfx2::sidebar::ControllerItem m_aMetricCtl
::sfx2::sidebar::ControllerItem maTransfWidthControl
std::unique_ptr< weld::Toolbar > mxAlignTbx
virtual void NotifyItemUpdate(const sal_uInt16 nSId, const SfxItemState eState, const SfxPoolItem *pState) override
std::unique_ptr< ToolbarUnoDispatcher > mxAlignDispatch2
std::unique_ptr< ToolbarUnoDispatcher > mxArrangeDispatch
std::unique_ptr< weld::Toolbar > mxFlipTbx
css::uno::Reference< css::ui::XSidebar > mxSidebar
std::unique_ptr< weld::Toolbar > mxArrangeTbx2
std::unique_ptr< weld::Label > mxFtWidth
::sfx2::sidebar::ControllerItem maRotYControl
std::unique_ptr< weld::CheckButton > mxCbxScale
DECL_LINK(ChangePosXHdl, weld::MetricSpinButton &, void)
std::unique_ptr< weld::Label > mxFtHeight
std::unique_ptr< weld::MetricSpinButton > mxMtrPosX
static FieldUnit GetCurrentUnit(SfxItemState eState, const SfxPoolItem *pState)
std::unique_ptr< weld::Label > mxFtPosY
std::unique_ptr< weld::Label > mxFtPosX
::sfx2::sidebar::ControllerItem maTransfPosYControl
::sfx2::sidebar::ControllerItem maProSizeControl
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 > mxArrangeDispatch2
std::unique_ptr< weld::CustomWeld > mxDial
SfxItemState
std::unique_ptr< weld::MetricSpinButton > mxMtrPosY
std::unique_ptr< weld::Button > mxBtnEditChart
std::unique_ptr< svx::DialControl > mxCtrlDial
::sfx2::sidebar::ControllerItem maRotXControl
std::unique_ptr< weld::Label > mxFtFlip
MapUnit
::sfx2::sidebar::ControllerItem maAutoWidthControl
std::unique_ptr< weld::Label > mxFtAngle
std::unique_ptr< weld::Toolbar > mxArrangeTbx
PosSizePropertyPanel(weld::Widget *pParent, const css::uno::Reference< css::frame::XFrame > &rxFrame, SfxBindings *pBindings, const css::uno::Reference< css::ui::XSidebar > &rxSidebar)
::sfx2::sidebar::ControllerItem maTransfHeightControl
virtual void GetControlState(const sal_uInt16 nSId, boost::property_tree::ptree &rState) override