tdf#147611: fix indices
[LibreOffice.git] / cui / source / inc / transfrm.hxx
blob30b789dc73c46f6bc9e243daaa348c2e4ecc713c
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 #pragma once
21 #include <svx/dlgctrl.hxx>
22 #include <svx/dialcontrol.hxx>
23 #include <svx/anchorid.hxx>
24 #include <basegfx/range/b2drange.hxx>
26 // predefines
27 class SdrView;
29 /*************************************************************************
31 |* Transform-Tab-Dialog
33 \************************************************************************/
35 struct SvxSwFrameValidation;
36 class SvxTransformTabDialog : public SfxTabDialogController
38 private:
39 const SdrView* pView;
41 SvxAnchorIds nAnchorCtrls;
42 Link<SvxSwFrameValidation&,void> aValidateLink;
44 virtual void PageCreated(const OString& rId, SfxTabPage &rPage) override;
46 public:
47 SvxTransformTabDialog(weld::Window* pParent, const SfxItemSet* pAttr,
48 const SdrView* pView,
49 SvxAnchorIds nAnchorTypes);
51 //link for the Writer to validate positions
52 void SetValidateFramePosLink( const Link<SvxSwFrameValidation&,void>& rLink );
55 /*************************************************************************
57 |* position and size tab page
59 \************************************************************************/
61 class SvxPositionSizeTabPage : public SvxTabPage
63 static const WhichRangesContainer pPosSizeRanges;
65 private:
66 const SfxItemSet& mrOutAttrs;
68 const SdrView* mpView;
70 // #i75273#
71 basegfx::B2DRange maRange;
72 basegfx::B2DRange maWorkRange;
73 basegfx::B2DPoint maAnchor;
75 MapUnit mePoolUnit;
76 FieldUnit meDlgUnit;
77 TriState mnProtectSizeState;
78 bool mbPageDisabled;
79 bool mbProtectDisabled;
80 bool mbSizeDisabled;
81 bool mbAdjustDisabled;
82 bool mbIgnoreAutoGrowWidth;
83 bool mbIgnoreAutoGrowHeight;
85 // from size
86 // #i75273#
87 double mfOldWidth;
88 double mfOldHeight;
89 RectPoint meRP;
91 SvxRectCtl m_aCtlPos;
92 SvxRectCtl m_aCtlSize;
94 // position
95 std::unique_ptr<weld::Widget> m_xFlPosition;
96 std::unique_ptr<weld::MetricSpinButton> m_xMtrPosX;
97 std::unique_ptr<weld::MetricSpinButton> m_xMtrPosY;
98 std::unique_ptr<weld::CustomWeld> m_xCtlPos;
100 // size
101 std::unique_ptr<weld::Widget> m_xFlSize;
102 std::unique_ptr<weld::Label> m_xFtWidth;
103 std::unique_ptr<weld::MetricSpinButton> m_xMtrWidth;
104 std::unique_ptr<weld::Label> m_xFtHeight;
105 std::unique_ptr<weld::MetricSpinButton> m_xMtrHeight;
106 std::unique_ptr<weld::CheckButton> m_xCbxScale;
107 std::unique_ptr<weld::CustomWeld> m_xCtlSize;
109 // protect
110 std::unique_ptr<weld::Widget> m_xFlProtect;
111 std::unique_ptr<weld::CheckButton> m_xTsbPosProtect;
112 std::unique_ptr<weld::CheckButton> m_xTsbSizeProtect;
114 // adjust
115 std::unique_ptr<weld::Widget> m_xFlAdjust;
116 std::unique_ptr<weld::CheckButton> m_xTsbAutoGrowWidth;
117 std::unique_ptr<weld::CheckButton> m_xTsbAutoGrowHeight;
119 DECL_LINK(ChangePosProtectHdl, weld::Toggleable&, void);
120 DECL_LINK(ChangeSizeProtectHdl, weld::Toggleable&, void);
122 void SetMinMaxPosition();
123 void GetTopLeftPosition(double& rfX, double& rfY, const basegfx::B2DRange& rRange);
125 DECL_LINK( ChangeWidthHdl, weld::MetricSpinButton&, void );
126 DECL_LINK( ChangeHeightHdl, weld::MetricSpinButton&, void );
127 DECL_LINK( ClickSizeProtectHdl, weld::Toggleable&, void );
128 DECL_LINK( ClickAutoHdl, weld::Toggleable&, void );
130 public:
131 SvxPositionSizeTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs);
132 virtual ~SvxPositionSizeTabPage() override;
134 static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* );
135 static WhichRangesContainer GetRanges() { return pPosSizeRanges; }
137 virtual bool FillItemSet( SfxItemSet* ) override;
138 virtual void Reset( const SfxItemSet * ) override;
140 virtual void ActivatePage( const SfxItemSet& rSet ) override;
141 virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
143 virtual void PointChanged(weld::DrawingArea* pWindow, RectPoint eRP) override;
145 void Construct();
146 void SetView( const SdrView* pSdrView ) { mpView = pSdrView; }
148 virtual void FillUserData() override;
150 void DisableResize();
151 void DisableProtect();
153 void UpdateControlStates();
156 /*************************************************************************
158 |* rotation angle tab page
160 \************************************************************************/
161 class SvxAngleTabPage : public SvxTabPage
163 static const WhichRangesContainer pAngleRanges;
165 private:
166 const SdrView* pView;
168 // #i75273#
169 basegfx::B2DRange maRange;
170 basegfx::B2DPoint maAnchor;
172 MapUnit ePoolUnit;
173 FieldUnit eDlgUnit;
175 SvxRectCtl m_aCtlRect;
177 std::unique_ptr<weld::Widget> m_xFlPosition;
178 std::unique_ptr<weld::MetricSpinButton> m_xMtrPosX;
179 std::unique_ptr<weld::MetricSpinButton> m_xMtrPosY;
180 std::unique_ptr<weld::CustomWeld> m_xCtlRect;
181 std::unique_ptr<weld::Widget> m_xFlAngle;
182 std::unique_ptr<weld::MetricSpinButton> m_xNfAngle;
183 std::unique_ptr<svx::DialControl> m_xCtlAngle;
184 std::unique_ptr<weld::CustomWeld> m_xCtlAngleWin;
186 public:
187 SvxAngleTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs);
188 virtual ~SvxAngleTabPage() override;
190 static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* );
191 static WhichRangesContainer GetRanges() { return pAngleRanges; }
193 virtual bool FillItemSet( SfxItemSet* ) override;
194 virtual void Reset( const SfxItemSet * ) override;
196 virtual void ActivatePage( const SfxItemSet& rSet ) override;
197 virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
199 virtual void PointChanged(weld::DrawingArea* pWindow, RectPoint eRP) override;
201 void Construct();
202 void SetView( const SdrView* pSdrView ) { pView = pSdrView; }
205 /*************************************************************************
207 |* slant/corner radius tab page
209 \************************************************************************/
210 class SvxSlantTabPage : public SfxTabPage
212 static const WhichRangesContainer pSlantRanges;
214 private:
215 const SdrView* pView;
217 MapUnit ePoolUnit;
218 FieldUnit eDlgUnit;
220 std::unique_ptr<weld::Widget> m_xFlRadius;
221 std::unique_ptr<weld::MetricSpinButton> m_xMtrRadius;
222 std::unique_ptr<weld::Widget> m_xFlAngle;
223 std::unique_ptr<weld::MetricSpinButton> m_xMtrAngle;
224 std::unique_ptr<weld::Widget> m_aControlGroups[2];
225 std::unique_ptr<weld::Widget> m_aControlGroupX[2];
226 std::unique_ptr<weld::MetricSpinButton> m_aControlX[2];
227 std::unique_ptr<weld::Widget> m_aControlGroupY[2];
228 std::unique_ptr<weld::MetricSpinButton> m_aControlY[2];
230 public:
231 SvxSlantTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs);
232 virtual ~SvxSlantTabPage() override;
234 static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* );
235 static WhichRangesContainer GetRanges() { return pSlantRanges; }
237 virtual bool FillItemSet( SfxItemSet* ) override;
238 virtual void Reset( const SfxItemSet * ) override;
240 virtual void ActivatePage( const SfxItemSet& rSet ) override;
241 virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
243 void Construct();
244 void SetView( const SdrView* pSdrView ) { pView = pSdrView; }
248 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */