LibreOffice Module sw (master) 1
fmtpdsc.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19#ifndef INCLUDED_SW_INC_FMTPDSC_HXX
20#define INCLUDED_SW_INC_FMTPDSC_HXX
21
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"
29
30class IntlWrapper;
31
36{
37 ::std::optional<sal_uInt16> m_oNumOffset;
38 sw::BroadcastingModify* m_pDefinedIn;
41 virtual void SwClientNotify( const SwModify&, const SfxHint& rHint ) override;
42
43public:
44 SwFormatPageDesc( const SwPageDesc *pDesc = nullptr );
47 virtual ~SwFormatPageDesc() override;
48
49
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;
60
61 SwPageDesc *GetPageDesc() { return static_cast<SwPageDesc*>(GetRegisteredIn()); }
62 const SwPageDesc *GetPageDesc() const { return static_cast<const SwPageDesc*>(GetRegisteredIn()); }
63
64 const ::std::optional<sal_uInt16>& GetNumOffset() const { return m_oNumOffset; }
65 void SetNumOffset( const ::std::optional<sal_uInt16>& oNum ) { m_oNumOffset = oNum; }
66
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;
73};
74
75inline const SwFormatPageDesc &SwAttrSet::GetPageDesc(bool bInP) const
76 { return Get( RES_PAGEDESC,bInP); }
77
78inline const SwFormatPageDesc &SwFormat::GetPageDesc(bool bInP) const
79 { return m_aSet.GetPageDesc(bInP); }
80
81#endif
82
83/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const
virtual bool GetPresentation(SfxItemPresentation ePresentation, MapUnit eCoreMetric, MapUnit ePresentationMetric, OUString &rText, const IntlWrapper &rIntlWrapper) const
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const
virtual bool operator==(const SfxPoolItem &) const=0
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId)
SfxPoolItem & operator=(const SfxPoolItem &)=delete
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const=0
const SwFormatPageDesc & GetPageDesc(bool=true) const
Definition: fmtpdsc.hxx:75
const SwModify * GetRegisteredIn() const
Definition: calbck.hxx:166
virtual void SwClientNotify(const SwModify &, const SfxHint &rHint) override
Definition: calbck.cxx:120
Pagedescriptor Client of SwPageDesc that is "described" by the attribute.
Definition: fmtpdsc.hxx:36
const sw::BroadcastingModify * GetDefinedIn() const
Query / set where attribute is anchored.
Definition: fmtpdsc.hxx:68
void SetNumOffset(const ::std::optional< sal_uInt16 > &oNum)
Definition: fmtpdsc.hxx:65
const SwPageDesc * GetPageDesc() const
Definition: fmtpdsc.hxx:62
SwPageDesc * GetPageDesc()
Definition: fmtpdsc.hxx:61
::std::optional< sal_uInt16 > m_oNumOffset
Offset page number.
Definition: fmtpdsc.hxx:37
const ::std::optional< sal_uInt16 > & GetNumOffset() const
Definition: fmtpdsc.hxx:64
void ChgDefinedIn(const sw::BroadcastingModify *pNew)
Definition: fmtpdsc.hxx:69
sw::BroadcastingModify * m_pDefinedIn
Points to the object in which the attribute was set (ContentNode/Format).
Definition: fmtpdsc.hxx:38
const SwFormatPageDesc & GetPageDesc(bool=true) const
Definition: fmtpdsc.hxx:78
SwAttrSet m_aSet
Definition: format.hxx:51
struct _xmlTextWriter * xmlTextWriterPtr
constexpr TypedWhichId< SwFormatPageDesc > RES_PAGEDESC(99)
MapUnit
SfxItemPresentation
#define SW_DLLPUBLIC
Definition: swdllapi.h:28
unsigned char sal_uInt8