LibreOffice Module cui (master)  1
transfrm.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 
21 #include <svx/dlgctrl.hxx>
22 #include <svx/dialcontrol.hxx>
23 #include <svx/anchorid.hxx>
25 
26 // predefines
27 class SdrView;
28 
29 /*************************************************************************
30 |*
31 |* Transform-Tab-Dialog
32 |*
33 \************************************************************************/
34 
37 {
38 private:
39  const SdrView* pView;
40 
43 
44  virtual void PageCreated(const OString& rId, SfxTabPage &rPage) override;
45 
46 public:
47  SvxTransformTabDialog(weld::Window* pParent, const SfxItemSet* pAttr,
48  const SdrView* pView,
49  SvxAnchorIds nAnchorTypes);
50 
51  //link for the Writer to validate positions
53 };
54 
55 /*************************************************************************
56 |*
57 |* position and size tab page
58 |*
59 \************************************************************************/
60 
62 {
63  static const sal_uInt16 pPosSizeRanges[];
64 
65 private:
67 
68  const SdrView* mpView;
69 
70  // #i75273#
74 
84 
85  // from size
86  // #i75273#
87  double mfOldWidth;
88  double mfOldHeight;
90 
93 
94  // position
95  std::unique_ptr<weld::Widget> m_xFlPosition;
96  std::unique_ptr<weld::MetricSpinButton> m_xMtrPosX;
97  std::unique_ptr<weld::MetricSpinButton> m_xMtrPosY;
98  std::unique_ptr<weld::CustomWeld> m_xCtlPos;
99 
100  // size
101  std::unique_ptr<weld::Widget> m_xFlSize;
102  std::unique_ptr<weld::Label> m_xFtWidth;
103  std::unique_ptr<weld::MetricSpinButton> m_xMtrWidth;
104  std::unique_ptr<weld::Label> m_xFtHeight;
105  std::unique_ptr<weld::MetricSpinButton> m_xMtrHeight;
106  std::unique_ptr<weld::CheckButton> m_xCbxScale;
107  std::unique_ptr<weld::CustomWeld> m_xCtlSize;
108 
109  // protect
110  std::unique_ptr<weld::Widget> m_xFlProtect;
111  std::unique_ptr<weld::CheckButton> m_xTsbPosProtect;
112  std::unique_ptr<weld::CheckButton> m_xTsbSizeProtect;
113 
114  // adjust
115  std::unique_ptr<weld::Widget> m_xFlAdjust;
116  std::unique_ptr<weld::CheckButton> m_xTsbAutoGrowWidth;
117  std::unique_ptr<weld::CheckButton> m_xTsbAutoGrowHeight;
118 
119  DECL_LINK(ChangePosProtectHdl, weld::ToggleButton&, void);
120  DECL_LINK(ChangeSizeProtectHdl, weld::ToggleButton&, void);
121 
122  void SetMinMaxPosition();
123  void GetTopLeftPosition(double& rfX, double& rfY, const basegfx::B2DRange& rRange);
124 
125  DECL_LINK( ChangeWidthHdl, weld::MetricSpinButton&, void );
126  DECL_LINK( ChangeHeightHdl, weld::MetricSpinButton&, void );
127  DECL_LINK( ClickSizeProtectHdl, weld::ToggleButton&, void );
128  DECL_LINK( ClickAutoHdl, weld::ToggleButton&, void );
129 
130 public:
131  SvxPositionSizeTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs);
132  virtual ~SvxPositionSizeTabPage() override;
133 
134  static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* );
135  static const sal_uInt16* GetRanges() { return pPosSizeRanges; }
136 
137  virtual bool FillItemSet( SfxItemSet* ) override;
138  virtual void Reset( const SfxItemSet * ) override;
139 
140  virtual void ActivatePage( const SfxItemSet& rSet ) override;
141  virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
142 
143  virtual void PointChanged(weld::DrawingArea* pWindow, RectPoint eRP) override;
144 
145  void Construct();
146  void SetView( const SdrView* pSdrView ) { mpView = pSdrView; }
147 
148  virtual void FillUserData() override;
149 
150  void DisableResize();
151  void DisableProtect();
152 
153  void UpdateControlStates();
154 };
155 
156 /*************************************************************************
157 |*
158 |* rotation angle tab page
159 |*
160 \************************************************************************/
162 {
163  static const sal_uInt16 pAngleRanges[];
164 
165 private:
166  const SdrView* pView;
167 
168  // #i75273#
171 
174 
176 
177  std::unique_ptr<weld::Widget> m_xFlPosition;
178  std::unique_ptr<weld::MetricSpinButton> m_xMtrPosX;
179  std::unique_ptr<weld::MetricSpinButton> m_xMtrPosY;
180  std::unique_ptr<weld::CustomWeld> m_xCtlRect;
181  std::unique_ptr<weld::Widget> m_xFlAngle;
182  std::unique_ptr<weld::MetricSpinButton> m_xNfAngle;
183  std::unique_ptr<svx::DialControl> m_xCtlAngle;
184  std::unique_ptr<weld::CustomWeld> m_xCtlAngleWin;
185 
186 public:
187  SvxAngleTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs);
188  virtual ~SvxAngleTabPage() override;
189 
190  static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* );
191  static const sal_uInt16* GetRanges() { return pAngleRanges; }
192 
193  virtual bool FillItemSet( SfxItemSet* ) override;
194  virtual void Reset( const SfxItemSet * ) override;
195 
196  virtual void ActivatePage( const SfxItemSet& rSet ) override;
197  virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
198 
199  virtual void PointChanged(weld::DrawingArea* pWindow, RectPoint eRP) override;
200 
201  void Construct();
202  void SetView( const SdrView* pSdrView ) { pView = pSdrView; }
203 };
204 
205 /*************************************************************************
206 |*
207 |* slant/corner radius tab page
208 |*
209 \************************************************************************/
211 {
212  static const sal_uInt16 pSlantRanges[];
213 
214 private:
215  const SdrView* pView;
216 
219 
220  std::unique_ptr<weld::Widget> m_xFlRadius;
221  std::unique_ptr<weld::MetricSpinButton> m_xMtrRadius;
222  std::unique_ptr<weld::Widget> m_xFlAngle;
223  std::unique_ptr<weld::MetricSpinButton> m_xMtrAngle;
224  std::unique_ptr<weld::Widget> m_aControlGroups[2];
225  std::unique_ptr<weld::Widget> m_aControlGroupX[2];
226  std::unique_ptr<weld::MetricSpinButton> m_aControlX[2];
227  std::unique_ptr<weld::Widget> m_aControlGroupY[2];
228  std::unique_ptr<weld::MetricSpinButton> m_aControlY[2];
229 
230 public:
231  SvxSlantTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs);
232  virtual ~SvxSlantTabPage() override;
233 
234  static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* );
235  static const sal_uInt16* GetRanges() { return pSlantRanges; }
236 
237  virtual bool FillItemSet( SfxItemSet* ) override;
238  virtual void Reset( const SfxItemSet * ) override;
239 
240  virtual void ActivatePage( const SfxItemSet& rSet ) override;
241  virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
242 
243  void Construct();
244  void SetView( const SdrView* pSdrView ) { pView = pSdrView; }
245 };
246 
247 
248 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
FieldUnit
static const sal_uInt16 pAngleRanges[]
Definition: transfrm.hxx:163
std::unique_ptr< weld::Widget > m_aControlGroups[2]
Definition: transfrm.hxx:224
std::unique_ptr< weld::CheckButton > m_xTsbSizeProtect
Definition: transfrm.hxx:112
basegfx::B2DRange maRange
Definition: transfrm.hxx:71
std::unique_ptr< weld::CustomWeld > m_xCtlRect
Definition: transfrm.hxx:180
std::unique_ptr< weld::CustomWeld > m_xCtlPos
Definition: transfrm.hxx:98
const SfxItemSet * pSet
std::unique_ptr< weld::Widget > m_aControlGroupY[2]
Definition: transfrm.hxx:227
virtual ~SvxSlantTabPage() override
Definition: transfrm.cxx:425
Link< SvxSwFrameValidation &, void > aValidateLink
Definition: transfrm.hxx:42
void Construct()
Definition: transfrm.cxx:195
basegfx::B2DPoint maAnchor
Definition: transfrm.hxx:73
std::unique_ptr< svx::DialControl > m_xCtlAngle
Definition: transfrm.hxx:183
virtual void Reset(const SfxItemSet *) override
Definition: transfrm.cxx:264
SvxPositionSizeTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rInAttrs)
Definition: transfrm.cxx:738
std::unique_ptr< weld::MetricSpinButton > m_xMtrPosY
Definition: transfrm.hxx:97
std::unique_ptr< weld::CheckButton > m_xTsbAutoGrowWidth
Definition: transfrm.hxx:116
std::unique_ptr< weld::Widget > m_aControlGroupX[2]
Definition: transfrm.hxx:225
std::unique_ptr< weld::Widget > m_xFlSize
Definition: transfrm.hxx:101
void SetView(const SdrView *pSdrView)
Definition: transfrm.hxx:146
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *)
Definition: transfrm.cxx:702
std::unique_ptr< weld::Widget > m_xFlAngle
Definition: transfrm.hxx:181
std::unique_ptr< weld::MetricSpinButton > m_xMtrRadius
Definition: transfrm.hxx:221
std::unique_ptr< weld::Widget > m_xFlPosition
Definition: transfrm.hxx:95
SvxRectCtl m_aCtlSize
Definition: transfrm.hxx:92
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: transfrm.cxx:707
std::unique_ptr< weld::Label > m_xFtHeight
Definition: transfrm.hxx:104
std::unique_ptr< weld::MetricSpinButton > m_xNfAngle
Definition: transfrm.hxx:182
std::unique_ptr< weld::MetricSpinButton > m_xMtrPosY
Definition: transfrm.hxx:179
basegfx::B2DRange maRange
Definition: transfrm.hxx:169
SvxRectCtl m_aCtlPos
Definition: transfrm.hxx:91
virtual void PointChanged(weld::DrawingArea *pWindow, RectPoint eRP) override
Definition: transfrm.cxx:329
MapUnit ePoolUnit
Definition: transfrm.hxx:217
void Construct()
Definition: transfrm.cxx:429
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *)
Definition: transfrm.cxx:304
std::unique_ptr< weld::Label > m_xFtWidth
Definition: transfrm.hxx:102
std::unique_ptr< weld::MetricSpinButton > m_xMtrAngle
Definition: transfrm.hxx:223
const SdrView * pView
Definition: transfrm.hxx:215
static const sal_uInt16 * GetRanges()
Definition: transfrm.hxx:135
RectPoint
std::unique_ptr< weld::Widget > m_xFlRadius
Definition: transfrm.hxx:220
virtual void PointChanged(weld::DrawingArea *pWindow, RectPoint eRP) override
Definition: transfrm.cxx:1435
virtual bool FillItemSet(SfxItemSet *) override
Definition: transfrm.cxx:896
virtual void FillUserData() override
Definition: transfrm.cxx:1577
static const sal_uInt16 * GetRanges()
Definition: transfrm.hxx:235
SvxRectCtl m_aCtlRect
Definition: transfrm.hxx:175
void SetView(const SdrView *pSdrView)
Definition: transfrm.hxx:202
std::unique_ptr< weld::Widget > m_xFlProtect
Definition: transfrm.hxx:110
virtual ~SvxAngleTabPage() override
Definition: transfrm.cxx:191
virtual void Reset(const SfxItemSet *) override
Definition: transfrm.cxx:1019
std::unique_ptr< weld::MetricSpinButton > m_xMtrPosX
Definition: transfrm.hxx:96
const SdrView * pView
Definition: transfrm.hxx:39
void GetTopLeftPosition(double &rfX, double &rfY, const basegfx::B2DRange &rRange)
Definition: transfrm.cxx:1380
virtual void Reset(const SfxItemSet *) override
Definition: transfrm.cxx:567
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: transfrm.cxx:722
virtual bool FillItemSet(SfxItemSet *) override
Definition: transfrm.cxx:447
std::unique_ptr< weld::MetricSpinButton > m_aControlY[2]
Definition: transfrm.hxx:228
static const sal_uInt16 pPosSizeRanges[]
Definition: transfrm.hxx:63
std::unique_ptr< weld::Widget > m_xFlPosition
Definition: transfrm.hxx:177
std::unique_ptr< weld::Widget > m_xFlAngle
Definition: transfrm.hxx:222
std::unique_ptr< weld::Widget > m_xFlAdjust
Definition: transfrm.hxx:115
const SdrView * mpView
Definition: transfrm.hxx:68
std::unique_ptr< weld::MetricSpinButton > m_xMtrWidth
Definition: transfrm.hxx:103
basegfx::B2DRange maWorkRange
Definition: transfrm.hxx:72
FieldUnit eDlgUnit
Definition: transfrm.hxx:173
virtual ~SvxPositionSizeTabPage() override
Definition: transfrm.cxx:795
std::unique_ptr< weld::CheckButton > m_xTsbPosProtect
Definition: transfrm.hxx:111
void SetView(const SdrView *pSdrView)
Definition: transfrm.hxx:244
TriState mnProtectSizeState
Definition: transfrm.hxx:77
std::unique_ptr< weld::MetricSpinButton > m_aControlX[2]
Definition: transfrm.hxx:226
std::unique_ptr< weld::MetricSpinButton > m_xMtrPosX
Definition: transfrm.hxx:178
std::unique_ptr< weld::MetricSpinButton > m_xMtrHeight
Definition: transfrm.hxx:105
const SdrView * pView
Definition: transfrm.hxx:166
DECL_LINK(ChangePosProtectHdl, weld::ToggleButton &, void)
SvxAnchorIds
std::unique_ptr< weld::CustomWeld > m_xCtlAngleWin
Definition: transfrm.hxx:184
std::unique_ptr< weld::CustomWeld > m_xCtlSize
Definition: transfrm.hxx:107
FieldUnit eDlgUnit
Definition: transfrm.hxx:218
basegfx::B2DPoint maAnchor
Definition: transfrm.hxx:170
SvxSlantTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rInAttrs)
Definition: transfrm.cxx:398
SvxAnchorIds nAnchorCtrls
Definition: transfrm.hxx:41
DeactivateRC
void SetValidateFramePosLink(const Link< SvxSwFrameValidation &, void > &rLink)
Definition: transfrm.cxx:158
SvxAngleTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rInAttrs)
Definition: transfrm.cxx:169
MapUnit
SvxTransformTabDialog(weld::Window *pParent, const SfxItemSet *pAttr, const SdrView *pView, SvxAnchorIds nAnchorTypes)
Definition: transfrm.cxx:90
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: transfrm.cxx:309
std::unique_ptr< weld::CheckButton > m_xTsbAutoGrowHeight
Definition: transfrm.hxx:117
std::unique_ptr< weld::CheckButton > m_xCbxScale
Definition: transfrm.hxx:106
const SfxItemSet & mrOutAttrs
Definition: transfrm.hxx:66
TriState
virtual bool FillItemSet(SfxItemSet *) override
Definition: transfrm.cxx:243
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *)
Definition: transfrm.cxx:1118
MapUnit ePoolUnit
Definition: transfrm.hxx:172
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: transfrm.cxx:1123
virtual void PageCreated(const OString &rId, SfxTabPage &rPage) override
Definition: transfrm.cxx:115
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: transfrm.cxx:1139
static const sal_uInt16 pSlantRanges[]
Definition: transfrm.hxx:212
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: transfrm.cxx:319
static const sal_uInt16 * GetRanges()
Definition: transfrm.hxx:191