Version 4.0.0.1, tag libreoffice-4.0.0.1
[LibreOffice.git] / cui / source / inc / transfrm.hxx
blobc1417d67325fe2de53c988f188d01a7cf9bc9fee
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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>
27 // #i75273#
28 #include <basegfx/range/b2drange.hxx>
30 // predefines
31 class SdrView;
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
49 private:
50 const SdrView* pView;
52 sal_uInt16 nAnchorCtrls;
53 Link aValidateLink;
55 virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage );
57 public:
59 SvxTransformTabDialog( Window* pParent, const SfxItemSet* pAttr,
60 const SdrView* pView,
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;
79 private:
80 // position
81 FixedLine maFlPosition;
82 FixedText maFtPosX;
83 MetricField maMtrPosX;
84 FixedText maFtPosY;
85 MetricField maMtrPosY;
86 FixedText maFtPosReference;
87 SvxRectCtl maCtlPos;
89 // size
90 FixedLine maFlSize;
91 FixedText maFtWidth;
92 MetricField maMtrWidth;
93 FixedText maFtHeight;
94 MetricField maMtrHeight;
95 CheckBox maCbxScale;
96 FixedText maFtSizeReference;
97 SvxRectCtl maCtlSize;
99 // protect
100 FixedLine maFlProtect;
101 TriStateBox maTsbPosProtect;
102 TriStateBox maTsbSizeProtect;
104 // adjust
105 FixedLine maFlAdjust;
106 TriStateBox maTsbAutoGrowWidth;
107 TriStateBox maTsbAutoGrowHeight;
109 FixedLine maFlDivider;
111 private:
112 const SfxItemSet& mrOutAttrs;
114 const SdrView* mpView;
116 // #i75273#
117 basegfx::B2DRange maRange;
118 basegfx::B2DRange maWorkRange;
119 basegfx::B2DPoint maAnchor;
121 SfxMapUnit mePoolUnit;
122 FieldUnit meDlgUnit;
123 MapUnit meMapUnit;
124 TriState mnProtectSizeState;
125 bool mbPageDisabled;
126 bool mbProtectDisabled;
127 bool mbSizeDisabled;
128 bool mbAdjustDisabled;
130 // frome size
131 // #i75273#
132 double mfOldWidth;
133 double mfOldHeight;
134 RECT_POINT meRP;
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 );
150 public:
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 );
164 void Construct();
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;
185 private:
186 FixedLine aFlPosition;
187 FixedText aFtPosX;
188 MetricField aMtrPosX;
189 FixedText aFtPosY;
190 MetricField aMtrPosY;
191 FixedText aFtPosPresets;
192 SvxRectCtl aCtlRect;
194 FixedLine aFlAngle;
195 FixedText aFtAngle;
196 NumericField maNfAngle;
197 FixedText aFtAnglePresets;
198 svx::DialControl aCtlAngle;
200 const SfxItemSet& rOutAttrs;
201 const SdrView* pView;
203 // #i75273#
204 basegfx::B2DRange maRange;
205 basegfx::B2DPoint maAnchor;
207 SfxMapUnit ePoolUnit;
208 FieldUnit eDlgUnit;
210 public:
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 );
224 void Construct();
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;
238 private:
239 FixedLine aFlRadius;
240 FixedText aFtRadius;
241 MetricField aMtrRadius;
242 FixedLine aFlAngle;
243 FixedText aFtAngle;
244 MetricField aMtrAngle;
246 const SfxItemSet& rOutAttrs;
248 const SdrView* pView;
250 // #i75273#
251 basegfx::B2DRange maRange;
253 SfxMapUnit ePoolUnit;
254 FieldUnit eDlgUnit;
255 //------------------------------------
256 public:
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 );
270 void Construct();
271 void SetView( const SdrView* pSdrView ) { pView = pSdrView; }
276 #endif // _SVX_TRANSFRM_HXX
278 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */