Update ooo320-m1
[ooovba.git] / binfilter / inc / bf_sw / fmtpdsc.hxx
blob3a414ab59b9ff6048760908091d890e5cdfc4fdb
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.6 $
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 #ifndef _FORMAT_HXX //autogen
35 #include <format.hxx>
36 #endif
37 class IntlWrapper;
38 namespace binfilter {
40 class SwPageDesc;
41 class SwHistory;
42 class SwPaM;
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 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 SfxPoolItem* Create(SvStream &, USHORT nVer) const;
74 virtual SvStream& Store(SvStream &, USHORT nIVer) const;
75 virtual USHORT GetVersion( USHORT nFFVer ) const;
76 virtual BOOL QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const;
77 virtual BOOL PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 );
79 virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew );
81 SwPageDesc *GetPageDesc() { return (SwPageDesc*)GetRegisteredIn(); }
82 const SwPageDesc *GetPageDesc() const { return (SwPageDesc*)GetRegisteredIn(); }
84 USHORT GetNumOffset() const { return nNumOffset; }
85 void SetNumOffset( USHORT nNum ) { nNumOffset = nNum; }
87 // erfrage/setze, wo drin das Attribut verankert ist
88 inline const SwModify* GetDefinedIn() const { return pDefinedIn; }
89 void ChgDefinedIn( const SwModify* pNew ) { pDefinedIn = (SwModify*)pNew; }
91 // fuer den SW3-Reader:
92 USHORT GetDescNameIdx() const { return nDescNameIdx; }
93 void SetDescNameIdx( USHORT n ) { nDescNameIdx = n; }
97 #if !(defined(MACOSX) && ( __GNUC__ < 3 ))
98 // GrP moved to gcc_outl.cxx; revisit with gcc3
99 inline const SwFmtPageDesc &SwAttrSet::GetPageDesc(BOOL bInP) const
100 { return (const SwFmtPageDesc&)Get( RES_PAGEDESC,bInP); }
102 inline const SwFmtPageDesc &SwFmt::GetPageDesc(BOOL bInP) const
103 { return aSet.GetPageDesc(bInP); }
104 #endif
106 } //namespace binfilter
107 #endif