merge the formfield patch from ooo-build
[ooovba.git] / sw / inc / fmtpdsc.hxx
blob5c75ecdef7eda74b47ce204806389668aaa533ad
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: fmtpdsc.hxx,v $
10 * $Revision: 1.13 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _FMTPDSC_HXX
31 #define _FMTPDSC_HXX
34 #include <svtools/poolitem.hxx>
35 #include "swdllapi.h"
36 #include <hintids.hxx>
37 #include <format.hxx>
38 #include <calbck.hxx>
40 class SwPageDesc;
41 class SwHistory;
42 class SwPaM;
43 class IntlWrapper;
45 //Pagedescriptor
46 //Client vom SwPageDesc der durch das Attribut "beschrieben" wird.
48 #define IVER_FMTPAGEDESC_NOAUTO ((USHORT)0x0001)
49 #define IVER_FMTPAGEDESC_LONGPAGE ((USHORT)0x0002)
51 class SW_DLLPUBLIC SwFmtPageDesc : public SfxPoolItem, public SwClient
53 // diese "Doc"-Funktion ist friend, um nach dem kopieren das
54 // Auto-Flag setzen zu koennen !!
55 friend BOOL InsAttr( SwDoc*, const SwPaM &, const SfxItemSet&, USHORT,
56 SwHistory* );
57 USHORT nNumOffset; // Seitennummer Offset
58 USHORT nDescNameIdx; // SW3-Reader: Stringpool-Index des Vorlagennamens
59 SwModify* pDefinedIn; // Verweis auf das Objekt, in dem das
60 // Attribut gesetzt wurde (CntntNode/Format)
62 public:
63 SwFmtPageDesc( const SwPageDesc *pDesc = 0 );
64 SwFmtPageDesc( const SwFmtPageDesc &rCpy );
65 SwFmtPageDesc &operator=( const SwFmtPageDesc &rCpy );
66 ~SwFmtPageDesc();
68 TYPEINFO();
70 // "pure virtual Methoden" vom SfxPoolItem
71 virtual int operator==( const SfxPoolItem& ) const;
72 virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
73 virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
74 SfxMapUnit eCoreMetric,
75 SfxMapUnit ePresMetric,
76 String &rText,
77 const IntlWrapper* pIntl = 0 ) const;
78 virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const;
79 virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 );
81 virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew );
83 SwPageDesc *GetPageDesc() { return (SwPageDesc*)GetRegisteredIn(); }
84 const SwPageDesc *GetPageDesc() const { return (SwPageDesc*)GetRegisteredIn(); }
86 USHORT GetNumOffset() const { return nNumOffset; }
87 void SetNumOffset( USHORT nNum ) { nNumOffset = nNum; }
89 // erfrage/setze, wo drin das Attribut verankert ist
90 inline const SwModify* GetDefinedIn() const { return pDefinedIn; }
91 void ChgDefinedIn( const SwModify* pNew ) { pDefinedIn = (SwModify*)pNew; }
95 inline const SwFmtPageDesc &SwAttrSet::GetPageDesc(BOOL bInP) const
96 { return (const SwFmtPageDesc&)Get( RES_PAGEDESC,bInP); }
98 inline const SwFmtPageDesc &SwFmt::GetPageDesc(BOOL bInP) const
99 { return aSet.GetPageDesc(bInP); }
101 #endif