Update ooo320-m1
[ooovba.git] / sw / inc / fmtanchr.hxx
blob82841835db77d9998c5287fc6aa8d98508e209fb
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: fmtanchr.hxx,v $
10 * $Revision: 1.11 $
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 _FMTANCHR_HXX
31 #define _FMTANCHR_HXX
33 #include "swdllapi.h"
34 #include <hintids.hxx>
35 #include <swtypes.hxx>
36 #include <format.hxx>
37 #include <svtools/poolitem.hxx>
39 struct SwPosition;
40 class IntlWrapper;
41 #define IVER_FMTANCHOR_LONGIDX ((USHORT)1)
43 //FlyAnchor, Anker des Freifliegenden Rahmen ----
45 class SW_DLLPUBLIC SwFmtAnchor: public SfxPoolItem
47 SwPosition *pCntntAnchor; //0 Fuer Seitengebundene Rahmen.
48 //Index fuer Absatzgebundene Rahmen.
49 //Position fuer Zeichengebundene Rahmen
50 RndStdIds nAnchorId;
51 USHORT nPageNum; //Seitennummer bei Seitengeb. Rahmen.
53 // OD 2004-05-05 #i28701# - getting anchor positions ordered
54 sal_uInt32 mnOrder;
55 static sal_uInt32 mnOrderCounter;
57 public:
58 SwFmtAnchor( RndStdIds eRnd = FLY_PAGE, USHORT nPageNum = 0 );
59 SwFmtAnchor( const SwFmtAnchor &rCpy );
60 ~SwFmtAnchor();
62 // Zuweisungsoperator
63 SwFmtAnchor &operator=( const SwFmtAnchor& );
65 // "pure virtual Methoden" vom SfxPoolItem
66 virtual int operator==( const SfxPoolItem& ) const;
67 virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
68 virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
69 SfxMapUnit eCoreMetric,
70 SfxMapUnit ePresMetric,
71 String &rText,
72 const IntlWrapper* pIntl = 0 ) const;
74 virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const;
75 virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 );
77 RndStdIds GetAnchorId() const { return nAnchorId; }
78 USHORT GetPageNum() const { return nPageNum; }
79 const SwPosition *GetCntntAnchor() const { return pCntntAnchor; }
80 // OD 2004-05-05 #i28701#
81 sal_uInt32 GetOrder() const;
83 void SetType( RndStdIds nRndId ) { nAnchorId = nRndId; }
84 void SetPageNum( USHORT nNew ) { nPageNum = nNew; }
85 void SetAnchor( const SwPosition *pPos );
88 inline const SwFmtAnchor &SwAttrSet::GetAnchor(BOOL bInP) const
89 { return (const SwFmtAnchor&)Get( RES_ANCHOR,bInP); }
91 inline const SwFmtAnchor &SwFmt::GetAnchor(BOOL bInP) const
92 { return aSet.GetAnchor(bInP); }
94 #endif