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 INCLUDED_CUI_SOURCE_INC_TRANSFRM_HXX
20 #define INCLUDED_CUI_SOURCE_INC_TRANSFRM_HXX
22 #include <svx/dlgctrl.hxx>
23 #include <svx/dialcontrol.hxx>
25 #include <vcl/fixed.hxx>
27 #include <basegfx/range/b2drange.hxx>
32 /*************************************************************************
34 |* Transform-Tab-Dialog
36 \************************************************************************/
38 /** put this into the nAnchorTypes parameter of the SvxTransformTabDialog c'tor
39 to disable the size controls */
40 const sal_uInt16 SVX_OBJ_NORESIZE
= 0x0100;
42 /** put this into the nAnchorTypes parameter of the SvxTransformTabDialog c'tor
43 to disable the protect controls */
44 const sal_uInt16 SVX_OBJ_NOPROTECT
= 0x0200;
46 class SvxTransformTabDialog
: public SfxTabDialog
49 sal_uInt16 nSWPosSize
;
55 sal_uInt16 nAnchorCtrls
;
58 virtual void PageCreated( sal_uInt16 nId
, SfxTabPage
&rPage
) SAL_OVERRIDE
;
62 SvxTransformTabDialog( vcl::Window
* pParent
, const SfxItemSet
* pAttr
,
64 sal_uInt16 nAnchorTypes
= 0);
66 //link for the Writer to validate positions
67 void SetValidateFramePosLink( const Link
<>& rLink
);
70 /*************************************************************************
72 |* position and size tab page
74 \************************************************************************/
76 class SvxPositionSizeTabPage
: public SvxTabPage
78 using TabPage::ActivatePage
;
79 using TabPage::DeactivatePage
;
80 static const sal_uInt16 pPosSizeRanges
[];
84 VclPtr
<VclFrame
> m_pFlPosition
;
85 VclPtr
<MetricField
> m_pMtrPosX
;
86 VclPtr
<MetricField
> m_pMtrPosY
;
87 VclPtr
<SvxRectCtl
> m_pCtlPos
;
90 VclPtr
<VclFrame
> m_pFlSize
;
91 VclPtr
<FixedText
> m_pFtWidth
;
92 VclPtr
<MetricField
> m_pMtrWidth
;
93 VclPtr
<FixedText
> m_pFtHeight
;
94 VclPtr
<MetricField
> m_pMtrHeight
;
95 VclPtr
<CheckBox
> m_pCbxScale
;
96 VclPtr
<SvxRectCtl
> m_pCtlSize
;
99 VclPtr
<VclFrame
> m_pFlProtect
;
100 VclPtr
<TriStateBox
> m_pTsbPosProtect
;
101 VclPtr
<TriStateBox
> m_pTsbSizeProtect
;
104 VclPtr
<VclFrame
> m_pFlAdjust
;
105 VclPtr
<TriStateBox
> m_pTsbAutoGrowWidth
;
106 VclPtr
<TriStateBox
> m_pTsbAutoGrowHeight
;
109 const SfxItemSet
& mrOutAttrs
;
111 const SdrView
* mpView
;
114 basegfx::B2DRange maRange
;
115 basegfx::B2DRange maWorkRange
;
116 basegfx::B2DPoint maAnchor
;
118 SfxMapUnit mePoolUnit
;
121 TriState mnProtectSizeState
;
123 bool mbProtectDisabled
;
125 bool mbAdjustDisabled
;
134 DECL_LINK( ChangePosProtectHdl
, void * );
135 DECL_LINK( ChangeSizeProtectHdl
, void * );
137 void SetMinMaxPosition();
138 void GetTopLeftPosition(double& rfX
, double& rfY
, const basegfx::B2DRange
& rRange
);
140 DECL_LINK( ChangeWidthHdl
, void * );
141 DECL_LINK( ChangeHeightHdl
, void * );
142 DECL_LINK( ClickSizeProtectHdl
, void * );
143 DECL_LINK( ClickAutoHdl
, void * );
145 void SetMaxSize( Rectangle aRect
);
148 SvxPositionSizeTabPage( vcl::Window
* pParent
, const SfxItemSet
& rInAttrs
);
149 virtual ~SvxPositionSizeTabPage();
150 virtual void dispose() SAL_OVERRIDE
;
152 static VclPtr
<SfxTabPage
> Create( vcl::Window
*, const SfxItemSet
* );
153 static const sal_uInt16
* GetRanges() { return pPosSizeRanges
; }
155 virtual bool FillItemSet( SfxItemSet
* ) SAL_OVERRIDE
;
156 virtual void Reset( const SfxItemSet
* ) SAL_OVERRIDE
;
158 virtual void ActivatePage( const SfxItemSet
& rSet
) SAL_OVERRIDE
;
159 virtual sfxpg
DeactivatePage( SfxItemSet
* pSet
) SAL_OVERRIDE
;
161 virtual void PointChanged( vcl::Window
* pWindow
, RECT_POINT eRP
) SAL_OVERRIDE
;
164 void SetView( const SdrView
* pSdrView
) { mpView
= pSdrView
; }
166 virtual void FillUserData() SAL_OVERRIDE
;
168 void DisableResize();
169 void DisableProtect();
171 void UpdateControlStates();
174 /*************************************************************************
176 |* rotation angle tab page
178 \************************************************************************/
179 class SvxAngleTabPage
: public SvxTabPage
181 using TabPage::ActivatePage
;
182 using TabPage::DeactivatePage
;
183 static const sal_uInt16 pAngleRanges
[];
186 VclPtr
<VclFrame
> m_pFlPosition
;
187 VclPtr
<MetricField
> m_pMtrPosX
;
188 VclPtr
<MetricField
> m_pMtrPosY
;
189 VclPtr
<SvxRectCtl
> m_pCtlRect
;
191 VclPtr
<VclFrame
> m_pFlAngle
;
192 VclPtr
<NumericField
> m_pNfAngle
;
193 VclPtr
<svx::DialControl
> m_pCtlAngle
;
195 const SfxItemSet
& rOutAttrs
;
196 const SdrView
* pView
;
199 basegfx::B2DRange maRange
;
200 basegfx::B2DPoint maAnchor
;
202 SfxMapUnit ePoolUnit
;
206 SvxAngleTabPage( vcl::Window
* pParent
, const SfxItemSet
& rInAttrs
);
207 virtual ~SvxAngleTabPage();
208 virtual void dispose() SAL_OVERRIDE
;
210 static VclPtr
<SfxTabPage
> Create( vcl::Window
*, const SfxItemSet
* );
211 static const sal_uInt16
* GetRanges() { return pAngleRanges
; }
213 virtual bool FillItemSet( SfxItemSet
* ) SAL_OVERRIDE
;
214 virtual void Reset( const SfxItemSet
* ) SAL_OVERRIDE
;
216 virtual void ActivatePage( const SfxItemSet
& rSet
) SAL_OVERRIDE
;
217 virtual sfxpg
DeactivatePage( SfxItemSet
* pSet
) SAL_OVERRIDE
;
219 virtual void PointChanged( vcl::Window
* pWindow
, RECT_POINT eRP
) SAL_OVERRIDE
;
222 void SetView( const SdrView
* pSdrView
) { pView
= pSdrView
; }
225 /*************************************************************************
227 |* slant/corner radius tab page
229 \************************************************************************/
230 class SvxSlantTabPage
: public SvxTabPage
232 using TabPage::ActivatePage
;
233 using TabPage::DeactivatePage
;
234 static const sal_uInt16 pSlantRanges
[];
237 VclPtr
<VclFrame
> m_pFlRadius
;
238 VclPtr
<MetricField
> m_pMtrRadius
;
239 VclPtr
<VclFrame
> m_pFlAngle
;
240 VclPtr
<MetricField
> m_pMtrAngle
;
242 const SfxItemSet
& rOutAttrs
;
244 const SdrView
* pView
;
247 basegfx::B2DRange maRange
;
249 SfxMapUnit ePoolUnit
;
253 SvxSlantTabPage( vcl::Window
* pParent
, const SfxItemSet
& rInAttrs
);
254 virtual ~SvxSlantTabPage();
255 virtual void dispose() SAL_OVERRIDE
;
257 static VclPtr
<SfxTabPage
> Create( vcl::Window
*, const SfxItemSet
* );
258 static const sal_uInt16
* GetRanges() { return pSlantRanges
; }
260 virtual bool FillItemSet( SfxItemSet
* ) SAL_OVERRIDE
;
261 virtual void Reset( const SfxItemSet
* ) SAL_OVERRIDE
;
263 virtual void ActivatePage( const SfxItemSet
& rSet
) SAL_OVERRIDE
;
264 virtual sfxpg
DeactivatePage( SfxItemSet
* pSet
) SAL_OVERRIDE
;
266 virtual void PointChanged( vcl::Window
* pWindow
, RECT_POINT eRP
) SAL_OVERRIDE
;
269 void SetView( const SdrView
* pSdrView
) { pView
= pSdrView
; }
274 #endif // INCLUDED_CUI_SOURCE_INC_TRANSFRM_HXX
276 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */