merged tag ooo/OOO330_m14
[LibreOffice.git] / sw / inc / fmtanchr.hxx
blob3b505952e4d90000252adcd8b4c4c0c4673eabcc
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
27 #ifndef _FMTANCHR_HXX
28 #define _FMTANCHR_HXX
30 #include "swdllapi.h"
31 #include <hintids.hxx>
32 #include <swtypes.hxx>
33 #include <format.hxx>
34 #include <svl/poolitem.hxx>
36 struct SwPosition;
37 class IntlWrapper;
38 #define IVER_FMTANCHOR_LONGIDX ((USHORT)1)
40 //FlyAnchor, Anker des Freifliegenden Rahmen ----
42 class SW_DLLPUBLIC SwFmtAnchor: public SfxPoolItem
44 SwPosition *pCntntAnchor; //0 Fuer Seitengebundene Rahmen.
45 //Index fuer Absatzgebundene Rahmen.
46 //Position fuer Zeichengebundene Rahmen
47 RndStdIds nAnchorId;
48 USHORT nPageNum; //Seitennummer bei Seitengeb. Rahmen.
50 // OD 2004-05-05 #i28701# - getting anchor positions ordered
51 sal_uInt32 mnOrder;
52 static sal_uInt32 mnOrderCounter;
54 public:
55 SwFmtAnchor( RndStdIds eRnd = FLY_AT_PAGE, USHORT nPageNum = 0 );
56 SwFmtAnchor( const SwFmtAnchor &rCpy );
57 ~SwFmtAnchor();
59 // Zuweisungsoperator
60 SwFmtAnchor &operator=( const SwFmtAnchor& );
62 // "pure virtual Methoden" vom SfxPoolItem
63 virtual int operator==( const SfxPoolItem& ) const;
64 virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
65 virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
66 SfxMapUnit eCoreMetric,
67 SfxMapUnit ePresMetric,
68 String &rText,
69 const IntlWrapper* pIntl = 0 ) 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; }
77 // OD 2004-05-05 #i28701#
78 sal_uInt32 GetOrder() const;
80 void SetType( RndStdIds nRndId ) { nAnchorId = nRndId; }
81 void SetPageNum( USHORT nNew ) { nPageNum = nNew; }
82 void SetAnchor( const SwPosition *pPos );
85 inline const SwFmtAnchor &SwAttrSet::GetAnchor(BOOL bInP) const
86 { return static_cast<const SwFmtAnchor&>(Get(RES_ANCHOR, bInP)); }
88 inline const SwFmtAnchor &SwFmt::GetAnchor(BOOL bInP) const
89 { return aSet.GetAnchor(bInP); }
91 #endif