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: fmtsrnd.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 ************************************************************************/
34 #include <hintids.hxx>
36 #include <svtools/eitem.hxx>
38 // --> OD 2006-08-15 #i68520# - refactoring
39 // separate enumeration <SwSurround> in own header file
40 #include <fmtsrndenum.hxx>
44 //SwFmtSurround, wie soll sich der ---------------
45 // Dokumentinhalt unter dem Rahmen verhalten ---
47 class SW_DLLPUBLIC SwFmtSurround
: public SfxEnumItem
53 SwFmtSurround( SwSurround eNew
= SURROUND_PARALLEL
);
54 SwFmtSurround( const SwFmtSurround
& );
55 inline SwFmtSurround
&operator=( const SwFmtSurround
&rCpy
);
57 // "pure virtual Methoden" vom SfxPoolItem
58 virtual int operator==( const SfxPoolItem
& ) const;
59 virtual SfxPoolItem
* Clone( SfxItemPool
* pPool
= 0 ) const;
60 virtual USHORT
GetValueCount() const;
61 virtual SfxItemPresentation
GetPresentation( SfxItemPresentation ePres
,
62 SfxMapUnit eCoreMetric
,
63 SfxMapUnit ePresMetric
,
65 const IntlWrapper
* pIntl
= 0 ) const;
66 virtual BOOL
QueryValue( com::sun::star::uno::Any
& rVal
, BYTE nMemberId
= 0 ) const;
67 virtual BOOL
PutValue( const com::sun::star::uno::Any
& rVal
, BYTE nMemberId
= 0 );
70 SwSurround
GetSurround()const { return SwSurround( GetValue() ); }
71 BOOL
IsAnchorOnly() const { return bAnchorOnly
; }
72 BOOL
IsContour() const { return bContour
; }
73 BOOL
IsOutside() const { return bOutside
; }
74 void SetSurround ( SwSurround eNew
){ SfxEnumItem::SetValue( USHORT( eNew
) ); }
75 void SetAnchorOnly( BOOL bNew
) { bAnchorOnly
= bNew
; }
76 void SetContour( BOOL bNew
) { bContour
= bNew
; }
77 void SetOutside( BOOL bNew
) { bOutside
= bNew
; }
80 inline SwFmtSurround
&SwFmtSurround::operator=( const SwFmtSurround
&rCpy
)
82 bAnchorOnly
= rCpy
.IsAnchorOnly();
83 bContour
= rCpy
.IsContour();
84 bOutside
= rCpy
.IsOutside();
85 SfxEnumItem::SetValue( rCpy
.GetValue() );
89 inline const SwFmtSurround
&SwAttrSet::GetSurround(BOOL bInP
) const
90 { return (const SwFmtSurround
&)Get( RES_SURROUND
,bInP
); }
92 inline const SwFmtSurround
&SwFmt::GetSurround(BOOL bInP
) const
93 { return aSet
.GetSurround(bInP
); }