update dev300-m58
[ooovba.git] / svx / source / cui / transfrm.hxx
blob8b25e2cee04a3b24c81794b014da113dd0464f1c
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: transfrm.hxx,v $
10 * $Revision: 1.12 $
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>
39 #endif
41 // #i75273#
42 #include <basegfx/range/b2drange.hxx>
44 // predefines
45 class SdrView;
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
63 private:
64 const SdrView* pView;
66 USHORT nAnchorCtrls;
67 Link aValidateLink;
69 virtual void PageCreated( USHORT nId, SfxTabPage &rPage );
71 public:
73 SvxTransformTabDialog( Window* pParent, const SfxItemSet* pAttr,
74 const SdrView* pView,
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;
93 private:
94 // position
95 FixedLine maFlPosition;
96 FixedText maFtPosX;
97 MetricField maMtrPosX;
98 FixedText maFtPosY;
99 MetricField maMtrPosY;
100 FixedText maFtPosReference;
101 SvxRectCtl maCtlPos;
103 // size
104 FixedLine maFlSize;
105 FixedText maFtWidth;
106 MetricField maMtrWidth;
107 FixedText maFtHeight;
108 MetricField maMtrHeight;
109 CheckBox maCbxScale;
110 FixedText maFtSizeReference;
111 SvxRectCtl maCtlSize;
113 // protect
114 FixedLine maFlProtect;
115 TriStateBox maTsbPosProtect;
116 TriStateBox maTsbSizeProtect;
118 // adjust
119 FixedLine maFlAdjust;
120 TriStateBox maTsbAutoGrowWidth;
121 TriStateBox maTsbAutoGrowHeight;
123 FixedLine maFlDivider;
125 private:
126 const SfxItemSet& mrOutAttrs;
128 const SdrView* mpView;
130 // #i75273#
131 basegfx::B2DRange maRange;
132 basegfx::B2DRange maWorkRange;
133 basegfx::B2DPoint maAnchor;
135 SfxMapUnit mePoolUnit;
136 FieldUnit meDlgUnit;
137 MapUnit meMapUnit;
138 TriState mnProtectSizeState;
139 bool mbPageDisabled;
140 bool mbProtectDisabled;
141 bool mbSizeDisabled;
142 bool mbAdjustDisabled;
144 // frome size
145 // #i75273#
146 double mfOldWidth;
147 double mfOldHeight;
148 RECT_POINT meRP;
150 //------------------------------------
151 #if _SOLAR__PRIVATE
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);
161 #endif
163 #if _SOLAR__PRIVATE
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 );
170 Rectangle GetRect();
171 #endif
173 public:
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 );
187 void Construct();
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;
209 private:
210 FixedLine aFlPosition;
211 FixedText aFtPosX;
212 MetricField aMtrPosX;
213 FixedText aFtPosY;
214 MetricField aMtrPosY;
215 FixedText aFtPosPresets;
216 SvxRectCtl aCtlRect;
218 FixedLine aFlAngle;
219 FixedText aFtAngle;
220 MetricField aMtrAngle;
221 FixedText aFtAnglePresets;
222 SvxRectCtl aCtlAngle;
224 const SfxItemSet& rOutAttrs;
225 const SdrView* pView;
227 // #i75273#
228 basegfx::B2DRange maRange;
229 basegfx::B2DPoint maAnchor;
231 SfxMapUnit ePoolUnit;
232 FieldUnit eDlgUnit;
233 MapUnit eMapUnit;
234 //------------------------------------
235 #if _SOLAR__PRIVATE
236 DECL_LINK( ModifiedHdl, void * );
237 #endif
238 public:
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 );
252 void Construct();
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;
266 private:
267 FixedLine aFlRadius;
268 FixedText aFtRadius;
269 MetricField aMtrRadius;
270 //TriStateBox aTsbVertical;
271 FixedLine aFlAngle;
272 FixedText aFtAngle;
273 MetricField aMtrAngle;
274 //SvxRectCtl aCtlAngle;
276 const SfxItemSet& rOutAttrs;
278 const SdrView* pView;
280 // #i75273#
281 basegfx::B2DRange maRange;
283 SfxMapUnit ePoolUnit;
284 FieldUnit eDlgUnit;
285 MapUnit eMapUnit;
286 //------------------------------------
287 public:
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 );
301 void Construct();
302 void SetView( const SdrView* pSdrView ) { pView = pSdrView; }
307 #endif // _SVX_TRANSFRM_HXX