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: fmtanchr.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 ************************************************************************/
33 #ifndef _SWTYPES_HXX //autogen
34 #include <swtypes.hxx>
36 #ifndef _FORMAT_HXX //autogen
44 #define IVER_FMTANCHOR_LONGIDX ((USHORT)1)
46 //FlyAnchor, Anker des Freifliegenden Rahmen ----
48 class SwFmtAnchor
: public SfxPoolItem
50 SwPosition
*pCntntAnchor
; //0 Fuer Seitengebundene Rahmen.
51 //Index fuer Absatzgebundene Rahmen.
52 //Position fuer Zeichengebundene Rahmen
54 USHORT nPageNum
; //Seitennummer bei Seitengeb. Rahmen.
57 SwFmtAnchor( RndStdIds eRnd
= FLY_PAGE
, USHORT nPageNum
= 0 );
58 SwFmtAnchor( const SwFmtAnchor
&rCpy
);
62 SwFmtAnchor
&operator=( const SwFmtAnchor
& );
64 // "pure virtual Methoden" vom SfxPoolItem
65 virtual int operator==( const SfxPoolItem
& ) const;
66 virtual SfxPoolItem
* Clone( SfxItemPool
* pPool
= 0 ) const;
67 virtual SfxPoolItem
* Create(SvStream
&, USHORT nVer
) const;
68 virtual SvStream
& Store(SvStream
&, USHORT nIVer
) const;
69 virtual USHORT
GetVersion( USHORT nFFVer
) const;
71 virtual BOOL
QueryValue( ::com::sun::star::uno::Any
& rVal
, BYTE nMemberId
= 0 ) const;
72 virtual BOOL
PutValue( const ::com::sun::star::uno::Any
& rVal
, BYTE nMemberId
= 0 );
74 RndStdIds
GetAnchorId() const { return nAnchorId
; }
75 USHORT
GetPageNum() const { return nPageNum
; }
76 const SwPosition
*GetCntntAnchor() const { return pCntntAnchor
; }
78 void SetPageNum( USHORT nNew
) { nPageNum
= nNew
; }
80 void SetType( RndStdIds nRndId
) { nAnchorId
= nRndId
; }
81 void SetAnchor( const SwPosition
*pPos
);
84 #if !(defined(MACOSX) && ( __GNUC__ < 3 ))
85 // GrP moved to gcc_outl.cxx; revisit with gcc3
86 inline const SwFmtAnchor
&SwAttrSet::GetAnchor(BOOL bInP
) const
87 { return (const SwFmtAnchor
&)Get( RES_ANCHOR
,bInP
); }
89 inline const SwFmtAnchor
&SwFmt::GetAnchor(BOOL bInP
) const
90 { return aSet
.GetAnchor(bInP
); }
93 } //namespace binfilter