Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : : #ifndef _FMTPDSC_HXX
29 : : #define _FMTPDSC_HXX
30 : :
31 : :
32 : : #include <svl/poolitem.hxx>
33 : : #include "swdllapi.h"
34 : : #include <hintids.hxx>
35 : : #include <format.hxx>
36 : : #include <calbck.hxx>
37 : :
38 : : class SwPageDesc;
39 : : class SwHistory;
40 : : class SwPaM;
41 : : class IntlWrapper;
42 : : class SwEndNoteInfo;
43 : :
44 : : // Pagedescriptor
45 : : // Client of SwPageDesc that is "described" by the attribute.
46 : :
47 : : class SW_DLLPUBLIC SwFmtPageDesc : public SfxPoolItem, public SwClient
48 : : {
49 : : // This "Doc"-function is made friend in order to be able
50 : : // to set the auto-flag after copying!!
51 : : friend sal_Bool InsAttr( SwDoc*, const SwPaM &, const SfxItemSet&, sal_uInt16,
52 : : SwHistory* );
53 : : sal_uInt16 nNumOffset; // Offset page number.
54 : : sal_uInt16 nDescNameIdx; // SW3-Reader: stringpool-index of style name.
55 : : SwModify* pDefinedIn; // Points to the object in which the
56 : : // attribute was set (CntntNode/Format).
57 : : protected:
58 : : virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew );
59 : : virtual void SwClientNotify( const SwModify&, const SfxHint& rHint );
60 : :
61 : : public:
62 : : SwFmtPageDesc( const SwPageDesc *pDesc = 0 );
63 : : SwFmtPageDesc( const SwFmtPageDesc &rCpy );
64 : : SwFmtPageDesc &operator=( const SwFmtPageDesc &rCpy );
65 : : ~SwFmtPageDesc();
66 : :
67 : : TYPEINFO();
68 : :
69 : : // "Pure virtual methods" of SfxPoolItem.
70 : : virtual int operator==( const SfxPoolItem& ) const;
71 : : virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
72 : : virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
73 : : SfxMapUnit eCoreMetric,
74 : : SfxMapUnit ePresMetric,
75 : : String &rText,
76 : : const IntlWrapper* pIntl = 0 ) const;
77 : : virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
78 : : virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
79 : :
80 : 1116 : SwPageDesc *GetPageDesc() { return (SwPageDesc*)GetRegisteredIn(); }
81 : 18559 : const SwPageDesc *GetPageDesc() const { return (SwPageDesc*)GetRegisteredIn(); }
82 : :
83 : 1770 : sal_uInt16 GetNumOffset() const { return nNumOffset; }
84 : 50 : void SetNumOffset( sal_uInt16 nNum ) { nNumOffset = nNum; }
85 : :
86 : : // Query / set where attribute is anchored.
87 : 3032 : inline const SwModify* GetDefinedIn() const { return pDefinedIn; }
88 : 3022 : void ChgDefinedIn( const SwModify* pNew ) { pDefinedIn = (SwModify*)pNew; }
89 : : void RegisterToEndNotInfo( SwEndNoteInfo& );
90 : : void RegisterToPageDesc( SwPageDesc& );
91 : : bool KnowsPageDesc() const;
92 : : };
93 : :
94 : :
95 : 12157 : inline const SwFmtPageDesc &SwAttrSet::GetPageDesc(sal_Bool bInP) const
96 : 12157 : { return (const SwFmtPageDesc&)Get( RES_PAGEDESC,bInP); }
97 : :
98 : 111 : inline const SwFmtPageDesc &SwFmt::GetPageDesc(sal_Bool bInP) const
99 : 111 : { return aSet.GetPageDesc(bInP); }
100 : :
101 : : #endif
102 : :
103 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|