xref: /trunk/main/svx/inc/svx/grfcrop.hxx (revision 3334a7e6)
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_GRFCROP_HXX
24 #define _SVX_GRFCROP_HXX
25 
26 #include <svl/poolitem.hxx>
27 #include "svx/svxdllapi.h"
28 
29 
30 #define GRFCROP_VERSION_SWDEFAULT		0
31 #define GRFCROP_VERSION_MOVETOSVX 		1
32 
33 class SVX_DLLPUBLIC SvxGrfCrop : public SfxPoolItem
34 {
35 	sal_Int32	nLeft, nRight, nTop, nBottom;
36 public:
37     SvxGrfCrop( sal_uInt16  );
38 	SvxGrfCrop( sal_Int32 nLeft,	sal_Int32 nRight,
39 				sal_Int32 nTop,		sal_Int32 nBottom,
40                 sal_uInt16  );
41 	virtual ~SvxGrfCrop();
42 
43 	// "pure virtual Methoden" vom SfxPoolItem
44 	virtual int            		operator==( const SfxPoolItem& ) const;
45 	virtual SfxPoolItem*		Create(SvStream &, sal_uInt16 nVer) const;
46 	virtual SvStream&			Store(SvStream &, sal_uInt16 nIVer) const;
47 	virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
48 									SfxMapUnit eCoreMetric,
49 									SfxMapUnit ePresMetric,
50 									String &rText,
51                                     const IntlWrapper* pIntl = 0 ) const;
52 	virtual	sal_Bool        	 QueryValue( com::sun::star::uno::Any& rVal,
53 										sal_uInt8 nMemberId = 0 ) const;
54 	virtual	sal_Bool			 PutValue( const com::sun::star::uno::Any& rVal,
55 										sal_uInt8 nMemberId = 0 );
56 
SetLeft(sal_Int32 nVal)57 	void SetLeft( sal_Int32 nVal )		{ nLeft = nVal; }
SetRight(sal_Int32 nVal)58 	void SetRight( sal_Int32 nVal )		{ nRight = nVal; }
SetTop(sal_Int32 nVal)59 	void SetTop( sal_Int32 nVal )		{ nTop = nVal; }
SetBottom(sal_Int32 nVal)60 	void SetBottom( sal_Int32 nVal )	{ nBottom = nVal; }
61 
GetLeft() const62 	sal_Int32 GetLeft() const			{ return nLeft; }
GetRight() const63 	sal_Int32 GetRight() const 			{ return nRight; }
GetTop() const64 	sal_Int32 GetTop() const			{ return nTop; }
GetBottom() const65 	sal_Int32 GetBottom() const			{ return nBottom; }
66 
operator =(const SvxGrfCrop & rCrop)67 	inline SvxGrfCrop& operator=( const SvxGrfCrop& rCrop )
68 		{
69 			nLeft = rCrop.GetLeft(); 		nTop = rCrop.GetTop();
70 			nRight = rCrop.GetRight();		nBottom = rCrop.GetBottom();
71 			return *this;
72 		}
73 };
74 
75 
76 #endif  // _GRFATR_HXX
77