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 {
64  static const sal_uInt16 pPosSizeRanges[];
65 
66 private:
68 
69  const SdrView* mpView;
70 
71  // #i75273#
75 
85 
86  // from size
87  // #i75273#
88  double mfOldWidth;
89  double mfOldHeight;
91 
94 
95  // position
96  std::unique_ptr<weld::Widget> m_xFlPosition;
97  std::unique_ptr<weld::MetricSpinButton> m_xMtrPosX;
98  std::unique_ptr<weld::MetricSpinButton> m_xMtrPosY;
99  std::unique_ptr<weld::CustomWeld> m_xCtlPos;
100 
101  // size
102  std::unique_ptr<weld::Widget> m_xFlSize;
103  std::unique_ptr<weld::Label> m_xFtWidth;
104  std::unique_ptr<weld::MetricSpinButton> m_xMtrWidth;
105  std::unique_ptr<weld::Label> m_xFtHeight;
106  std::unique_ptr<weld::MetricSpinButton> m_xMtrHeight;
107  std::unique_ptr<weld::CheckButton> m_xCbxScale;
108  std::unique_ptr<weld::CustomWeld> m_xCtlSize;
109 
110  // protect
111  std::unique_ptr<weld::Widget> m_xFlProtect;
112  std::unique_ptr<weld::CheckButton> m_xTsbPosProtect;
113  std::unique_ptr<weld::CheckButton> m_xTsbSizeProtect;
114 
115  // adjust
116  std::unique_ptr<weld::Widget> m_xFlAdjust;
117  std::unique_ptr<weld::CheckButton> m_xTsbAutoGrowWidth;
118  std::unique_ptr<weld::CheckButton> m_xTsbAutoGrowHeight;
119 
120  DECL_LINK(ChangePosProtectHdl, weld::ToggleButton&, void);
121  DECL_LINK(ChangeSizeProtectHdl, weld::ToggleButton&, void);
122 
123  void SetMinMaxPosition();
124  void GetTopLeftPosition(double& rfX, double& rfY, const basegfx::B2DRange& rRange);
125 
126  DECL_LINK( ChangeWidthHdl, weld::MetricSpinButton&, void );
127  DECL_LINK( ChangeHeightHdl, weld::MetricSpinButton&, void );
128  DECL_LINK( ClickSizeProtectHdl, weld::ToggleButton&, void );
129  DECL_LINK( ClickAutoHdl, weld::ToggleButton&, void );
130 
131 public:
132  SvxPositionSizeTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs);
133  virtual ~SvxPositionSizeTabPage() override;
134 
135  static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* );
136  static const sal_uInt16* GetRanges() { return pPosSizeRanges; }
137 
138  virtual bool FillItemSet( SfxItemSet* ) override;
139  virtual void Reset( const SfxItemSet * ) override;
140 
141  virtual void ActivatePage( const SfxItemSet& rSet ) override;
142  virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
143 
144  virtual void PointChanged(weld::DrawingArea* pWindow, RectPoint eRP) override;
145 
146  void Construct();
147  void SetView( const SdrView* pSdrView ) { mpView = pSdrView; }
148 
149  virtual void FillUserData() override;
150 
151  void DisableResize();
152  void DisableProtect();
153 
154  void UpdateControlStates();
155 };
156 
157 /*************************************************************************
158 |*
159 |* rotation angle tab page
160 |*
161 \************************************************************************/
163 {
164  static const sal_uInt16 pAngleRanges[];
165 
166 private:
168  const SdrView* pView;
169 
170  // #i75273#
173 
176 
179 
180  std::unique_ptr<weld::Widget> m_xFlPosition;
181  std::unique_ptr<weld::MetricSpinButton> m_xMtrPosX;
182  std::unique_ptr<weld::MetricSpinButton> m_xMtrPosY;
183  std::unique_ptr<weld::CustomWeld> m_xCtlRect;
184  std::unique_ptr<weld::Widget> m_xFlAngle;
185  std::unique_ptr<weld::SpinButton> m_xNfAngle;
186  std::unique_ptr<weld::CustomWeld> m_xCtlAngle;
187 
188 public:
189  SvxAngleTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs);
190  virtual ~SvxAngleTabPage() override;
191 
192  static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* );
193  static const sal_uInt16* GetRanges() { return pAngleRanges; }
194 
195  virtual bool FillItemSet( SfxItemSet* ) override;
196  virtual void Reset( const SfxItemSet * ) override;
197 
198  virtual void ActivatePage( const SfxItemSet& rSet ) override;
199  virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
200 
201  virtual void PointChanged(weld::DrawingArea* pWindow, RectPoint eRP) override;
202 
203  void Construct();
204  void SetView( const SdrView* pSdrView ) { pView = pSdrView; }
205 };
206 
207 /*************************************************************************
208 |*
209 |* slant/corner radius tab page
210 |*
211 \************************************************************************/
213 {
214  static const sal_uInt16 pSlantRanges[];
215 
216 private:
218 
219  const SdrView* pView;
220 
223 
224  std::unique_ptr<weld::Widget> m_xFlRadius;
225  std::unique_ptr<weld::MetricSpinButton> m_xMtrRadius;
226  std::unique_ptr<weld::Widget> m_xFlAngle;
227  std::unique_ptr<weld::MetricSpinButton> m_xMtrAngle;
228  std::unique_ptr<weld::Widget> m_aControlGroups[2];
229  std::unique_ptr<weld::Widget> m_aControlGroupX[2];
230  std::unique_ptr<weld::MetricSpinButton> m_aControlX[2];
231  std::unique_ptr<weld::Widget> m_aControlGroupY[2];
232  std::unique_ptr<weld::MetricSpinButton> m_aControlY[2];
233 
234 public:
235  SvxSlantTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs);
236  virtual ~SvxSlantTabPage() override;
237 
238  static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* );
239  static const sal_uInt16* GetRanges() { return pSlantRanges; }
240 
241  virtual bool FillItemSet( SfxItemSet* ) override;
242  virtual void Reset( const SfxItemSet * ) override;
243 
244  virtual void ActivatePage( const SfxItemSet& rSet ) override;
245  virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
246 
247  void Construct();
248  void SetView( const SdrView* pSdrView ) { pView = pSdrView; }
249 };
250 
251 
252 #endif // INCLUDED_CUI_SOURCE_INC_TRANSFRM_HXX
253 
254 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
FieldUnit
static const sal_uInt16 pAngleRanges[]
Definition: transfrm.hxx:164
std::unique_ptr< weld::Widget > m_aControlGroups[2]
Definition: transfrm.hxx:228
std::unique_ptr< weld::CheckButton > m_xTsbSizeProtect
Definition: transfrm.hxx:113
basegfx::B2DRange maRange
Definition: transfrm.hxx:72
std::unique_ptr< weld::CustomWeld > m_xCtlRect
Definition: transfrm.hxx:183
std::unique_ptr< weld::CustomWeld > m_xCtlPos
Definition: transfrm.hxx:99
const SfxItemSet * pSet
std::unique_ptr< weld::Widget > m_aControlGroupY[2]
Definition: transfrm.hxx:231
virtual ~SvxSlantTabPage() override
Definition: transfrm.cxx:426
Link< SvxSwFrameValidation &, void > aValidateLink
Definition: transfrm.hxx:43
void Construct()
Definition: transfrm.cxx:195
basegfx::B2DPoint maAnchor
Definition: transfrm.hxx:74
virtual void Reset(const SfxItemSet *) override
Definition: transfrm.cxx:264
SvxPositionSizeTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rInAttrs)
Definition: transfrm.cxx:739
std::unique_ptr< weld::MetricSpinButton > m_xMtrPosY
Definition: transfrm.hxx:98
std::unique_ptr< weld::CheckButton > m_xTsbAutoGrowWidth
Definition: transfrm.hxx:117
std::unique_ptr< weld::Widget > m_aControlGroupX[2]
Definition: transfrm.hxx:229
std::unique_ptr< weld::SpinButton > m_xNfAngle
Definition: transfrm.hxx:185
std::unique_ptr< weld::Widget > m_xFlSize
Definition: transfrm.hxx:102
void SetView(const SdrView *pSdrView)
Definition: transfrm.hxx:147
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *)
Definition: transfrm.cxx:703
std::unique_ptr< weld::Widget > m_xFlAngle
Definition: transfrm.hxx:184
std::unique_ptr< weld::MetricSpinButton > m_xMtrRadius
Definition: transfrm.hxx:225
std::unique_ptr< weld::Widget > m_xFlPosition
Definition: transfrm.hxx:96
SvxRectCtl m_aCtlSize
Definition: transfrm.hxx:93
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: transfrm.cxx:708
std::unique_ptr< weld::Label > m_xFtHeight
Definition: transfrm.hxx:105
std::unique_ptr< weld::MetricSpinButton > m_xMtrPosY
Definition: transfrm.hxx:182
basegfx::B2DRange maRange
Definition: transfrm.hxx:171
SvxRectCtl m_aCtlPos
Definition: transfrm.hxx:92
virtual void PointChanged(weld::DrawingArea *pWindow, RectPoint eRP) override
Definition: transfrm.cxx:329
MapUnit ePoolUnit
Definition: transfrm.hxx:221
void Construct()
Definition: transfrm.cxx:430
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:103
std::unique_ptr< weld::MetricSpinButton > m_xMtrAngle
Definition: transfrm.hxx:227
const SdrView * pView
Definition: transfrm.hxx:219
static const sal_uInt16 * GetRanges()
Definition: transfrm.hxx:136
RectPoint
std::unique_ptr< weld::Widget > m_xFlRadius
Definition: transfrm.hxx:224
virtual void PointChanged(weld::DrawingArea *pWindow, RectPoint eRP) override
Definition: transfrm.cxx:1436
virtual bool FillItemSet(SfxItemSet *) override
Definition: transfrm.cxx:897
const SfxItemSet & rOutAttrs
Definition: transfrm.hxx:167
virtual void FillUserData() override
Definition: transfrm.cxx:1578
static const sal_uInt16 * GetRanges()
Definition: transfrm.hxx:239
SvxRectCtl m_aCtlRect
Definition: transfrm.hxx:178
void SetView(const SdrView *pSdrView)
Definition: transfrm.hxx:204
std::unique_ptr< weld::Widget > m_xFlProtect
Definition: transfrm.hxx:111
virtual ~SvxAngleTabPage() override
Definition: transfrm.cxx:191
virtual void Reset(const SfxItemSet *) override
Definition: transfrm.cxx:1020
std::unique_ptr< weld::MetricSpinButton > m_xMtrPosX
Definition: transfrm.hxx:97
const SdrView * pView
Definition: transfrm.hxx:40
void GetTopLeftPosition(double &rfX, double &rfY, const basegfx::B2DRange &rRange)
Definition: transfrm.cxx:1381
virtual void Reset(const SfxItemSet *) override
Definition: transfrm.cxx:568
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: transfrm.cxx:723
std::unique_ptr< weld::CustomWeld > m_xCtlAngle
Definition: transfrm.hxx:186
virtual bool FillItemSet(SfxItemSet *) override
Definition: transfrm.cxx:448
std::unique_ptr< weld::MetricSpinButton > m_aControlY[2]
Definition: transfrm.hxx:232
static const sal_uInt16 pPosSizeRanges[]
Definition: transfrm.hxx:64
std::unique_ptr< weld::Widget > m_xFlPosition
Definition: transfrm.hxx:180
std::unique_ptr< weld::Widget > m_xFlAngle
Definition: transfrm.hxx:226
std::unique_ptr< weld::Widget > m_xFlAdjust
Definition: transfrm.hxx:116
const SdrView * mpView
Definition: transfrm.hxx:69
std::unique_ptr< weld::MetricSpinButton > m_xMtrWidth
Definition: transfrm.hxx:104
basegfx::B2DRange maWorkRange
Definition: transfrm.hxx:73
FieldUnit eDlgUnit
Definition: transfrm.hxx:175
virtual ~SvxPositionSizeTabPage() override
Definition: transfrm.cxx:796
std::unique_ptr< weld::CheckButton > m_xTsbPosProtect
Definition: transfrm.hxx:112
void SetView(const SdrView *pSdrView)
Definition: transfrm.hxx:248
TriState mnProtectSizeState
Definition: transfrm.hxx:78
std::unique_ptr< weld::MetricSpinButton > m_aControlX[2]
Definition: transfrm.hxx:230
const SfxItemSet & rOutAttrs
Definition: transfrm.hxx:217
std::unique_ptr< weld::MetricSpinButton > m_xMtrPosX
Definition: transfrm.hxx:181
std::unique_ptr< weld::MetricSpinButton > m_xMtrHeight
Definition: transfrm.hxx:106
const SdrView * pView
Definition: transfrm.hxx:168
DECL_LINK(ChangePosProtectHdl, weld::ToggleButton &, void)
SvxAnchorIds
std::unique_ptr< weld::CustomWeld > m_xCtlSize
Definition: transfrm.hxx:108
FieldUnit eDlgUnit
Definition: transfrm.hxx:222
basegfx::B2DPoint maAnchor
Definition: transfrm.hxx:172
SvxSlantTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rInAttrs)
Definition: transfrm.cxx:398
SvxAnchorIds nAnchorCtrls
Definition: transfrm.hxx:42
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:118
std::unique_ptr< weld::CheckButton > m_xCbxScale
Definition: transfrm.hxx:107
const SfxItemSet & mrOutAttrs
Definition: transfrm.hxx:67
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:1119
MapUnit ePoolUnit
Definition: transfrm.hxx:174
svx::SvxDialControl m_aCtlAngle
Definition: transfrm.hxx:177
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: transfrm.cxx:1124
virtual void PageCreated(const OString &rId, SfxTabPage &rPage) override
Definition: transfrm.cxx:115
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: transfrm.cxx:1140
static const sal_uInt16 pSlantRanges[]
Definition: transfrm.hxx:214
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: transfrm.cxx:319
static const sal_uInt16 * GetRanges()
Definition: transfrm.hxx:193