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_CHARROTATEITEM_HXX
24 #define _SVX_CHARROTATEITEM_HXX
25 
26 // include ---------------------------------------------------------------
27 
28 #include <svl/intitem.hxx>
29 #include <editeng/editengdllapi.h>
30 
31 // class SvxCharRotateItem ----------------------------------------------
32 
33 /* [Description]
34 
35 	This item defines a character rotation value (0,1 degree). Currently
36 	character can only be rotated 90,0 and 270,0 degrees.
37 	The flag FitToLine defines only a UI-Information -
38 	if true it must also create a SvxCharScaleItem.
39 
40 */
41 
42 class EDITENG_DLLPUBLIC SvxCharRotateItem : public SfxUInt16Item
43 {
44 	sal_Bool bFitToLine;
45 public:
46 	TYPEINFO();
47 
48     SvxCharRotateItem( sal_uInt16 nValue /*= 0*/,
49                        sal_Bool bFitIntoLine /*= sal_False*/,
50                        const sal_uInt16 nId );
51 
52 	virtual SfxPoolItem*	Clone( SfxItemPool *pPool = 0 ) const;
53 	virtual SfxPoolItem*	Create(SvStream &, sal_uInt16) const;
54 	virtual SvStream& 		Store(SvStream & rStrm, sal_uInt16 nIVer) const;
55 	virtual sal_uInt16			GetVersion( sal_uInt16 nFileVersion ) const;
56 
57 	virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
58 									SfxMapUnit eCoreMetric,
59 									SfxMapUnit ePresMetric,
60 									String &rText,
61                                     const IntlWrapper * = 0 ) const;
62 
63 	virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal,
64 									sal_uInt8 nMemberId );
65 	virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal,
66 								sal_uInt8 nMemberId ) const;
67 
operator =(const SvxCharRotateItem & rItem)68 	inline SvxCharRotateItem& operator=( const SvxCharRotateItem& rItem )
69 	{
70 		SetValue( rItem.GetValue() );
71 		SetFitToLine( rItem.IsFitToLine() );
72 		return *this;
73 	}
74 
75 	virtual int 			 operator==( const SfxPoolItem& ) const;
76 
77 	// our currently only degree values
SetTopToBotton()78 	void SetTopToBotton() 					{ SetValue( 2700 ); }
SetBottomToTop()79 	void SetBottomToTop() 					{ SetValue(  900 ); }
IsTopToBotton() const80 	sal_Bool IsTopToBotton() const			{ return 2700 == GetValue(); }
IsBottomToTop() const81 	sal_Bool IsBottomToTop() const			{ return  900 == GetValue(); }
82 
IsFitToLine() const83 	sal_Bool IsFitToLine() const 			{ return bFitToLine; }
SetFitToLine(sal_Bool b)84 	void SetFitToLine( sal_Bool b )			{ bFitToLine = b; }
85 };
86 
87 #endif
88 
89