2010-10-14 08:30:41 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2011-03-31 10:05:04 +02:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2013-11-05 02:17:53 +01:00
|
|
|
#ifndef INCLUDED_SW_INC_FMTANCHR_HXX
|
|
|
|
#define INCLUDED_SW_INC_FMTANCHR_HXX
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2004-08-23 07:31:51 +00:00
|
|
|
#include "swdllapi.h"
|
2000-09-18 16:15:01 +00:00
|
|
|
#include <hintids.hxx>
|
|
|
|
#include <swtypes.hxx>
|
|
|
|
#include <format.hxx>
|
2009-10-16 00:05:16 +02:00
|
|
|
#include <svl/poolitem.hxx>
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2015-08-07 09:21:39 +02:00
|
|
|
#include <memory>
|
2011-11-28 17:13:35 +01:00
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
struct SwPosition;
|
2001-05-13 02:33:31 +00:00
|
|
|
class IntlWrapper;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2012-09-02 09:05:03 +03:00
|
|
|
/// FlyAnchors
|
2015-05-20 13:05:49 +02:00
|
|
|
class SW_DLLPUBLIC SwFormatAnchor: public SfxPoolItem
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
2015-08-07 09:21:39 +02:00
|
|
|
std::unique_ptr<SwPosition> m_pContentAnchor; /**< 0 for page-bound frames.
|
2012-09-02 09:05:03 +03:00
|
|
|
Index for paragraph-bound frames.
|
|
|
|
Position for character-bound frames. */
|
2000-09-18 16:15:01 +00:00
|
|
|
RndStdIds nAnchorId;
|
2012-09-02 09:05:03 +03:00
|
|
|
sal_uInt16 nPageNum; ///< Page number for page-bound frames.
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2012-09-02 09:05:03 +03:00
|
|
|
/// #i28701# - getting anchor positions ordered
|
2004-08-02 12:56:57 +00:00
|
|
|
sal_uInt32 mnOrder;
|
|
|
|
static sal_uInt32 mnOrderCounter;
|
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
public:
|
2015-05-20 13:05:49 +02:00
|
|
|
SwFormatAnchor( RndStdIds eRnd = FLY_AT_PAGE, sal_uInt16 nPageNum = 0 );
|
|
|
|
SwFormatAnchor( const SwFormatAnchor &rCpy );
|
2016-09-13 13:09:01 +02:00
|
|
|
virtual ~SwFormatAnchor() override;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2015-05-20 13:05:49 +02:00
|
|
|
SwFormatAnchor &operator=( const SwFormatAnchor& );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2012-09-02 09:05:03 +03:00
|
|
|
/// "pure virtual methods" of SfxPoolItem
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual bool operator==( const SfxPoolItem& ) const override;
|
2015-11-10 10:25:48 +01:00
|
|
|
virtual SfxPoolItem* Clone( SfxItemPool* pPool = nullptr ) const override;
|
2014-07-24 11:31:39 +02:00
|
|
|
virtual bool GetPresentation( SfxItemPresentation ePres,
|
2016-08-19 09:31:35 +01:00
|
|
|
MapUnit eCoreMetric,
|
|
|
|
MapUnit ePresMetric,
|
|
|
|
OUString &rText,
|
|
|
|
const IntlWrapper* pIntl = nullptr ) const override;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2015-11-05 15:55:58 +02:00
|
|
|
virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
|
|
|
|
virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
RndStdIds GetAnchorId() const { return nAnchorId; }
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 GetPageNum() const { return nPageNum; }
|
2015-05-20 13:05:49 +02:00
|
|
|
const SwPosition *GetContentAnchor() const { return m_pContentAnchor.get(); }
|
2010-11-15 11:59:57 +00:00
|
|
|
// #i28701#
|
2014-06-09 10:09:42 +02:00
|
|
|
sal_uInt32 GetOrder() const { return mnOrder;}
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
void SetType( RndStdIds nRndId ) { nAnchorId = nRndId; }
|
2011-01-17 15:06:54 +01:00
|
|
|
void SetPageNum( sal_uInt16 nNew ) { nPageNum = nNew; }
|
2000-09-18 16:15:01 +00:00
|
|
|
void SetAnchor( const SwPosition *pPos );
|
2014-12-22 10:34:04 +01:00
|
|
|
|
2015-10-12 16:04:04 +02:00
|
|
|
void dumpAsXml(struct _xmlTextWriter* pWriter) const override;
|
2000-09-18 16:15:01 +00:00
|
|
|
};
|
|
|
|
|
2015-05-20 13:05:49 +02:00
|
|
|
inline const SwFormatAnchor &SwAttrSet::GetAnchor(bool bInP) const
|
|
|
|
{ return static_cast<const SwFormatAnchor&>(Get(RES_ANCHOR, bInP)); }
|
2002-08-23 11:52:37 +00:00
|
|
|
|
2015-05-20 13:05:49 +02:00
|
|
|
inline const SwFormatAnchor &SwFormat::GetAnchor(bool bInP) const
|
2015-04-30 20:24:30 +02:00
|
|
|
{ return m_aSet.GetAnchor(bInP); }
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2010-10-14 08:30:41 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|