xref: /trunk/main/cui/source/inc/transfrm.hxx (revision c4eee24d)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef _SVX_TRANSFRM_HXX
24 #define _SVX_TRANSFRM_HXX
25 
26 // include ---------------------------------------------------------------
27 
28 #include <svx/dlgctrl.hxx>
29 
30 #ifndef _FIXED_HXX //autogen
31 #include <vcl/fixed.hxx>
32 #endif
33 
34 // #i75273#
35 #include <basegfx/range/b2drange.hxx>
36 
37 // predefines
38 class SdrView;
39 
40 /*************************************************************************
41 |*
42 |* Transform-Tab-Dialog
43 |*
44 \************************************************************************/
45 
46 /** put this into the nAnchorTypes parameter of the SvxTransformTabDialog c'tor
47 	to disable the size controls */
48 const sal_uInt16 SVX_OBJ_NORESIZE = 0x0100;
49 
50 /** put this into the nAnchorTypes parameter of the SvxTransformTabDialog c'tor
51 	to disable the protect controls */
52 const sal_uInt16 SVX_OBJ_NOPROTECT = 0x0200;
53 
54 class SvxTransformTabDialog : public SfxTabDialog
55 {
56 private:
57 	const SdrView*		pView;
58 
59 	sal_uInt16				nAnchorCtrls;
60     Link                aValidateLink;
61 
62 	virtual void		PageCreated( sal_uInt16 nId, SfxTabPage &rPage );
63 
64 public:
65 
66 			SvxTransformTabDialog( Window* pParent, const SfxItemSet* pAttr,
67 							const SdrView* pView,
68 							sal_uInt16 nAnchorTypes = 0);
69 			~SvxTransformTabDialog();
70 
71             //link for the Writer to validate positions
72             void SetValidateFramePosLink( const Link& rLink );
73 };
74 
75 /*************************************************************************
76 |*
77 |* position and size tab page
78 |*
79 \************************************************************************/
80 
81 class SvxPositionSizeTabPage : public SvxTabPage
82 {
83 	using TabPage::ActivatePage;
84 	using TabPage::DeactivatePage;
85 
86 private:
87 	// position
88 	FixedLine			maFlPosition;
89 	FixedText			maFtPosX;
90 	MetricField			maMtrPosX;
91 	FixedText			maFtPosY;
92 	MetricField			maMtrPosY;
93 	FixedText			maFtPosReference;
94 	SvxRectCtl			maCtlPos;
95 
96 	// size
97 	FixedLine			maFlSize;
98 	FixedText			maFtWidth;
99 	MetricField			maMtrWidth;
100 	FixedText			maFtHeight;
101 	MetricField			maMtrHeight;
102 	CheckBox   			maCbxScale;
103 	FixedText			maFtSizeReference;
104 	SvxRectCtl			maCtlSize;
105 
106 	// protect
107 	FixedLine			maFlProtect;
108 	TriStateBox			maTsbPosProtect;
109 	TriStateBox			maTsbSizeProtect;
110 
111 	// adjust
112 	FixedLine			maFlAdjust;
113 	TriStateBox         maTsbAutoGrowWidth;
114 	TriStateBox         maTsbAutoGrowHeight;
115 
116 	FixedLine			maFlDivider;
117 
118 private:
119 	const SfxItemSet&	mrOutAttrs;
120 
121 	const SdrView*		mpView;
122 
123 	// #i75273#
124 	basegfx::B2DRange	maRange;
125 	basegfx::B2DRange	maWorkRange;
126 	basegfx::B2DPoint	maAnchor;
127 
128 	SfxMapUnit			mePoolUnit;
129 	FieldUnit			meDlgUnit;
130 	MapUnit				meMapUnit;
131     TriState			mnProtectSizeState;
132 	bool				mbPageDisabled;
133 	bool				mbProtectDisabled;
134 	bool				mbSizeDisabled;
135 	bool				mbAdjustDisabled;
136 
137 	// frome size
138 	// #i75273#
139 	double				mfOldWidth;
140 	double				mfOldHeight;
141 	RECT_POINT			meRP;
142 
143 	//------------------------------------
144 #if _SOLAR__PRIVATE
145 	DECL_LINK( ChangePosProtectHdl, void * );
146 	DECL_LINK( ChangeSizeProtectHdl, void * );
147 	DECL_LINK( ChangePosXHdl, void * );
148 	DECL_LINK( ChangePosYHdl, void * );
149 //  DECL_LINK( SetAnchorHdl, ListBox * );
150 //  DECL_LINK( SetOrientHdl, ListBox * );
151 
152 	void SetMinMaxPosition();
153 	void GetTopLeftPosition(double& rfX, double& rfY, const basegfx::B2DRange& rRange);
154 #endif
155 
156 #if _SOLAR__PRIVATE
157 	DECL_LINK( ChangeWidthHdl, void * );
158 	DECL_LINK( ChangeHeightHdl, void * );
159 	DECL_LINK( ClickSizeProtectHdl, void * );
160 	DECL_LINK( ClickAutoHdl, void * );
161 
162 	void		SetMaxSize( Rectangle aRect );
163 	Rectangle	GetRect();
164 #endif
165 
166 public:
167 	SvxPositionSizeTabPage( Window* pParent, const SfxItemSet& rInAttrs  );
168 
169 	static SfxTabPage* Create( Window*, const SfxItemSet& );
170 	static sal_uInt16*	   GetRanges();
171 
172 	virtual sal_Bool FillItemSet( SfxItemSet& );
173 	virtual void Reset( const SfxItemSet & );
174 
175 	virtual void ActivatePage( const SfxItemSet& rSet );
176 	virtual int  DeactivatePage( SfxItemSet* pSet );
177 
178 	virtual void PointChanged( Window* pWindow, RECT_POINT eRP );
179 
180 	void 		 Construct();
181 	void		 SetView( const SdrView* pSdrView ) { mpView = pSdrView; }
182 
183 //  void         ShowAnchorCtrls(sal_uInt16 nAnchorCtrls); // Writer-spezifische Controls anzeigen
184 	virtual void FillUserData();
185 
186 	void		DisableResize();
187 	void		DisableProtect();
188 
189     void 		UpdateControlStates();
190 };
191 
192 /*************************************************************************
193 |*
194 |* Drehwinkel-Tab-Page
195 |*
196 \************************************************************************/
197 class SvxAngleTabPage : public SvxTabPage
198 {
199 	using TabPage::ActivatePage;
200 	using TabPage::DeactivatePage;
201 
202 private:
203 	FixedLine			aFlPosition;
204 	FixedText			aFtPosX;
205 	MetricField			aMtrPosX;
206 	FixedText			aFtPosY;
207 	MetricField			aMtrPosY;
208 	FixedText			aFtPosPresets;
209 	SvxRectCtl			aCtlRect;
210 
211 	FixedLine			aFlAngle;
212 	FixedText			aFtAngle;
213 	MetricField			aMtrAngle;
214 	FixedText			aFtAnglePresets;
215 	SvxRectCtl			aCtlAngle;
216 
217 	const SfxItemSet&	rOutAttrs;
218 	const SdrView*		pView;
219 
220 	// #i75273#
221 	basegfx::B2DRange	maRange;
222 	basegfx::B2DPoint	maAnchor;
223 
224 	SfxMapUnit			ePoolUnit;
225 	FieldUnit			eDlgUnit;
226 	MapUnit				eMapUnit;
227 	//------------------------------------
228 #if _SOLAR__PRIVATE
229 	DECL_LINK( ModifiedHdl, void * );
230 #endif
231 public:
232 		 SvxAngleTabPage( Window* pParent, const SfxItemSet& rInAttrs  );
233 
234 	static SfxTabPage* Create( Window*, const SfxItemSet& );
235 	static sal_uInt16*	   GetRanges();
236 
237 	virtual sal_Bool FillItemSet( SfxItemSet& );
238 	virtual void Reset( const SfxItemSet & );
239 
240 	virtual void ActivatePage( const SfxItemSet& rSet );
241 	virtual int  DeactivatePage( SfxItemSet* pSet );
242 
243 	virtual void PointChanged( Window* pWindow, RECT_POINT eRP );
244 
245 	void 		 Construct();
246 	void		 SetView( const SdrView* pSdrView ) { pView = pSdrView; }
247 };
248 
249 /*************************************************************************
250 |*
251 |* Schraegstellen/Eckenradius-Tab-Page
252 |*
253 \************************************************************************/
254 class SvxSlantTabPage : public SvxTabPage
255 {
256 	using TabPage::ActivatePage;
257 	using TabPage::DeactivatePage;
258 
259 private:
260 	FixedLine			aFlRadius;
261 	FixedText			aFtRadius;
262 	MetricField			aMtrRadius;
263 	//TriStateBox			aTsbVertical;
264 	FixedLine			aFlAngle;
265 	FixedText			aFtAngle;
266 	MetricField			aMtrAngle;
267 	//SvxRectCtl			aCtlAngle;
268 
269 	const SfxItemSet&	rOutAttrs;
270 
271 	const SdrView*		pView;
272 
273 	// #i75273#
274 	basegfx::B2DRange	maRange;
275 
276 	SfxMapUnit			ePoolUnit;
277 	FieldUnit			eDlgUnit;
278 	MapUnit				eMapUnit;
279 	//------------------------------------
280 public:
281 		 SvxSlantTabPage( Window* pParent, const SfxItemSet& rInAttrs  );
282 
283 	static SfxTabPage* Create( Window*, const SfxItemSet& );
284 	static sal_uInt16*	   GetRanges();
285 
286 	virtual sal_Bool FillItemSet( SfxItemSet& );
287 	virtual void Reset( const SfxItemSet & );
288 
289 	virtual void ActivatePage( const SfxItemSet& rSet );
290 	virtual int  DeactivatePage( SfxItemSet* pSet );
291 
292 	virtual void PointChanged( Window* pWindow, RECT_POINT eRP );
293 
294 	void 		 Construct();
295 	void		 SetView( const SdrView* pSdrView ) { pView = pSdrView; }
296 };
297 
298 
299 
300 #endif // _SVX_TRANSFRM_HXX
301 
302