1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
23 #include <svl/poolitem.hxx>
25 #include <hintids.hxx>
36 Client of SwPageDesc that is "described" by the attribute. */
38 class SW_DLLPUBLIC SwFmtPageDesc
: public SfxPoolItem
, public SwClient
40 /** This "Doc"-function is made friend in order to be able
41 to set the auto-flag after copying!! */
42 friend sal_Bool
InsAttr( SwDoc
*, const SwPaM
&, const SfxItemSet
&, sal_uInt16
,
44 sal_uInt16 nNumOffset
; ///< Offset page number.
45 sal_uInt16 nDescNameIdx
; ///< SW3-Reader: stringpool-index of style name.
46 SwModify
* pDefinedIn
; /**< Points to the object in which the
47 attribute was set (CntntNode/Format). */
49 virtual void Modify( const SfxPoolItem
* pOld
, const SfxPoolItem
*pNew
);
50 virtual void SwClientNotify( const SwModify
&, const SfxHint
& rHint
);
53 SwFmtPageDesc( const SwPageDesc
*pDesc
= 0 );
54 SwFmtPageDesc( const SwFmtPageDesc
&rCpy
);
55 SwFmtPageDesc
&operator=( const SwFmtPageDesc
&rCpy
);
60 /// "Pure virtual methods" of SfxPoolItem.
61 virtual int operator==( const SfxPoolItem
& ) const;
62 virtual SfxPoolItem
* Clone( SfxItemPool
* pPool
= 0 ) const;
63 virtual SfxItemPresentation
GetPresentation( SfxItemPresentation ePres
,
64 SfxMapUnit eCoreMetric
,
65 SfxMapUnit ePresMetric
,
67 const IntlWrapper
* pIntl
= 0 ) const;
68 virtual bool QueryValue( com::sun::star::uno::Any
& rVal
, sal_uInt8 nMemberId
= 0 ) const;
69 virtual bool PutValue( const com::sun::star::uno::Any
& rVal
, sal_uInt8 nMemberId
= 0 );
71 SwPageDesc
*GetPageDesc() { return (SwPageDesc
*)GetRegisteredIn(); }
72 const SwPageDesc
*GetPageDesc() const { return (SwPageDesc
*)GetRegisteredIn(); }
74 sal_uInt16
GetNumOffset() const { return nNumOffset
; }
75 void SetNumOffset( sal_uInt16 nNum
) { nNumOffset
= nNum
; }
77 /// Query / set where attribute is anchored.
78 inline const SwModify
* GetDefinedIn() const { return pDefinedIn
; }
79 void ChgDefinedIn( const SwModify
* pNew
) { pDefinedIn
= (SwModify
*)pNew
; }
80 void RegisterToEndNotInfo( SwEndNoteInfo
& );
81 void RegisterToPageDesc( SwPageDesc
& );
82 bool KnowsPageDesc() const;
86 inline const SwFmtPageDesc
&SwAttrSet::GetPageDesc(sal_Bool bInP
) const
87 { return (const SwFmtPageDesc
&)Get( RES_PAGEDESC
,bInP
); }
89 inline const SwFmtPageDesc
&SwFmt::GetPageDesc(sal_Bool bInP
) const
90 { return aSet
.GetPageDesc(bInP
); }
94 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */