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 #ifndef INCLUDED_CUI_SOURCE_INC_TRANSFRM_HXX
20 #define INCLUDED_CUI_SOURCE_INC_TRANSFRM_HXX
21 
22 #include <svx/dlgctrl.hxx>
23 #include <svx/dialcontrol.hxx>
24 #include <svx/anchorid.hxx>
26 
27 // predefines
28 class SdrView;
29 
30 /*************************************************************************
31 |*
32 |* Transform-Tab-Dialog
33 |*
34 \************************************************************************/
35 
38 {
39 private:
40  const SdrView* pView;
41 
44 
45  virtual void PageCreated(const OString& rId, SfxTabPage &rPage) override;
46 
47 public:
48  SvxTransformTabDialog(weld::Window* pParent, const SfxItemSet* pAttr,
49  const SdrView* pView,
50  SvxAnchorIds nAnchorTypes);
51 
52  //link for the Writer to validate positions
54 };
55 
56 /*************************************************************************
57 |*
58 |* position and size tab page
59 |*
60 \************************************************************************/
61 
63 {
66  static const sal_uInt16 pPosSizeRanges[];
67 
68 private:
70 
71  const SdrView* mpView;
72 
73  // #i75273#
77 
87 
88  // from size
89  // #i75273#
90  double mfOldWidth;
91  double mfOldHeight;
93 
96 
97  // position
98  std::unique_ptr<weld::Widget> m_xFlPosition;
99  std::unique_ptr<weld::MetricSpinButton> m_xMtrPosX;
100  std::unique_ptr<weld::MetricSpinButton> m_xMtrPosY;
101  std::unique_ptr<weld::CustomWeld> m_xCtlPos;
102 
103  // size
104  std::unique_ptr<weld::Widget> m_xFlSize;
105  std::unique_ptr<weld::Label> m_xFtWidth;
106  std::unique_ptr<weld::MetricSpinButton> m_xMtrWidth;
107  std::unique_ptr<weld::Label> m_xFtHeight;
108  std::unique_ptr<weld::MetricSpinButton> m_xMtrHeight;
109  std::unique_ptr<weld::CheckButton> m_xCbxScale;
110  std::unique_ptr<weld::CustomWeld> m_xCtlSize;
111 
112  // protect
113  std::unique_ptr<weld::Widget> m_xFlProtect;
114  std::unique_ptr<weld::CheckButton> m_xTsbPosProtect;
115  std::unique_ptr<weld::CheckButton> m_xTsbSizeProtect;
116 
117  // adjust
118  std::unique_ptr<weld::Widget> m_xFlAdjust;
119  std::unique_ptr<weld::CheckButton> m_xTsbAutoGrowWidth;
120  std::unique_ptr<weld::CheckButton> m_xTsbAutoGrowHeight;
121 
122  DECL_LINK(ChangePosProtectHdl, weld::ToggleButton&, void);
123  DECL_LINK(ChangeSizeProtectHdl, weld::ToggleButton&, void);
124 
125  void SetMinMaxPosition();
126  void GetTopLeftPosition(double& rfX, double& rfY, const basegfx::B2DRange& rRange);
127 
128  DECL_LINK( ChangeWidthHdl, weld::MetricSpinButton&, void );
129  DECL_LINK( ChangeHeightHdl, weld::MetricSpinButton&, void );
130  DECL_LINK( ClickSizeProtectHdl, weld::ToggleButton&, void );
131  DECL_LINK( ClickAutoHdl, weld::ToggleButton&, void );
132 
133 public:
134  SvxPositionSizeTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs);
135  virtual ~SvxPositionSizeTabPage() override;
136 
138  static const sal_uInt16* GetRanges() { return pPosSizeRanges; }
139 
140  virtual bool FillItemSet( SfxItemSet* ) override;
141  virtual void Reset( const SfxItemSet * ) override;
142 
143  virtual void ActivatePage( const SfxItemSet& rSet ) override;
144  virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
145 
146  virtual void PointChanged(weld::DrawingArea* pWindow, RectPoint eRP) override;
147 
148  void Construct();
149  void SetView( const SdrView* pSdrView ) { mpView = pSdrView; }
150 
151  virtual void FillUserData() override;
152 
153  void DisableResize();
154  void DisableProtect();
155 
156  void UpdateControlStates();
157 };
158 
159 /*************************************************************************
160 |*
161 |* rotation angle tab page
162 |*
163 \************************************************************************/
165 {
166  using TabPage::ActivatePage;
168  static const sal_uInt16 pAngleRanges[];
169 
170 private:
172  const SdrView* pView;
173 
174  // #i75273#
177 
180 
183 
184  std::unique_ptr<weld::Widget> m_xFlPosition;
185  std::unique_ptr<weld::MetricSpinButton> m_xMtrPosX;
186  std::unique_ptr<weld::MetricSpinButton> m_xMtrPosY;
187  std::unique_ptr<weld::CustomWeld> m_xCtlRect;
188  std::unique_ptr<weld::Widget> m_xFlAngle;
189  std::unique_ptr<weld::SpinButton> m_xNfAngle;
190  std::unique_ptr<weld::CustomWeld> m_xCtlAngle;
191 
192 public:
193  SvxAngleTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs);
194  virtual ~SvxAngleTabPage() override;
195 
197  static const sal_uInt16* GetRanges() { return pAngleRanges; }
198 
199  virtual bool FillItemSet( SfxItemSet* ) override;
200  virtual void Reset( const SfxItemSet * ) override;
201 
202  virtual void ActivatePage( const SfxItemSet& rSet ) override;
203  virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
204 
205  virtual void PointChanged(weld::DrawingArea* pWindow, RectPoint eRP) override;
206 
207  void Construct();
208  void SetView( const SdrView* pSdrView ) { pView = pSdrView; }
209 };
210 
211 /*************************************************************************
212 |*
213 |* slant/corner radius tab page
214 |*
215 \************************************************************************/
217 {
218  using TabPage::ActivatePage;
220  static const sal_uInt16 pSlantRanges[];
221 
222 private:
224 
225  const SdrView* pView;
226 
229 
230  std::unique_ptr<weld::Widget> m_xFlRadius;
231  std::unique_ptr<weld::MetricSpinButton> m_xMtrRadius;
232  std::unique_ptr<weld::Widget> m_xFlAngle;
233  std::unique_ptr<weld::MetricSpinButton> m_xMtrAngle;
234  std::unique_ptr<weld::Widget> m_aControlGroups[2];
235  std::unique_ptr<weld::Widget> m_aControlGroupX[2];
236  std::unique_ptr<weld::MetricSpinButton> m_aControlX[2];
237  std::unique_ptr<weld::Widget> m_aControlGroupY[2];
238  std::unique_ptr<weld::MetricSpinButton> m_aControlY[2];
239 
240 public:
241  SvxSlantTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs);
242  virtual ~SvxSlantTabPage() override;
243 
245  static const sal_uInt16* GetRanges() { return pSlantRanges; }
246 
247  virtual bool FillItemSet( SfxItemSet* ) override;
248  virtual void Reset( const SfxItemSet * ) override;
249 
250  virtual void ActivatePage( const SfxItemSet& rSet ) override;
251  virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
252 
253  void Construct();
254  void SetView( const SdrView* pSdrView ) { pView = pSdrView; }
255 };
256 
257 
258 #endif // INCLUDED_CUI_SOURCE_INC_TRANSFRM_HXX
259 
260 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
FieldUnit
static const sal_uInt16 pAngleRanges[]
Definition: transfrm.hxx:168
std::unique_ptr< weld::Widget > m_aControlGroups[2]
Definition: transfrm.hxx:234
std::unique_ptr< weld::CheckButton > m_xTsbSizeProtect
Definition: transfrm.hxx:115
basegfx::B2DRange maRange
Definition: transfrm.hxx:74
std::unique_ptr< weld::CustomWeld > m_xCtlRect
Definition: transfrm.hxx:187
std::unique_ptr< weld::CustomWeld > m_xCtlPos
Definition: transfrm.hxx:101
const SfxItemSet * pSet
std::unique_ptr< weld::Widget > m_aControlGroupY[2]
Definition: transfrm.hxx:237
virtual ~SvxSlantTabPage() override
Definition: transfrm.cxx:433
Link< SvxSwFrameValidation &, void > aValidateLink
Definition: transfrm.hxx:43
static VclPtr< SfxTabPage > Create(TabPageParent, const SfxItemSet *)
Definition: transfrm.cxx:710
void Construct()
Definition: transfrm.cxx:202
static VclPtr< SfxTabPage > Create(TabPageParent, const SfxItemSet *)
Definition: transfrm.cxx:1126
basegfx::B2DPoint maAnchor
Definition: transfrm.hxx:76
virtual void Reset(const SfxItemSet *) override
Definition: transfrm.cxx:271
std::unique_ptr< weld::MetricSpinButton > m_xMtrPosY
Definition: transfrm.hxx:100
std::unique_ptr< weld::CheckButton > m_xTsbAutoGrowWidth
Definition: transfrm.hxx:119
std::unique_ptr< weld::Widget > m_aControlGroupX[2]
Definition: transfrm.hxx:235
std::unique_ptr< weld::SpinButton > m_xNfAngle
Definition: transfrm.hxx:189
std::unique_ptr< weld::Widget > m_xFlSize
Definition: transfrm.hxx:104
void SetView(const SdrView *pSdrView)
Definition: transfrm.hxx:149
std::unique_ptr< weld::Widget > m_xFlAngle
Definition: transfrm.hxx:188
std::unique_ptr< weld::MetricSpinButton > m_xMtrRadius
Definition: transfrm.hxx:231
std::unique_ptr< weld::Widget > m_xFlPosition
Definition: transfrm.hxx:98
SvxRectCtl m_aCtlSize
Definition: transfrm.hxx:95
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: transfrm.cxx:715
std::unique_ptr< weld::Label > m_xFtHeight
Definition: transfrm.hxx:107
std::unique_ptr< weld::MetricSpinButton > m_xMtrPosY
Definition: transfrm.hxx:186
basegfx::B2DRange maRange
Definition: transfrm.hxx:175
SvxRectCtl m_aCtlPos
Definition: transfrm.hxx:94
virtual void ActivatePage()
virtual void PointChanged(weld::DrawingArea *pWindow, RectPoint eRP) override
Definition: transfrm.cxx:336
MapUnit ePoolUnit
Definition: transfrm.hxx:227
void Construct()
Definition: transfrm.cxx:437
std::unique_ptr< weld::Label > m_xFtWidth
Definition: transfrm.hxx:105
std::unique_ptr< weld::MetricSpinButton > m_xMtrAngle
Definition: transfrm.hxx:233
const SdrView * pView
Definition: transfrm.hxx:225
static const sal_uInt16 * GetRanges()
Definition: transfrm.hxx:138
RectPoint
std::unique_ptr< weld::Widget > m_xFlRadius
Definition: transfrm.hxx:230
virtual void PointChanged(weld::DrawingArea *pWindow, RectPoint eRP) override
Definition: transfrm.cxx:1443
virtual bool FillItemSet(SfxItemSet *) override
Definition: transfrm.cxx:904
const SfxItemSet & rOutAttrs
Definition: transfrm.hxx:171
virtual void FillUserData() override
Definition: transfrm.cxx:1585
static const sal_uInt16 * GetRanges()
Definition: transfrm.hxx:245
SvxRectCtl m_aCtlRect
Definition: transfrm.hxx:182
void SetView(const SdrView *pSdrView)
Definition: transfrm.hxx:208
std::unique_ptr< weld::Widget > m_xFlProtect
Definition: transfrm.hxx:113
virtual ~SvxAngleTabPage() override
Definition: transfrm.cxx:198
SvxAngleTabPage(TabPageParent pParent, const SfxItemSet &rInAttrs)
Definition: transfrm.cxx:176
virtual void Reset(const SfxItemSet *) override
Definition: transfrm.cxx:1027
std::unique_ptr< weld::MetricSpinButton > m_xMtrPosX
Definition: transfrm.hxx:99
const SdrView * pView
Definition: transfrm.hxx:40
void GetTopLeftPosition(double &rfX, double &rfY, const basegfx::B2DRange &rRange)
Definition: transfrm.cxx:1388
virtual void Reset(const SfxItemSet *) override
Definition: transfrm.cxx:575
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: transfrm.cxx:730
std::unique_ptr< weld::CustomWeld > m_xCtlAngle
Definition: transfrm.hxx:190
virtual bool FillItemSet(SfxItemSet *) override
Definition: transfrm.cxx:455
std::unique_ptr< weld::MetricSpinButton > m_aControlY[2]
Definition: transfrm.hxx:238
static const sal_uInt16 pPosSizeRanges[]
Definition: transfrm.hxx:66
std::unique_ptr< weld::Widget > m_xFlPosition
Definition: transfrm.hxx:184
std::unique_ptr< weld::Widget > m_xFlAngle
Definition: transfrm.hxx:232
std::unique_ptr< weld::Widget > m_xFlAdjust
Definition: transfrm.hxx:118
const SdrView * mpView
Definition: transfrm.hxx:71
std::unique_ptr< weld::MetricSpinButton > m_xMtrWidth
Definition: transfrm.hxx:106
basegfx::B2DRange maWorkRange
Definition: transfrm.hxx:75
FieldUnit eDlgUnit
Definition: transfrm.hxx:179
virtual ~SvxPositionSizeTabPage() override
Definition: transfrm.cxx:803
std::unique_ptr< weld::CheckButton > m_xTsbPosProtect
Definition: transfrm.hxx:114
void SetView(const SdrView *pSdrView)
Definition: transfrm.hxx:254
TriState mnProtectSizeState
Definition: transfrm.hxx:80
std::unique_ptr< weld::MetricSpinButton > m_aControlX[2]
Definition: transfrm.hxx:236
const SfxItemSet & rOutAttrs
Definition: transfrm.hxx:223
SvxSlantTabPage(TabPageParent pParent, const SfxItemSet &rInAttrs)
Definition: transfrm.cxx:405
std::unique_ptr< weld::MetricSpinButton > m_xMtrPosX
Definition: transfrm.hxx:185
std::unique_ptr< weld::MetricSpinButton > m_xMtrHeight
Definition: transfrm.hxx:108
const SdrView * pView
Definition: transfrm.hxx:172
DECL_LINK(ChangePosProtectHdl, weld::ToggleButton &, void)
SvxAnchorIds
std::unique_ptr< weld::CustomWeld > m_xCtlSize
Definition: transfrm.hxx:110
FieldUnit eDlgUnit
Definition: transfrm.hxx:228
basegfx::B2DPoint maAnchor
Definition: transfrm.hxx:176
SvxAnchorIds nAnchorCtrls
Definition: transfrm.hxx:42
SvxPositionSizeTabPage(TabPageParent pParent, const SfxItemSet &rInAttrs)
Definition: transfrm.cxx:746
DeactivateRC
void SetValidateFramePosLink(const Link< SvxSwFrameValidation &, void > &rLink)
Definition: transfrm.cxx:165
MapUnit
SvxTransformTabDialog(weld::Window *pParent, const SfxItemSet *pAttr, const SdrView *pView, SvxAnchorIds nAnchorTypes)
Definition: transfrm.cxx:97
static VclPtr< SfxTabPage > Create(TabPageParent, const SfxItemSet *)
Definition: transfrm.cxx:311
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: transfrm.cxx:316
virtual void DeactivatePage()
std::unique_ptr< weld::CheckButton > m_xTsbAutoGrowHeight
Definition: transfrm.hxx:120
std::unique_ptr< weld::CheckButton > m_xCbxScale
Definition: transfrm.hxx:109
const SfxItemSet & mrOutAttrs
Definition: transfrm.hxx:69
TriState
virtual bool FillItemSet(SfxItemSet *) override
Definition: transfrm.cxx:250
MapUnit ePoolUnit
Definition: transfrm.hxx:178
svx::SvxDialControl m_aCtlAngle
Definition: transfrm.hxx:181
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: transfrm.cxx:1131
virtual void PageCreated(const OString &rId, SfxTabPage &rPage) override
Definition: transfrm.cxx:122
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: transfrm.cxx:1147
static const sal_uInt16 pSlantRanges[]
Definition: transfrm.hxx:220
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: transfrm.cxx:326
static const sal_uInt16 * GetRanges()
Definition: transfrm.hxx:197