Line data Source code
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 _FMTPDSC_HXX
20 : #define _FMTPDSC_HXX
21 :
22 :
23 : #include <svl/poolitem.hxx>
24 : #include "swdllapi.h"
25 : #include <hintids.hxx>
26 : #include <format.hxx>
27 : #include <calbck.hxx>
28 :
29 : class SwPageDesc;
30 : class SwHistory;
31 : class SwPaM;
32 : class IntlWrapper;
33 : class SwEndNoteInfo;
34 :
35 : /** Pagedescriptor
36 : Client of SwPageDesc that is "described" by the attribute. */
37 :
38 : class SW_DLLPUBLIC SwFmtPageDesc : public SfxPoolItem, public SwClient
39 : {
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 );
51 :
52 : public:
53 : SwFmtPageDesc( const SwPageDesc *pDesc = 0 );
54 : SwFmtPageDesc( const SwFmtPageDesc &rCpy );
55 : SwFmtPageDesc &operator=( const SwFmtPageDesc &rCpy );
56 : ~SwFmtPageDesc();
57 :
58 : TYPEINFO();
59 :
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 : String &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 );
70 :
71 404 : SwPageDesc *GetPageDesc() { return (SwPageDesc*)GetRegisteredIn(); }
72 4164 : const SwPageDesc *GetPageDesc() const { return (SwPageDesc*)GetRegisteredIn(); }
73 :
74 305 : sal_uInt16 GetNumOffset() const { return nNumOffset; }
75 17 : void SetNumOffset( sal_uInt16 nNum ) { nNumOffset = nNum; }
76 :
77 : /// Query / set where attribute is anchored.
78 1335 : inline const SwModify* GetDefinedIn() const { return pDefinedIn; }
79 1335 : void ChgDefinedIn( const SwModify* pNew ) { pDefinedIn = (SwModify*)pNew; }
80 : void RegisterToEndNotInfo( SwEndNoteInfo& );
81 : void RegisterToPageDesc( SwPageDesc& );
82 : bool KnowsPageDesc() const;
83 : };
84 :
85 :
86 1408 : inline const SwFmtPageDesc &SwAttrSet::GetPageDesc(sal_Bool bInP) const
87 1408 : { return (const SwFmtPageDesc&)Get( RES_PAGEDESC,bInP); }
88 :
89 13 : inline const SwFmtPageDesc &SwFmt::GetPageDesc(sal_Bool bInP) const
90 13 : { return aSet.GetPageDesc(bInP); }
91 :
92 : #endif
93 :
94 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|