1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
23 #include <hintids.hxx>
24 #include <swtypes.hxx>
26 #include <svl/poolitem.hxx>
28 #include <boost/scoped_ptr.hpp>
35 class SW_DLLPUBLIC SwFmtAnchor
: public SfxPoolItem
37 ::boost::scoped_ptr
<SwPosition
> m_pCntntAnchor
; /**< 0 for page-bound frames.
38 Index for paragraph-bound frames.
39 Position for character-bound frames. */
41 sal_uInt16 nPageNum
; ///< Page number for page-bound frames.
43 /// #i28701# - getting anchor positions ordered
45 static sal_uInt32 mnOrderCounter
;
48 SwFmtAnchor( RndStdIds eRnd
= FLY_AT_PAGE
, sal_uInt16 nPageNum
= 0 );
49 SwFmtAnchor( const SwFmtAnchor
&rCpy
);
52 SwFmtAnchor
&operator=( const SwFmtAnchor
& );
54 /// "pure virtual methods" of SfxPoolItem
55 virtual int operator==( const SfxPoolItem
& ) const;
56 virtual SfxPoolItem
* Clone( SfxItemPool
* pPool
= 0 ) const;
57 virtual SfxItemPresentation
GetPresentation( SfxItemPresentation ePres
,
58 SfxMapUnit eCoreMetric
,
59 SfxMapUnit ePresMetric
,
61 const IntlWrapper
* pIntl
= 0 ) const;
63 virtual bool QueryValue( com::sun::star::uno::Any
& rVal
, sal_uInt8 nMemberId
= 0 ) const;
64 virtual bool PutValue( const com::sun::star::uno::Any
& rVal
, sal_uInt8 nMemberId
= 0 );
66 RndStdIds
GetAnchorId() const { return nAnchorId
; }
67 sal_uInt16
GetPageNum() const { return nPageNum
; }
68 const SwPosition
*GetCntntAnchor() const { return m_pCntntAnchor
.get(); }
70 sal_uInt32
GetOrder() const;
72 void SetType( RndStdIds nRndId
) { nAnchorId
= nRndId
; }
73 void SetPageNum( sal_uInt16 nNew
) { nPageNum
= nNew
; }
74 void SetAnchor( const SwPosition
*pPos
);
77 inline const SwFmtAnchor
&SwAttrSet::GetAnchor(sal_Bool bInP
) const
78 { return static_cast<const SwFmtAnchor
&>(Get(RES_ANCHOR
, bInP
)); }
80 inline const SwFmtAnchor
&SwFmt::GetAnchor(sal_Bool bInP
) const
81 { return aSet
.GetAnchor(bInP
); }
85 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */