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 <boost/optional.hpp>
28 #include "pagedesc.hxx"
29 
30 class IntlWrapper;
31 
36 {
40 protected:
41  virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew ) override;
42  virtual void SwClientNotify( const SwModify&, const SfxHint& rHint ) override;
43 
44 public:
45  SwFormatPageDesc( const SwPageDesc *pDesc = nullptr );
46  SwFormatPageDesc( const SwFormatPageDesc &rCpy );
48  virtual ~SwFormatPageDesc() override;
49 
50 
52  virtual bool operator==( const SfxPoolItem& ) const override;
53  virtual SfxPoolItem* Clone( SfxItemPool* pPool = nullptr ) const override;
54  virtual bool GetPresentation( SfxItemPresentation ePres,
55  MapUnit eCoreMetric,
56  MapUnit ePresMetric,
57  OUString &rText,
58  const IntlWrapper& rIntl ) const override;
59  virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
60  virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
61 
62  SwPageDesc *GetPageDesc() { return static_cast<SwPageDesc*>(GetRegisteredIn()); }
63  const SwPageDesc *GetPageDesc() const { return static_cast<const SwPageDesc*>(GetRegisteredIn()); }
64 
65  const ::boost::optional<sal_uInt16>& GetNumOffset() const { return m_oNumOffset; }
66  void SetNumOffset( const ::boost::optional<sal_uInt16>& oNum ) { m_oNumOffset = oNum; }
67 
69  const SwModify* GetDefinedIn() const { return m_pDefinedIn; }
70  void ChgDefinedIn( const SwModify* pNew ) { m_pDefinedIn = const_cast<SwModify*>(pNew); }
71  void RegisterToPageDesc( SwPageDesc& );
72  bool KnowsPageDesc() const;
73  void dumpAsXml(xmlTextWriterPtr pWriter) const override;
74 };
75 
76 inline const SwFormatPageDesc &SwAttrSet::GetPageDesc(bool bInP) const
77  { return Get( RES_PAGEDESC,bInP); }
78 
79 inline const SwFormatPageDesc &SwFormat::GetPageDesc(bool bInP) const
80  { return m_aSet.GetPageDesc(bInP); }
81 
82 #endif
83 
84 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void ChgDefinedIn(const SwModify *pNew)
Definition: fmtpdsc.hxx:70
Pagedescriptor Client of SwPageDesc that is "described" by the attribute.
Definition: fmtpdsc.hxx:35
SwPageDesc * GetPageDesc()
Definition: fmtpdsc.hxx:62
const SwPageDesc * GetPageDesc() const
Definition: fmtpdsc.hxx:63
virtual bool operator==(const SfxPoolItem &) const =0
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const =0
sal_uInt16 sal_Char sal_Char * pDesc
SfxPoolItem & operator=(const SfxPoolItem &)=delete
virtual void SwClientNotify(const SwModify &, const SfxHint &rHint) override
Definition: calbck.cxx:108
SwAttrSet m_aSet
Definition: format.hxx:48
::boost::optional< sal_uInt16 > m_oNumOffset
Offset page number.
Definition: fmtpdsc.hxx:37
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const
void SetNumOffset(const ::boost::optional< sal_uInt16 > &oNum)
Definition: fmtpdsc.hxx:66
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId)
const ::boost::optional< sal_uInt16 > & GetNumOffset() const
Definition: fmtpdsc.hxx:65
struct _xmlTextWriter * xmlTextWriterPtr
SfxItemPresentation
#define SW_DLLPUBLIC
Definition: swdllapi.h:28
const SwModify * GetDefinedIn() const
Query / set where attribute is anchored.
Definition: fmtpdsc.hxx:69
virtual bool GetPresentation(SfxItemPresentation ePresentation, MapUnit eCoreMetric, MapUnit ePresentationMetric, OUString &rText, const IntlWrapper &rIntlWrapper) const
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
unsigned char sal_uInt8
const SwFormatPageDesc & GetPageDesc(bool=true) const
Definition: fmtpdsc.hxx:76
const SwModify * GetRegisteredIn() const
Definition: calbck.hxx:157
SwModify * m_pDefinedIn
Points to the object in which the attribute was set (ContentNode/Format).
Definition: fmtpdsc.hxx:38
MapUnit
const SwFormatPageDesc & GetPageDesc(bool=true) const
Definition: fmtpdsc.hxx:79
#define RES_PAGEDESC
Definition: hintids.hxx:200
virtual void Modify(const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue)
Definition: calbck.cxx:130
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const