tdf#149609 release mouse before showing popups from calc grid window
[LibreOffice.git] / sw / inc / fmtpdsc.hxx
blobc9617624a682b116b656d240fad1f041a6dfcd90
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 INCLUDED_SW_INC_FMTPDSC_HXX
20 #define INCLUDED_SW_INC_FMTPDSC_HXX
22 #include <svl/poolitem.hxx>
23 #include "swdllapi.h"
24 #include "hintids.hxx"
25 #include "format.hxx"
26 #include "calbck.hxx"
27 #include <optional>
28 #include "pagedesc.hxx"
30 class IntlWrapper;
32 /** Pagedescriptor
33 Client of SwPageDesc that is "described" by the attribute. */
35 class SW_DLLPUBLIC SwFormatPageDesc final : public SfxPoolItem, public SwClient
37 ::std::optional<sal_uInt16> m_oNumOffset; ///< Offset page number.
38 sw::BroadcastingModify* m_pDefinedIn; /**< Points to the object in which the
39 attribute was set (ContentNode/Format). */
41 virtual void SwClientNotify( const SwModify&, const SfxHint& rHint ) override;
43 public:
44 SwFormatPageDesc( const SwPageDesc *pDesc = nullptr );
45 SwFormatPageDesc( const SwFormatPageDesc &rCpy );
46 SwFormatPageDesc &operator=( const SwFormatPageDesc &rCpy );
47 virtual ~SwFormatPageDesc() override;
50 /// "Pure virtual methods" of SfxPoolItem.
51 virtual bool operator==( const SfxPoolItem& ) const override;
52 virtual SwFormatPageDesc* Clone( SfxItemPool* pPool = nullptr ) const override;
53 virtual bool GetPresentation( SfxItemPresentation ePres,
54 MapUnit eCoreMetric,
55 MapUnit ePresMetric,
56 OUString &rText,
57 const IntlWrapper& rIntl ) const override;
58 virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
59 virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
61 SwPageDesc *GetPageDesc() { return static_cast<SwPageDesc*>(GetRegisteredIn()); }
62 const SwPageDesc *GetPageDesc() const { return static_cast<const SwPageDesc*>(GetRegisteredIn()); }
64 const ::std::optional<sal_uInt16>& GetNumOffset() const { return m_oNumOffset; }
65 void SetNumOffset( const ::std::optional<sal_uInt16>& oNum ) { m_oNumOffset = oNum; }
67 /// Query / set where attribute is anchored.
68 const sw::BroadcastingModify* GetDefinedIn() const { return m_pDefinedIn; }
69 void ChgDefinedIn( const sw::BroadcastingModify* pNew ) { m_pDefinedIn = const_cast<sw::BroadcastingModify*>(pNew); }
70 void RegisterToPageDesc( SwPageDesc& );
71 bool KnowsPageDesc() const;
72 void dumpAsXml(xmlTextWriterPtr pWriter) const override;
75 inline const SwFormatPageDesc &SwAttrSet::GetPageDesc(bool bInP) const
76 { return Get( RES_PAGEDESC,bInP); }
78 inline const SwFormatPageDesc &SwFormat::GetPageDesc(bool bInP) const
79 { return m_aSet.GetPageDesc(bInP); }
81 #endif
83 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */