1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: transfrm.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _SVX_TRANSFRM_HXX
31 #define _SVX_TRANSFRM_HXX
33 // include ---------------------------------------------------------------
35 #include <svx/dlgctrl.hxx>
37 #ifndef _FIXED_HXX //autogen
38 #include <vcl/fixed.hxx>
42 #include <basegfx/range/b2drange.hxx>
47 /*************************************************************************
49 |* Transform-Tab-Dialog
51 \************************************************************************/
53 /** put this into the nAnchorTypes parameter of the SvxTransformTabDialog c'tor
54 to disable the size controls */
55 const USHORT SVX_OBJ_NORESIZE
= 0x0100;
57 /** put this into the nAnchorTypes parameter of the SvxTransformTabDialog c'tor
58 to disable the protect controls */
59 const USHORT SVX_OBJ_NOPROTECT
= 0x0200;
61 class SvxTransformTabDialog
: public SfxTabDialog
69 virtual void PageCreated( USHORT nId
, SfxTabPage
&rPage
);
73 SvxTransformTabDialog( Window
* pParent
, const SfxItemSet
* pAttr
,
75 USHORT nAnchorTypes
= 0);
76 ~SvxTransformTabDialog();
78 //link for the Writer to validate positions
79 void SetValidateFramePosLink( const Link
& rLink
);
82 /*************************************************************************
84 |* position and size tab page
86 \************************************************************************/
88 class SvxPositionSizeTabPage
: public SvxTabPage
90 using TabPage::ActivatePage
;
91 using TabPage::DeactivatePage
;
95 FixedLine maFlPosition
;
97 MetricField maMtrPosX
;
99 MetricField maMtrPosY
;
100 FixedText maFtPosReference
;
106 MetricField maMtrWidth
;
107 FixedText maFtHeight
;
108 MetricField maMtrHeight
;
110 FixedText maFtSizeReference
;
111 SvxRectCtl maCtlSize
;
114 FixedLine maFlProtect
;
115 TriStateBox maTsbPosProtect
;
116 TriStateBox maTsbSizeProtect
;
119 FixedLine maFlAdjust
;
120 TriStateBox maTsbAutoGrowWidth
;
121 TriStateBox maTsbAutoGrowHeight
;
123 FixedLine maFlDivider
;
126 const SfxItemSet
& mrOutAttrs
;
128 const SdrView
* mpView
;
131 basegfx::B2DRange maRange
;
132 basegfx::B2DRange maWorkRange
;
133 basegfx::B2DPoint maAnchor
;
135 SfxMapUnit mePoolUnit
;
138 TriState mnProtectSizeState
;
140 bool mbProtectDisabled
;
142 bool mbAdjustDisabled
;
150 //------------------------------------
152 DECL_LINK( ChangePosProtectHdl
, void * );
153 DECL_LINK( ChangeSizeProtectHdl
, void * );
154 DECL_LINK( ChangePosXHdl
, void * );
155 DECL_LINK( ChangePosYHdl
, void * );
156 // DECL_LINK( SetAnchorHdl, ListBox * );
157 // DECL_LINK( SetOrientHdl, ListBox * );
159 void SetMinMaxPosition();
160 void GetTopLeftPosition(double& rfX
, double& rfY
, const basegfx::B2DRange
& rRange
);
164 DECL_LINK( ChangeWidthHdl
, void * );
165 DECL_LINK( ChangeHeightHdl
, void * );
166 DECL_LINK( ClickSizeProtectHdl
, void * );
167 DECL_LINK( ClickAutoHdl
, void * );
169 void SetMaxSize( Rectangle aRect
);
174 SvxPositionSizeTabPage( Window
* pParent
, const SfxItemSet
& rInAttrs
);
176 static SfxTabPage
* Create( Window
*, const SfxItemSet
& );
177 static USHORT
* GetRanges();
179 virtual BOOL
FillItemSet( SfxItemSet
& );
180 virtual void Reset( const SfxItemSet
& );
182 virtual void ActivatePage( const SfxItemSet
& rSet
);
183 virtual int DeactivatePage( SfxItemSet
* pSet
);
185 virtual void PointChanged( Window
* pWindow
, RECT_POINT eRP
);
188 void SetView( const SdrView
* pSdrView
) { mpView
= pSdrView
; }
190 // void ShowAnchorCtrls(USHORT nAnchorCtrls); // Writer-spezifische Controls anzeigen
191 virtual void FillUserData();
193 void DisableResize();
194 void DisableProtect();
196 void UpdateControlStates();
199 /*************************************************************************
201 |* Drehwinkel-Tab-Page
203 \************************************************************************/
204 class SvxAngleTabPage
: public SvxTabPage
206 using TabPage::ActivatePage
;
207 using TabPage::DeactivatePage
;
210 FixedLine aFlPosition
;
212 MetricField aMtrPosX
;
214 MetricField aMtrPosY
;
215 FixedText aFtPosPresets
;
220 MetricField aMtrAngle
;
221 FixedText aFtAnglePresets
;
222 SvxRectCtl aCtlAngle
;
224 const SfxItemSet
& rOutAttrs
;
225 const SdrView
* pView
;
228 basegfx::B2DRange maRange
;
229 basegfx::B2DPoint maAnchor
;
231 SfxMapUnit ePoolUnit
;
234 //------------------------------------
236 DECL_LINK( ModifiedHdl
, void * );
239 SvxAngleTabPage( Window
* pParent
, const SfxItemSet
& rInAttrs
);
241 static SfxTabPage
* Create( Window
*, const SfxItemSet
& );
242 static USHORT
* GetRanges();
244 virtual BOOL
FillItemSet( SfxItemSet
& );
245 virtual void Reset( const SfxItemSet
& );
247 virtual void ActivatePage( const SfxItemSet
& rSet
);
248 virtual int DeactivatePage( SfxItemSet
* pSet
);
250 virtual void PointChanged( Window
* pWindow
, RECT_POINT eRP
);
253 void SetView( const SdrView
* pSdrView
) { pView
= pSdrView
; }
256 /*************************************************************************
258 |* Schraegstellen/Eckenradius-Tab-Page
260 \************************************************************************/
261 class SvxSlantTabPage
: public SvxTabPage
263 using TabPage::ActivatePage
;
264 using TabPage::DeactivatePage
;
269 MetricField aMtrRadius
;
270 //TriStateBox aTsbVertical;
273 MetricField aMtrAngle
;
274 //SvxRectCtl aCtlAngle;
276 const SfxItemSet
& rOutAttrs
;
278 const SdrView
* pView
;
281 basegfx::B2DRange maRange
;
283 SfxMapUnit ePoolUnit
;
286 //------------------------------------
288 SvxSlantTabPage( Window
* pParent
, const SfxItemSet
& rInAttrs
);
290 static SfxTabPage
* Create( Window
*, const SfxItemSet
& );
291 static USHORT
* GetRanges();
293 virtual BOOL
FillItemSet( SfxItemSet
& );
294 virtual void Reset( const SfxItemSet
& );
296 virtual void ActivatePage( const SfxItemSet
& rSet
);
297 virtual int DeactivatePage( SfxItemSet
* pSet
);
299 virtual void PointChanged( Window
* pWindow
, RECT_POINT eRP
);
302 void SetView( const SdrView
* pSdrView
) { pView
= pSdrView
; }
307 #endif // _SVX_TRANSFRM_HXX