1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: charrotateitem.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _SVX_CHARROTATEITEM_HXX
31 #define _SVX_CHARROTATEITEM_HXX
33 // include ---------------------------------------------------------------
35 #ifndef _SFXINTITEM_HXX
36 #include <bf_svtools/intitem.hxx>
38 #ifndef _SVX_SVXIDS_HRC
39 #include <bf_svx/svxids.hrc>
43 // class SvxCharRotateItem ----------------------------------------------
47 This item defines a character rotation value (0,1 degree). Currently
48 character can only be rotated 90,0 and 270,0 degrees.
49 The flag FitToLine defines only a UI-Information -
50 if true it must also create a SvxCharScaleItem.
54 class SvxCharRotateItem
: public SfxUInt16Item
60 SvxCharRotateItem( sal_uInt16 nValue
= 0,
61 sal_Bool bFitIntoLine
= sal_False
,
62 const sal_uInt16 nId
= ITEMID_CHARROTATE
);
64 /*NBFF*/ virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const;
65 /*NBFF*/ virtual SfxPoolItem
* Create(SvStream
&, USHORT
) const;
66 /*NBFF*/ virtual SvStream
& Store(SvStream
& rStrm
, USHORT nIVer
) const;
67 virtual USHORT
GetVersion( USHORT nFileVersion
) const;
69 /*NBFF*/ virtual SfxItemPresentation
GetPresentation( SfxItemPresentation ePres
,
70 /*NBFF*/ SfxMapUnit eCoreMetric
,
71 /*NBFF*/ SfxMapUnit ePresMetric
,
72 /*NBFF*/ String
&rText
,
73 /*NBFF*/ const ::IntlWrapper
* = 0 ) const;
75 /*NBFF*/ virtual sal_Bool
PutValue( const ::com::sun::star::uno::Any
& rVal
,
76 /*NBFF*/ BYTE nMemberId
);
77 /*NBFF*/ virtual sal_Bool
QueryValue( ::com::sun::star::uno::Any
& rVal
,
78 /*NBFF*/ BYTE nMemberId
) const;
80 /*NBFF*/ inline SvxCharRotateItem
& operator=( const SvxCharRotateItem
& rItem
)
82 /*NBFF*/ SetValue( rItem
.GetValue() );
83 /*NBFF*/ SetFitToLine( rItem
.IsFitToLine() );
84 /*NBFF*/ return *this;
87 /*NBFF*/ virtual int operator==( const SfxPoolItem
& ) const;
89 // our currently only degree values
90 /*NBFF*/ void SetTopToBotton() { SetValue( 2700 ); }
91 /*NBFF*/ void SetBottomToTop() { SetValue( 900 ); }
92 /*NBFF*/ sal_Bool
IsTopToBotton() const { return 2700 == GetValue(); }
93 /*NBFF*/ sal_Bool
IsBottomToTop() const { return 900 == GetValue(); }
95 /*NBFF*/ sal_Bool
IsFitToLine() const { return bFitToLine
; }
96 /*NBFF*/ void SetFitToLine( sal_Bool b
) { bFitToLine
= b
; }
99 }//end of namespace binfilter