update dev300-m57
[ooovba.git] / svx / inc / fwdtitem.hxx
blob7f5367a47ab319751cbbaff7f1502715eedcf324
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: fwdtitem.hxx,v $
10 * $Revision: 1.6 $
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_FWDTITEM_HXX
31 #define _SVX_FWDTITEM_HXX
33 // include ---------------------------------------------------------------
36 #include <svtools/poolitem.hxx>
39 // class SvxFontWidthItem -----------------------------------------------
42 /* [Beschreibung]
44 Dieses Item beschreibt die Font-Breite.
47 class SvxFontWidthItem : public SfxPoolItem
49 UINT16 nWidth; // 0 = default
50 USHORT nProp; // default 100%
51 public:
52 TYPEINFO();
54 SvxFontWidthItem( const USHORT nSz /*= 0*/,
55 const USHORT nPropWidth /*= 100*/,
56 const USHORT nId );
58 // "pure virtual Methoden" vom SfxPoolItem
59 virtual int operator==( const SfxPoolItem& ) const;
60 virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const;
61 virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 );
63 virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
64 SfxMapUnit eCoreMetric,
65 SfxMapUnit ePresMetric,
66 String &rText, const IntlWrapper * = 0 ) const;
68 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
69 virtual SfxPoolItem* Create(SvStream &, USHORT) const;
70 virtual SvStream& Store(SvStream &, USHORT nItemVersion) const;
71 virtual int ScaleMetrics( long nMult, long nDiv );
72 virtual int HasMetrics() const;
74 inline SvxFontWidthItem& operator=(const SvxFontWidthItem& rItem )
76 SetWidthValue( rItem.GetWidth() );
77 SetProp( rItem.GetProp() );
78 return *this;
81 void SetWidth( UINT16 nNewWidth, const USHORT nNewProp = 100 )
83 DBG_ASSERT( GetRefCount() == 0, "SetValue() with pooled item" );
84 nWidth = UINT16(( (UINT32)nNewWidth * nNewProp ) / 100 );
85 nProp = nNewProp;
88 UINT16 GetWidth() const { return nWidth; }
90 void SetWidthValue( UINT16 nNewWidth )
92 DBG_ASSERT( GetRefCount() == 0, "SetValue() with pooled item" );
93 nWidth = nNewWidth;
96 void SetProp( const USHORT nNewProp )
98 DBG_ASSERT( GetRefCount() == 0, "SetValue() with pooled item" );
99 nProp = nNewProp;
102 USHORT GetProp() const { return nProp; }
109 #endif