bump product version to 4.1.6.2
[LibreOffice.git] / sw / inc / fmtpdsc.hxx
blobb522aebc482b3be09265f59cd4c7c78e9ed1893f
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 _FMTPDSC_HXX
20 #define _FMTPDSC_HXX
23 #include <svl/poolitem.hxx>
24 #include "swdllapi.h"
25 #include <hintids.hxx>
26 #include <format.hxx>
27 #include <calbck.hxx>
29 class SwPageDesc;
30 class SwHistory;
31 class SwPaM;
32 class IntlWrapper;
33 class SwEndNoteInfo;
35 /** Pagedescriptor
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,
43 SwHistory* );
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). */
48 protected:
49 virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew );
50 virtual void SwClientNotify( const SwModify&, const SfxHint& rHint );
52 public:
53 SwFmtPageDesc( const SwPageDesc *pDesc = 0 );
54 SwFmtPageDesc( const SwFmtPageDesc &rCpy );
55 SwFmtPageDesc &operator=( const SwFmtPageDesc &rCpy );
56 ~SwFmtPageDesc();
58 TYPEINFO();
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,
66 OUString &rText,
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); }
92 #endif
94 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */