bump product version to 5.0.4.1
[LibreOffice.git] / cui / source / inc / transfrm.hxx
blob2945d28e494c8a7c3f9d935d48c28f8103e8321a
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 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>
29 // predefines
30 class SdrView;
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
48 sal_uInt16 nPosSize;
49 sal_uInt16 nSWPosSize;
50 sal_uInt16 nRotation;
51 sal_uInt16 nSlant;
52 private:
53 const SdrView* pView;
55 sal_uInt16 nAnchorCtrls;
56 Link<> aValidateLink;
58 virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) SAL_OVERRIDE;
60 public:
62 SvxTransformTabDialog( vcl::Window* pParent, const SfxItemSet* pAttr,
63 const SdrView* pView,
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[];
82 private:
83 // position
84 VclPtr<VclFrame> m_pFlPosition;
85 VclPtr<MetricField> m_pMtrPosX;
86 VclPtr<MetricField> m_pMtrPosY;
87 VclPtr<SvxRectCtl> m_pCtlPos;
89 // size
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;
98 // protect
99 VclPtr<VclFrame> m_pFlProtect;
100 VclPtr<TriStateBox> m_pTsbPosProtect;
101 VclPtr<TriStateBox> m_pTsbSizeProtect;
103 // adjust
104 VclPtr<VclFrame> m_pFlAdjust;
105 VclPtr<TriStateBox> m_pTsbAutoGrowWidth;
106 VclPtr<TriStateBox> m_pTsbAutoGrowHeight;
108 private:
109 const SfxItemSet& mrOutAttrs;
111 const SdrView* mpView;
113 // #i75273#
114 basegfx::B2DRange maRange;
115 basegfx::B2DRange maWorkRange;
116 basegfx::B2DPoint maAnchor;
118 SfxMapUnit mePoolUnit;
119 FieldUnit meDlgUnit;
120 MapUnit meMapUnit;
121 TriState mnProtectSizeState;
122 bool mbPageDisabled;
123 bool mbProtectDisabled;
124 bool mbSizeDisabled;
125 bool mbAdjustDisabled;
127 // from size
128 // #i75273#
129 double mfOldWidth;
130 double mfOldHeight;
131 RECT_POINT meRP;
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 );
147 public:
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;
163 void Construct();
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[];
185 private:
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;
198 // #i75273#
199 basegfx::B2DRange maRange;
200 basegfx::B2DPoint maAnchor;
202 SfxMapUnit ePoolUnit;
203 FieldUnit eDlgUnit;
205 public:
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;
221 void Construct();
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[];
236 private:
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;
246 // #i75273#
247 basegfx::B2DRange maRange;
249 SfxMapUnit ePoolUnit;
250 FieldUnit eDlgUnit;
252 public:
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;
268 void Construct();
269 void SetView( const SdrView* pSdrView ) { pView = pSdrView; }
274 #endif // INCLUDED_CUI_SOURCE_INC_TRANSFRM_HXX
276 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */