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:
167  const SdrView* pView;
168 
169  // #i75273#
172 
175 
177 
178  std::unique_ptr<weld::Widget> m_xFlPosition;
179  std::unique_ptr<weld::MetricSpinButton> m_xMtrPosX;
180  std::unique_ptr<weld::MetricSpinButton> m_xMtrPosY;
181  std::unique_ptr<weld::CustomWeld> m_xCtlRect;
182  std::unique_ptr<weld::Widget> m_xFlAngle;
183  std::unique_ptr<weld::MetricSpinButton> m_xNfAngle;
184  std::unique_ptr<svx::DialControl> m_xCtlAngle;
185  std::unique_ptr<weld::CustomWeld> m_xCtlAngleWin;
186 
187 public:
188  SvxAngleTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs);
189  virtual ~SvxAngleTabPage() override;
190 
191  static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* );
192  static const sal_uInt16* GetRanges() { return pAngleRanges; }
193 
194  virtual bool FillItemSet( SfxItemSet* ) override;
195  virtual void Reset( const SfxItemSet * ) override;
196 
197  virtual void ActivatePage( const SfxItemSet& rSet ) override;
198  virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
199 
200  virtual void PointChanged(weld::DrawingArea* pWindow, RectPoint eRP) override;
201 
202  void Construct();
203  void SetView( const SdrView* pSdrView ) { pView = pSdrView; }
204 };
205 
206 /*************************************************************************
207 |*
208 |* slant/corner radius tab page
209 |*
210 \************************************************************************/
212 {
213  static const sal_uInt16 pSlantRanges[];
214 
215 private:
216  const SdrView* pView;
217 
220 
221  std::unique_ptr<weld::Widget> m_xFlRadius;
222  std::unique_ptr<weld::MetricSpinButton> m_xMtrRadius;
223  std::unique_ptr<weld::Widget> m_xFlAngle;
224  std::unique_ptr<weld::MetricSpinButton> m_xMtrAngle;
225  std::unique_ptr<weld::Widget> m_aControlGroups[2];
226  std::unique_ptr<weld::Widget> m_aControlGroupX[2];
227  std::unique_ptr<weld::MetricSpinButton> m_aControlX[2];
228  std::unique_ptr<weld::Widget> m_aControlGroupY[2];
229  std::unique_ptr<weld::MetricSpinButton> m_aControlY[2];
230 
231 public:
232  SvxSlantTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs);
233  virtual ~SvxSlantTabPage() override;
234 
235  static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* );
236  static const sal_uInt16* GetRanges() { return pSlantRanges; }
237 
238  virtual bool FillItemSet( SfxItemSet* ) override;
239  virtual void Reset( const SfxItemSet * ) override;
240 
241  virtual void ActivatePage( const SfxItemSet& rSet ) override;
242  virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
243 
244  void Construct();
245  void SetView( const SdrView* pSdrView ) { pView = pSdrView; }
246 };
247 
248 
249 #endif // INCLUDED_CUI_SOURCE_INC_TRANSFRM_HXX
250 
251 /* 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:225
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:181
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:228
virtual ~SvxSlantTabPage() override
Definition: transfrm.cxx:425
Link< SvxSwFrameValidation &, void > aValidateLink
Definition: transfrm.hxx:43
void Construct()
Definition: transfrm.cxx:195
basegfx::B2DPoint maAnchor
Definition: transfrm.hxx:74
std::unique_ptr< svx::DialControl > m_xCtlAngle
Definition: transfrm.hxx:184
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:98
std::unique_ptr< weld::CheckButton > m_xTsbAutoGrowWidth
Definition: transfrm.hxx:117
std::unique_ptr< weld::Widget > m_aControlGroupX[2]
Definition: transfrm.hxx:226
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:702
std::unique_ptr< weld::Widget > m_xFlAngle
Definition: transfrm.hxx:182
std::unique_ptr< weld::MetricSpinButton > m_xMtrRadius
Definition: transfrm.hxx:222
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:707
std::unique_ptr< weld::Label > m_xFtHeight
Definition: transfrm.hxx:105
std::unique_ptr< weld::MetricSpinButton > m_xNfAngle
Definition: transfrm.hxx:183
std::unique_ptr< weld::MetricSpinButton > m_xMtrPosY
Definition: transfrm.hxx:180
basegfx::B2DRange maRange
Definition: transfrm.hxx:170
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:218
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:103
std::unique_ptr< weld::MetricSpinButton > m_xMtrAngle
Definition: transfrm.hxx:224
const SdrView * pView
Definition: transfrm.hxx:216
static const sal_uInt16 * GetRanges()
Definition: transfrm.hxx:136
RectPoint
std::unique_ptr< weld::Widget > m_xFlRadius
Definition: transfrm.hxx:221
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:236
SvxRectCtl m_aCtlRect
Definition: transfrm.hxx:176
void SetView(const SdrView *pSdrView)
Definition: transfrm.hxx:203
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:1019
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: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:229
static const sal_uInt16 pPosSizeRanges[]
Definition: transfrm.hxx:64
std::unique_ptr< weld::Widget > m_xFlPosition
Definition: transfrm.hxx:178
std::unique_ptr< weld::Widget > m_xFlAngle
Definition: transfrm.hxx:223
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:174
virtual ~SvxPositionSizeTabPage() override
Definition: transfrm.cxx:795
std::unique_ptr< weld::CheckButton > m_xTsbPosProtect
Definition: transfrm.hxx:112
void SetView(const SdrView *pSdrView)
Definition: transfrm.hxx:245
TriState mnProtectSizeState
Definition: transfrm.hxx:78
std::unique_ptr< weld::MetricSpinButton > m_aControlX[2]
Definition: transfrm.hxx:227
std::unique_ptr< weld::MetricSpinButton > m_xMtrPosX
Definition: transfrm.hxx:179
std::unique_ptr< weld::MetricSpinButton > m_xMtrHeight
Definition: transfrm.hxx:106
const SdrView * pView
Definition: transfrm.hxx:167
DECL_LINK(ChangePosProtectHdl, weld::ToggleButton &, void)
SvxAnchorIds
std::unique_ptr< weld::CustomWeld > m_xCtlAngleWin
Definition: transfrm.hxx:185
std::unique_ptr< weld::CustomWeld > m_xCtlSize
Definition: transfrm.hxx:108
FieldUnit eDlgUnit
Definition: transfrm.hxx:219
basegfx::B2DPoint maAnchor
Definition: transfrm.hxx:171
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:1118
MapUnit ePoolUnit
Definition: transfrm.hxx:173
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:213
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: transfrm.cxx:319
static const sal_uInt16 * GetRanges()
Definition: transfrm.hxx:192