sync master with lastest vba changes
[ooovba.git] / binfilter / inc / bf_svx / adjitem.hxx
blob2f81ea9332b7e6241b47863f035a109ac9df0db1
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: adjitem.hxx,v $
10 * $Revision: 1.8 $
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>
37 #endif
38 #ifndef _SVX_SVXENUM_HXX
39 #include <bf_svx/svxenum.hxx>
40 #endif
42 #ifndef _SVX_SVXIDS_HRC
43 #include <bf_svx/svxids.hrc>
44 #endif
46 #ifndef _EEITEM_HXX //autogen
47 #include <bf_svx/eeitem.hxx>
48 #endif
50 namespace rtl
52 class OUString;
54 namespace binfilter {
55 class SvXMLUnitConverter;
56 // class SvxAdjustItem ---------------------------------------------------
59 [Beschreibung]
60 Dieses Item beschreibt die Zeilenausrichtung.
62 #define ADJUST_LASTBLOCK_VERSION ((USHORT)0x0001)
64 class SvxAdjustItem : public SfxEnumItemInterface
66 BOOL bLeft : 1;
67 BOOL bRight : 1;
68 BOOL bCenter : 1;
69 BOOL bBlock : 1;
71 // nur aktiv, wenn bBlock
72 BOOL bOneBlock : 1;
73 BOOL bLastCenter : 1;
74 BOOL bLastBlock : 1;
76 friend SvStream& operator<<( SvStream&, SvxAdjustItem& ); //$ ostream
77 public:
78 TYPEINFO();
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;
120 if ( bLastBlock )
121 eRet = SVX_ADJUST_BLOCK;
122 else if( bLastCenter )
123 eRet = SVX_ADJUST_CENTER;
124 return eRet;
127 inline SvxAdjust GetOneWord() const
129 SvxAdjust eRet = SVX_ADJUST_LEFT;
131 if ( bBlock && bOneBlock )
132 eRet = SVX_ADJUST_BLOCK;
133 return eRet;
136 inline SvxAdjust GetAdjust() const
138 SvxAdjust eRet = SVX_ADJUST_LEFT;
140 if ( bRight )
141 eRet = SVX_ADJUST_RIGHT;
142 else if ( bCenter )
143 eRet = SVX_ADJUST_CENTER;
144 else if ( bBlock )
145 eRet = SVX_ADJUST_BLOCK;
146 return eRet;
150 }//end of namespace binfilter
151 #endif