1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef _SVX_TRANSFRM_HXX
20 #define _SVX_TRANSFRM_HXX
22 #include <svx/dlgctrl.hxx>
23 #include <svx/dialcontrol.hxx>
25 #include <vcl/fixed.hxx>
28 #include <basegfx/range/b2drange.hxx>
33 /*************************************************************************
35 |* Transform-Tab-Dialog
37 \************************************************************************/
39 /** put this into the nAnchorTypes parameter of the SvxTransformTabDialog c'tor
40 to disable the size controls */
41 const sal_uInt16 SVX_OBJ_NORESIZE
= 0x0100;
43 /** put this into the nAnchorTypes parameter of the SvxTransformTabDialog c'tor
44 to disable the protect controls */
45 const sal_uInt16 SVX_OBJ_NOPROTECT
= 0x0200;
47 class SvxTransformTabDialog
: public SfxTabDialog
52 sal_uInt16 nAnchorCtrls
;
55 virtual void PageCreated( sal_uInt16 nId
, SfxTabPage
&rPage
);
59 SvxTransformTabDialog( Window
* pParent
, const SfxItemSet
* pAttr
,
61 sal_uInt16 nAnchorTypes
= 0);
62 ~SvxTransformTabDialog();
64 //link for the Writer to validate positions
65 void SetValidateFramePosLink( const Link
& rLink
);
68 /*************************************************************************
70 |* position and size tab page
72 \************************************************************************/
74 class SvxPositionSizeTabPage
: public SvxTabPage
76 using TabPage::ActivatePage
;
77 using TabPage::DeactivatePage
;
81 FixedLine maFlPosition
;
83 MetricField maMtrPosX
;
85 MetricField maMtrPosY
;
86 FixedText maFtPosReference
;
92 MetricField maMtrWidth
;
94 MetricField maMtrHeight
;
96 FixedText maFtSizeReference
;
100 FixedLine maFlProtect
;
101 TriStateBox maTsbPosProtect
;
102 TriStateBox maTsbSizeProtect
;
105 FixedLine maFlAdjust
;
106 TriStateBox maTsbAutoGrowWidth
;
107 TriStateBox maTsbAutoGrowHeight
;
109 FixedLine maFlDivider
;
112 const SfxItemSet
& mrOutAttrs
;
114 const SdrView
* mpView
;
117 basegfx::B2DRange maRange
;
118 basegfx::B2DRange maWorkRange
;
119 basegfx::B2DPoint maAnchor
;
121 SfxMapUnit mePoolUnit
;
124 TriState mnProtectSizeState
;
126 bool mbProtectDisabled
;
128 bool mbAdjustDisabled
;
136 //------------------------------------
137 DECL_LINK( ChangePosProtectHdl
, void * );
138 DECL_LINK( ChangeSizeProtectHdl
, void * );
140 void SetMinMaxPosition();
141 void GetTopLeftPosition(double& rfX
, double& rfY
, const basegfx::B2DRange
& rRange
);
143 DECL_LINK( ChangeWidthHdl
, void * );
144 DECL_LINK( ChangeHeightHdl
, void * );
145 DECL_LINK( ClickSizeProtectHdl
, void * );
146 DECL_LINK( ClickAutoHdl
, void * );
148 void SetMaxSize( Rectangle aRect
);
151 SvxPositionSizeTabPage( Window
* pParent
, const SfxItemSet
& rInAttrs
);
153 static SfxTabPage
* Create( Window
*, const SfxItemSet
& );
154 static sal_uInt16
* GetRanges();
156 virtual sal_Bool
FillItemSet( SfxItemSet
& );
157 virtual void Reset( const SfxItemSet
& );
159 virtual void ActivatePage( const SfxItemSet
& rSet
);
160 virtual int DeactivatePage( SfxItemSet
* pSet
);
162 virtual void PointChanged( Window
* pWindow
, RECT_POINT eRP
);
165 void SetView( const SdrView
* pSdrView
) { mpView
= pSdrView
; }
167 virtual void FillUserData();
169 void DisableResize();
170 void DisableProtect();
172 void UpdateControlStates();
175 /*************************************************************************
177 |* rotation angle tab page
179 \************************************************************************/
180 class SvxAngleTabPage
: public SvxTabPage
182 using TabPage::ActivatePage
;
183 using TabPage::DeactivatePage
;
186 FixedLine aFlPosition
;
188 MetricField aMtrPosX
;
190 MetricField aMtrPosY
;
191 FixedText aFtPosPresets
;
196 NumericField maNfAngle
;
197 FixedText aFtAnglePresets
;
198 svx::DialControl aCtlAngle
;
200 const SfxItemSet
& rOutAttrs
;
201 const SdrView
* pView
;
204 basegfx::B2DRange maRange
;
205 basegfx::B2DPoint maAnchor
;
207 SfxMapUnit ePoolUnit
;
211 SvxAngleTabPage( Window
* pParent
, const SfxItemSet
& rInAttrs
);
213 static SfxTabPage
* Create( Window
*, const SfxItemSet
& );
214 static sal_uInt16
* GetRanges();
216 virtual sal_Bool
FillItemSet( SfxItemSet
& );
217 virtual void Reset( const SfxItemSet
& );
219 virtual void ActivatePage( const SfxItemSet
& rSet
);
220 virtual int DeactivatePage( SfxItemSet
* pSet
);
222 virtual void PointChanged( Window
* pWindow
, RECT_POINT eRP
);
225 void SetView( const SdrView
* pSdrView
) { pView
= pSdrView
; }
228 /*************************************************************************
230 |* slant/corner radius tab page
232 \************************************************************************/
233 class SvxSlantTabPage
: public SvxTabPage
235 using TabPage::ActivatePage
;
236 using TabPage::DeactivatePage
;
241 MetricField aMtrRadius
;
244 MetricField aMtrAngle
;
246 const SfxItemSet
& rOutAttrs
;
248 const SdrView
* pView
;
251 basegfx::B2DRange maRange
;
253 SfxMapUnit ePoolUnit
;
255 //------------------------------------
257 SvxSlantTabPage( Window
* pParent
, const SfxItemSet
& rInAttrs
);
259 static SfxTabPage
* Create( Window
*, const SfxItemSet
& );
260 static sal_uInt16
* GetRanges();
262 virtual sal_Bool
FillItemSet( SfxItemSet
& );
263 virtual void Reset( const SfxItemSet
& );
265 virtual void ActivatePage( const SfxItemSet
& rSet
);
266 virtual int DeactivatePage( SfxItemSet
* pSet
);
268 virtual void PointChanged( Window
* pWindow
, RECT_POINT eRP
);
271 void SetView( const SdrView
* pSdrView
) { pView
= pSdrView
; }
276 #endif // _SVX_TRANSFRM_HXX
278 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */