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: ulspitem.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_ULSPITEM_HXX
31 #define _SVX_ULSPITEM_HXX
33 // include ---------------------------------------------------------------
35 #ifndef _SFXPOOLITEM_HXX //autogen
36 #include <bf_svtools/poolitem.hxx>
38 #ifndef _SVX_SVXIDS_HRC
39 #include <bf_svx/svxids.hrc>
48 // class SvxULSpaceItem --------------------------------------------------
52 Dieses Item beschreibt den oberen und unteren Rand einer Seite oder Absatz.
55 #define ULSPACE_16_VERSION ((USHORT)0x0001)
57 class SvxULSpaceItem
: public SfxPoolItem
59 USHORT nUpper
; //Oberer Rand
60 USHORT nLower
; //Unterer Rand
61 USHORT nPropUpper
, nPropLower
; // relativ oder absolut (=100%)
65 SvxULSpaceItem( const USHORT nId
= ITEMID_ULSPACE
);
66 SvxULSpaceItem( const USHORT nUp
, const USHORT nLow
,
67 const USHORT nId
= ITEMID_ULSPACE
);
68 inline SvxULSpaceItem
& operator=( const SvxULSpaceItem
&rCpy
);
70 // "pure virtual Methoden" vom SfxPoolItem
71 virtual int operator==( const SfxPoolItem
& ) const;
73 virtual sal_Bool
QueryValue( ::com::sun::star::uno::Any
& rVal
, BYTE nMemberId
= 0 ) const;
74 virtual sal_Bool
PutValue( const ::com::sun::star::uno::Any
& rVal
, BYTE nMemberId
= 0 );
77 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const;
78 virtual SfxPoolItem
* Create(SvStream
&, USHORT
) const;
79 virtual SvStream
& Store(SvStream
&, USHORT nItemVersion
) const;
80 virtual USHORT
GetVersion( USHORT nFileVersion
) const;
82 inline void SetUpper( const USHORT nU
, const USHORT nProp
= 100 );
83 inline void SetLower( const USHORT nL
, const USHORT nProp
= 100 );
85 void SetUpperValue( const USHORT nU
) { nUpper
= nU
; }
86 void SetLowerValue( const USHORT nL
) { nLower
= nL
; }
87 void SetPropUpper( const USHORT nU
) { nPropUpper
= nU
; }
88 void SetPropLower( const USHORT nL
) { nPropLower
= nL
; }
90 USHORT
GetUpper() const { return nUpper
; }
91 USHORT
GetLower() const { return nLower
; }
92 USHORT
GetPropUpper() const { return nPropUpper
; }
93 USHORT
GetPropLower() const { return nPropLower
; }
96 inline SvxULSpaceItem
&SvxULSpaceItem::operator=( const SvxULSpaceItem
&rCpy
)
98 nUpper
= rCpy
.GetUpper();
99 nLower
= rCpy
.GetLower();
100 nPropUpper
= rCpy
.GetPropUpper();
101 nPropLower
= rCpy
.GetPropLower();
105 inline void SvxULSpaceItem::SetUpper( const USHORT nU
, const USHORT nProp
)
107 nUpper
= USHORT((ULONG(nU
) * nProp
) / 100); nPropUpper
= nProp
;
109 inline void SvxULSpaceItem::SetLower( const USHORT nL
, const USHORT nProp
)
111 nLower
= USHORT((ULONG(nL
) * nProp
) / 100); nPropLower
= nProp
;
114 }//end of namespace binfilter