fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / sw / inc / fmtanchr.hxx
blob7c3d665a7eeea9e35afd1c2416f746a4dd91ee25
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
19 #ifndef _FMTANCHR_HXX
20 #define _FMTANCHR_HXX
22 #include "swdllapi.h"
23 #include <hintids.hxx>
24 #include <swtypes.hxx>
25 #include <format.hxx>
26 #include <svl/poolitem.hxx>
28 #include <boost/scoped_ptr.hpp>
31 struct SwPosition;
32 class IntlWrapper;
34 /// FlyAnchors
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. */
40 RndStdIds nAnchorId;
41 sal_uInt16 nPageNum; ///< Page number for page-bound frames.
43 /// #i28701# - getting anchor positions ordered
44 sal_uInt32 mnOrder;
45 static sal_uInt32 mnOrderCounter;
47 public:
48 SwFmtAnchor( RndStdIds eRnd = FLY_AT_PAGE, sal_uInt16 nPageNum = 0 );
49 SwFmtAnchor( const SwFmtAnchor &rCpy );
50 ~SwFmtAnchor();
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,
60 OUString &rText,
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(); }
69 // #i28701#
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); }
83 #endif
85 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */