1*1d2dbeb0SAndrew Rist /**************************************************************
2cdf0e10cSrcweir *
3*1d2dbeb0SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*1d2dbeb0SAndrew Rist * or more contributor license agreements. See the NOTICE file
5*1d2dbeb0SAndrew Rist * distributed with this work for additional information
6*1d2dbeb0SAndrew Rist * regarding copyright ownership. The ASF licenses this file
7*1d2dbeb0SAndrew Rist * to you under the Apache License, Version 2.0 (the
8*1d2dbeb0SAndrew Rist * "License"); you may not use this file except in compliance
9*1d2dbeb0SAndrew Rist * with the License. You may obtain a copy of the License at
10*1d2dbeb0SAndrew Rist *
11*1d2dbeb0SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0
12*1d2dbeb0SAndrew Rist *
13*1d2dbeb0SAndrew Rist * Unless required by applicable law or agreed to in writing,
14*1d2dbeb0SAndrew Rist * software distributed under the License is distributed on an
15*1d2dbeb0SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*1d2dbeb0SAndrew Rist * KIND, either express or implied. See the License for the
17*1d2dbeb0SAndrew Rist * specific language governing permissions and limitations
18*1d2dbeb0SAndrew Rist * under the License.
19*1d2dbeb0SAndrew Rist *
20*1d2dbeb0SAndrew Rist *************************************************************/
21*1d2dbeb0SAndrew Rist
22*1d2dbeb0SAndrew Rist
23cdf0e10cSrcweir #ifndef _FMTANCHR_HXX
24cdf0e10cSrcweir #define _FMTANCHR_HXX
25cdf0e10cSrcweir
26cdf0e10cSrcweir #include "swdllapi.h"
27cdf0e10cSrcweir #include <hintids.hxx>
28cdf0e10cSrcweir #include <swtypes.hxx>
29cdf0e10cSrcweir #include <format.hxx>
30cdf0e10cSrcweir #include <svl/poolitem.hxx>
31cdf0e10cSrcweir
32cdf0e10cSrcweir struct SwPosition;
33cdf0e10cSrcweir class IntlWrapper;
34cdf0e10cSrcweir #define IVER_FMTANCHOR_LONGIDX ((sal_uInt16)1)
35cdf0e10cSrcweir
36cdf0e10cSrcweir //FlyAnchor, Anker des Freifliegenden Rahmen ----
37cdf0e10cSrcweir
38cdf0e10cSrcweir class SW_DLLPUBLIC SwFmtAnchor: public SfxPoolItem
39cdf0e10cSrcweir {
40cdf0e10cSrcweir SwPosition *pCntntAnchor; //0 Fuer Seitengebundene Rahmen.
41cdf0e10cSrcweir //Index fuer Absatzgebundene Rahmen.
42cdf0e10cSrcweir //Position fuer Zeichengebundene Rahmen
43cdf0e10cSrcweir RndStdIds nAnchorId;
44cdf0e10cSrcweir sal_uInt16 nPageNum; //Seitennummer bei Seitengeb. Rahmen.
45cdf0e10cSrcweir
46cdf0e10cSrcweir // OD 2004-05-05 #i28701# - getting anchor positions ordered
47cdf0e10cSrcweir sal_uInt32 mnOrder;
48cdf0e10cSrcweir static sal_uInt32 mnOrderCounter;
49cdf0e10cSrcweir
50cdf0e10cSrcweir public:
51cdf0e10cSrcweir SwFmtAnchor( RndStdIds eRnd = FLY_AT_PAGE, sal_uInt16 nPageNum = 0 );
52cdf0e10cSrcweir SwFmtAnchor( const SwFmtAnchor &rCpy );
53cdf0e10cSrcweir ~SwFmtAnchor();
54cdf0e10cSrcweir
55cdf0e10cSrcweir // Zuweisungsoperator
56cdf0e10cSrcweir SwFmtAnchor &operator=( const SwFmtAnchor& );
57cdf0e10cSrcweir
58cdf0e10cSrcweir // "pure virtual Methoden" vom SfxPoolItem
59cdf0e10cSrcweir virtual int operator==( const SfxPoolItem& ) const;
60cdf0e10cSrcweir virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
61cdf0e10cSrcweir virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
62cdf0e10cSrcweir SfxMapUnit eCoreMetric,
63cdf0e10cSrcweir SfxMapUnit ePresMetric,
64cdf0e10cSrcweir String &rText,
65cdf0e10cSrcweir const IntlWrapper* pIntl = 0 ) const;
66cdf0e10cSrcweir
67cdf0e10cSrcweir virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
68cdf0e10cSrcweir virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
69cdf0e10cSrcweir
GetAnchorId() const70cdf0e10cSrcweir RndStdIds GetAnchorId() const { return nAnchorId; }
GetPageNum() const71cdf0e10cSrcweir sal_uInt16 GetPageNum() const { return nPageNum; }
GetCntntAnchor() const72cdf0e10cSrcweir const SwPosition *GetCntntAnchor() const { return pCntntAnchor; }
73cdf0e10cSrcweir // OD 2004-05-05 #i28701#
74cdf0e10cSrcweir sal_uInt32 GetOrder() const;
75cdf0e10cSrcweir
SetType(RndStdIds nRndId)76cdf0e10cSrcweir void SetType( RndStdIds nRndId ) { nAnchorId = nRndId; }
SetPageNum(sal_uInt16 nNew)77cdf0e10cSrcweir void SetPageNum( sal_uInt16 nNew ) { nPageNum = nNew; }
78cdf0e10cSrcweir void SetAnchor( const SwPosition *pPos );
79cdf0e10cSrcweir };
80cdf0e10cSrcweir
GetAnchor(sal_Bool bInP) const81cdf0e10cSrcweir inline const SwFmtAnchor &SwAttrSet::GetAnchor(sal_Bool bInP) const
82cdf0e10cSrcweir { return static_cast<const SwFmtAnchor&>(Get(RES_ANCHOR, bInP)); }
83cdf0e10cSrcweir
GetAnchor(sal_Bool bInP) const84cdf0e10cSrcweir inline const SwFmtAnchor &SwFmt::GetAnchor(sal_Bool bInP) const
85cdf0e10cSrcweir { return aSet.GetAnchor(bInP); }
86cdf0e10cSrcweir
87cdf0e10cSrcweir #endif
88cdf0e10cSrcweir
89