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: adjitem.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_ADJITEM_HXX
31 #define _SVX_ADJITEM_HXX
33 // include ---------------------------------------------------------------
35 #ifndef _SFXENUMITEM_HXX //autogen
36 #include <bf_svtools/eitem.hxx>
38 #ifndef _SVX_SVXENUM_HXX
39 #include <bf_svx/svxenum.hxx>
42 #ifndef _SVX_SVXIDS_HRC
43 #include <bf_svx/svxids.hrc>
46 #ifndef _EEITEM_HXX //autogen
47 #include <bf_svx/eeitem.hxx>
55 class SvXMLUnitConverter
;
56 // class SvxAdjustItem ---------------------------------------------------
60 Dieses Item beschreibt die Zeilenausrichtung.
62 #define ADJUST_LASTBLOCK_VERSION ((USHORT)0x0001)
64 class SvxAdjustItem
: public SfxEnumItemInterface
71 // nur aktiv, wenn bBlock
76 friend SvStream
& operator<<( SvStream
&, SvxAdjustItem
& ); //$ ostream
80 SvxAdjustItem( const SvxAdjust eAdjst
= SVX_ADJUST_LEFT
,
81 const USHORT nId
= ITEMID_ADJUST
);
83 // "pure virtual Methoden" vom SfxPoolItem
84 virtual int operator==( const SfxPoolItem
& ) const;
86 virtual sal_Bool
QueryValue( ::com::sun::star::uno::Any
& rVal
, BYTE nMemberId
= 0 ) const;
87 virtual sal_Bool
PutValue( const ::com::sun::star::uno::Any
& rVal
, BYTE nMemberId
= 0 );
89 virtual USHORT
GetValueCount() const;
90 virtual USHORT
GetEnumValue() const;
91 virtual void SetEnumValue( USHORT nNewVal
);
92 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const;
93 virtual SfxPoolItem
* Create(SvStream
&, USHORT
) const;
94 virtual SvStream
& Store(SvStream
&, USHORT nItemVersion
) const;
95 virtual USHORT
GetVersion( USHORT nFileVersion
) const;
97 inline void SetOneWord( const SvxAdjust eType
)
99 bOneBlock
= eType
== SVX_ADJUST_BLOCK
;
102 inline void SetLastBlock( const SvxAdjust eType
)
104 bLastBlock
= eType
== SVX_ADJUST_BLOCK
;
105 bLastCenter
= eType
== SVX_ADJUST_CENTER
;
108 inline void SetAdjust( const SvxAdjust eType
)
110 bLeft
= eType
== SVX_ADJUST_LEFT
;
111 bRight
= eType
== SVX_ADJUST_RIGHT
;
112 bCenter
= eType
== SVX_ADJUST_CENTER
;
113 bBlock
= eType
== SVX_ADJUST_BLOCK
;
116 inline SvxAdjust
GetLastBlock() const
118 SvxAdjust eRet
= SVX_ADJUST_LEFT
;
121 eRet
= SVX_ADJUST_BLOCK
;
122 else if( bLastCenter
)
123 eRet
= SVX_ADJUST_CENTER
;
127 inline SvxAdjust
GetOneWord() const
129 SvxAdjust eRet
= SVX_ADJUST_LEFT
;
131 if ( bBlock
&& bOneBlock
)
132 eRet
= SVX_ADJUST_BLOCK
;
136 inline SvxAdjust
GetAdjust() const
138 SvxAdjust eRet
= SVX_ADJUST_LEFT
;
141 eRet
= SVX_ADJUST_RIGHT
;
143 eRet
= SVX_ADJUST_CENTER
;
145 eRet
= SVX_ADJUST_BLOCK
;
150 }//end of namespace binfilter