LibreOffice Module cui (master) 1
transfrm.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19#pragma once
20
21#include <svx/dlgctrl.hxx>
22#include <svx/dialcontrol.hxx>
23#include <svx/anchorid.hxx>
25
26// predefines
27class SdrView;
28
29/*************************************************************************
30|*
31|* Transform-Tab-Dialog
32|*
33\************************************************************************/
34
37{
38private:
39 const SdrView* pView;
40
43
44 virtual void PageCreated(const OString& rId, SfxTabPage &rPage) override;
45
46public:
47 SvxTransformTabDialog(weld::Window* pParent, const SfxItemSet* pAttr,
48 const SdrView* pView,
49 SvxAnchorIds nAnchorTypes);
50
51 //link for the Writer to validate positions
53};
54
55/*************************************************************************
56|*
57|* position and size tab page
58|*
59\************************************************************************/
60
62{
64
65private:
67
69
70 // #i75273#
74
84
85 // from size
86 // #i75273#
87 double mfOldWidth;
90
93
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;
99
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;
108
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;
113
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;
118
119 DECL_LINK(ChangePosProtectHdl, weld::Toggleable&, void);
120 DECL_LINK(ChangeSizeProtectHdl, weld::Toggleable&, void);
121
122 void SetMinMaxPosition();
123 void GetTopLeftPosition(double& rfX, double& rfY, const basegfx::B2DRange& rRange);
124
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 );
129
130public:
131 SvxPositionSizeTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs);
132 virtual ~SvxPositionSizeTabPage() override;
133
134 static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* );
136
137 virtual bool FillItemSet( SfxItemSet* ) override;
138 virtual void Reset( const SfxItemSet * ) override;
139
140 virtual void ActivatePage( const SfxItemSet& rSet ) override;
141 virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
142
143 virtual void PointChanged(weld::DrawingArea* pWindow, RectPoint eRP) override;
144
145 void Construct();
146 void SetView( const SdrView* pSdrView ) { mpView = pSdrView; }
147
148 virtual void FillUserData() override;
149
150 void DisableResize();
151 void DisableProtect();
152
153 void UpdateControlStates();
154};
155
156/*************************************************************************
157|*
158|* rotation angle tab page
159|*
160\************************************************************************/
162{
164
165private:
167
168 // #i75273#
171
174
176
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;
185
186public:
187 SvxAngleTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs);
188 virtual ~SvxAngleTabPage() override;
189
190 static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* );
192
193 virtual bool FillItemSet( SfxItemSet* ) override;
194 virtual void Reset( const SfxItemSet * ) override;
195
196 virtual void ActivatePage( const SfxItemSet& rSet ) override;
197 virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
198
199 virtual void PointChanged(weld::DrawingArea* pWindow, RectPoint eRP) override;
200
201 void Construct();
202 void SetView( const SdrView* pSdrView ) { pView = pSdrView; }
203};
204
205/*************************************************************************
206|*
207|* slant/corner radius tab page
208|*
209\************************************************************************/
211{
213
214private:
216
219
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];
229
230public:
231 SvxSlantTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs);
232 virtual ~SvxSlantTabPage() override;
233
234 static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* );
236
237 virtual bool FillItemSet( SfxItemSet* ) override;
238 virtual void Reset( const SfxItemSet * ) override;
239
240 virtual void ActivatePage( const SfxItemSet& rSet ) override;
241 virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
242
243 void Construct();
244 void SetView( const SdrView* pSdrView ) { pView = pSdrView; }
245};
246
247
248/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SvxAnchorIds
const SfxItemSet * pSet
basegfx::B2DPoint maAnchor
Definition: transfrm.hxx:170
static const WhichRangesContainer pAngleRanges
Definition: transfrm.hxx:163
std::unique_ptr< weld::MetricSpinButton > m_xMtrPosX
Definition: transfrm.hxx:178
std::unique_ptr< weld::Widget > m_xFlPosition
Definition: transfrm.hxx:177
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: transfrm.cxx:299
void Construct()
Definition: transfrm.cxx:176
std::unique_ptr< weld::MetricSpinButton > m_xMtrPosY
Definition: transfrm.hxx:179
std::unique_ptr< weld::MetricSpinButton > m_xNfAngle
Definition: transfrm.hxx:182
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *)
Definition: transfrm.cxx:285
void SetView(const SdrView *pSdrView)
Definition: transfrm.hxx:202
virtual void Reset(const SfxItemSet *) override
Definition: transfrm.cxx:245
std::unique_ptr< weld::CustomWeld > m_xCtlAngleWin
Definition: transfrm.hxx:184
SvxAngleTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rInAttrs)
Definition: transfrm.cxx:150
const SdrView * pView
Definition: transfrm.hxx:166
std::unique_ptr< svx::DialControl > m_xCtlAngle
Definition: transfrm.hxx:183
basegfx::B2DRange maRange
Definition: transfrm.hxx:169
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: transfrm.cxx:290
SvxRectCtl m_aCtlRect
Definition: transfrm.hxx:175
std::unique_ptr< weld::Widget > m_xFlAngle
Definition: transfrm.hxx:181
MapUnit ePoolUnit
Definition: transfrm.hxx:172
virtual void PointChanged(weld::DrawingArea *pWindow, RectPoint eRP) override
Definition: transfrm.cxx:309
virtual ~SvxAngleTabPage() override
Definition: transfrm.cxx:172
std::unique_ptr< weld::CustomWeld > m_xCtlRect
Definition: transfrm.hxx:180
FieldUnit eDlgUnit
Definition: transfrm.hxx:173
static WhichRangesContainer GetRanges()
Definition: transfrm.hxx:191
virtual bool FillItemSet(SfxItemSet *) override
Definition: transfrm.cxx:224
void GetTopLeftPosition(double &rfX, double &rfY, const basegfx::B2DRange &rRange)
Definition: transfrm.cxx:1358
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: transfrm.cxx:1117
SvxPositionSizeTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rInAttrs)
Definition: transfrm.cxx:718
std::unique_ptr< weld::MetricSpinButton > m_xMtrPosY
Definition: transfrm.hxx:97
basegfx::B2DRange maRange
Definition: transfrm.hxx:71
std::unique_ptr< weld::Label > m_xFtHeight
Definition: transfrm.hxx:104
std::unique_ptr< weld::CheckButton > m_xTsbSizeProtect
Definition: transfrm.hxx:112
std::unique_ptr< weld::CheckButton > m_xCbxScale
Definition: transfrm.hxx:106
virtual void PointChanged(weld::DrawingArea *pWindow, RectPoint eRP) override
Definition: transfrm.cxx:1413
void SetView(const SdrView *pSdrView)
Definition: transfrm.hxx:146
std::unique_ptr< weld::MetricSpinButton > m_xMtrPosX
Definition: transfrm.hxx:96
std::unique_ptr< weld::CheckButton > m_xTsbAutoGrowWidth
Definition: transfrm.hxx:116
std::unique_ptr< weld::Widget > m_xFlSize
Definition: transfrm.hxx:101
virtual void FillUserData() override
Definition: transfrm.cxx:1555
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: transfrm.cxx:1103
DECL_LINK(ChangeHeightHdl, weld::MetricSpinButton &, void)
std::unique_ptr< weld::CustomWeld > m_xCtlPos
Definition: transfrm.hxx:98
DECL_LINK(ChangePosProtectHdl, weld::Toggleable &, void)
basegfx::B2DRange maWorkRange
Definition: transfrm.hxx:72
std::unique_ptr< weld::CustomWeld > m_xCtlSize
Definition: transfrm.hxx:107
virtual ~SvxPositionSizeTabPage() override
Definition: transfrm.cxx:775
TriState mnProtectSizeState
Definition: transfrm.hxx:77
static WhichRangesContainer GetRanges()
Definition: transfrm.hxx:135
static const WhichRangesContainer pPosSizeRanges
Definition: transfrm.hxx:63
DECL_LINK(ClickAutoHdl, weld::Toggleable &, void)
SvxRectCtl m_aCtlPos
Definition: transfrm.hxx:91
virtual bool FillItemSet(SfxItemSet *) override
Definition: transfrm.cxx:876
const SfxItemSet & mrOutAttrs
Definition: transfrm.hxx:66
std::unique_ptr< weld::MetricSpinButton > m_xMtrHeight
Definition: transfrm.hxx:105
std::unique_ptr< weld::Widget > m_xFlAdjust
Definition: transfrm.hxx:115
virtual void Reset(const SfxItemSet *) override
Definition: transfrm.cxx:999
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *)
Definition: transfrm.cxx:1098
DECL_LINK(ChangeWidthHdl, weld::MetricSpinButton &, void)
std::unique_ptr< weld::Widget > m_xFlProtect
Definition: transfrm.hxx:110
std::unique_ptr< weld::Label > m_xFtWidth
Definition: transfrm.hxx:102
std::unique_ptr< weld::Widget > m_xFlPosition
Definition: transfrm.hxx:95
DECL_LINK(ClickSizeProtectHdl, weld::Toggleable &, void)
const SdrView * mpView
Definition: transfrm.hxx:68
std::unique_ptr< weld::MetricSpinButton > m_xMtrWidth
Definition: transfrm.hxx:103
SvxRectCtl m_aCtlSize
Definition: transfrm.hxx:92
std::unique_ptr< weld::CheckButton > m_xTsbAutoGrowHeight
Definition: transfrm.hxx:117
DECL_LINK(ChangeSizeProtectHdl, weld::Toggleable &, void)
basegfx::B2DPoint maAnchor
Definition: transfrm.hxx:73
std::unique_ptr< weld::CheckButton > m_xTsbPosProtect
Definition: transfrm.hxx:111
const SdrView * pView
Definition: transfrm.hxx:215
void SetView(const SdrView *pSdrView)
Definition: transfrm.hxx:244
std::unique_ptr< weld::MetricSpinButton > m_xMtrRadius
Definition: transfrm.hxx:221
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *)
Definition: transfrm.cxx:684
virtual bool FillItemSet(SfxItemSet *) override
Definition: transfrm.cxx:427
std::unique_ptr< weld::Widget > m_aControlGroupY[2]
Definition: transfrm.hxx:227
void Construct()
Definition: transfrm.cxx:409
std::unique_ptr< weld::MetricSpinButton > m_aControlX[2]
Definition: transfrm.hxx:226
std::unique_ptr< weld::Widget > m_aControlGroupX[2]
Definition: transfrm.hxx:225
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: transfrm.cxx:702
std::unique_ptr< weld::Widget > m_aControlGroups[2]
Definition: transfrm.hxx:224
static const WhichRangesContainer pSlantRanges
Definition: transfrm.hxx:212
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: transfrm.cxx:689
std::unique_ptr< weld::MetricSpinButton > m_xMtrAngle
Definition: transfrm.hxx:223
static WhichRangesContainer GetRanges()
Definition: transfrm.hxx:235
virtual void Reset(const SfxItemSet *) override
Definition: transfrm.cxx:547
SvxSlantTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rInAttrs)
Definition: transfrm.cxx:378
MapUnit ePoolUnit
Definition: transfrm.hxx:217
FieldUnit eDlgUnit
Definition: transfrm.hxx:218
std::unique_ptr< weld::MetricSpinButton > m_aControlY[2]
Definition: transfrm.hxx:228
std::unique_ptr< weld::Widget > m_xFlAngle
Definition: transfrm.hxx:222
std::unique_ptr< weld::Widget > m_xFlRadius
Definition: transfrm.hxx:220
virtual ~SvxSlantTabPage() override
Definition: transfrm.cxx:405
Link< SvxSwFrameValidation &, void > aValidateLink
Definition: transfrm.hxx:42
SvxTransformTabDialog(weld::Window *pParent, const SfxItemSet *pAttr, const SdrView *pView, SvxAnchorIds nAnchorTypes)
Definition: transfrm.cxx:71
virtual void PageCreated(const OString &rId, SfxTabPage &rPage) override
Definition: transfrm.cxx:96
void SetValidateFramePosLink(const Link< SvxSwFrameValidation &, void > &rLink)
Definition: transfrm.cxx:139
const SdrView * pView
Definition: transfrm.hxx:39
SvxAnchorIds nAnchorCtrls
Definition: transfrm.hxx:41
FieldUnit
TriState
MapUnit
RectPoint
DeactivateRC