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