1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: fmthdft.hxx,v $
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 ************************************************************************/
33 #include <hintids.hxx>
35 #include <svtools/poolitem.hxx>
42 //Kopfzeile, fuer Seitenformate
43 //Client von FrmFmt das den Header beschreibt.
45 class SW_DLLPUBLIC SwFmtHeader
: public SfxPoolItem
, public SwClient
47 BOOL bActive
; //Nur zur Steuerung (Erzeugung des Inhaltes)
50 SwFmtHeader( BOOL bOn
= FALSE
);
51 SwFmtHeader( SwFrmFmt
*pHeaderFmt
);
52 SwFmtHeader( const SwFmtHeader
&rCpy
);
54 SwFmtHeader
& operator=( const SwFmtHeader
&rCpy
);
58 // "pure virtual Methoden" vom SfxPoolItem
59 virtual int operator==( const SfxPoolItem
& ) const;
60 virtual SfxPoolItem
* Clone( SfxItemPool
* pPool
= 0 ) const;
61 virtual SfxItemPresentation
GetPresentation( SfxItemPresentation ePres
,
62 SfxMapUnit eCoreMetric
,
63 SfxMapUnit ePresMetric
,
65 const IntlWrapper
* pIntl
= 0 ) const;
67 const SwFrmFmt
*GetHeaderFmt() const { return (SwFrmFmt
*)pRegisteredIn
; }
68 SwFrmFmt
*GetHeaderFmt() { return (SwFrmFmt
*)pRegisteredIn
; }
70 BOOL
IsActive() const { return bActive
; }
71 void SetActive( BOOL bNew
= TRUE
) { bActive
= bNew
; }
74 //Fusszeile, fuer Seitenformate
75 //Client von FrmFmt das den Footer beschreibt.
77 class SW_DLLPUBLIC SwFmtFooter
: public SfxPoolItem
, public SwClient
79 BOOL bActive
; //Nur zur Steuerung (Erzeugung des Inhaltes)
82 SwFmtFooter( BOOL bOn
= FALSE
);
83 SwFmtFooter( SwFrmFmt
*pFooterFmt
);
84 SwFmtFooter( const SwFmtFooter
&rCpy
);
86 SwFmtFooter
& operator=( const SwFmtFooter
&rCpy
);
90 // "pure virtual Methoden" vom SfxPoolItem
91 virtual int operator==( const SfxPoolItem
& ) const;
92 virtual SfxPoolItem
* Clone( SfxItemPool
* pPool
= 0 ) const;
93 virtual SfxItemPresentation
GetPresentation( SfxItemPresentation ePres
,
94 SfxMapUnit eCoreMetric
,
95 SfxMapUnit ePresMetric
,
97 const IntlWrapper
* pIntl
= 0 ) const;
99 const SwFrmFmt
*GetFooterFmt() const { return (SwFrmFmt
*)pRegisteredIn
; }
100 SwFrmFmt
*GetFooterFmt() { return (SwFrmFmt
*)pRegisteredIn
; }
102 BOOL
IsActive() const { return bActive
; }
103 void SetActive( BOOL bNew
= TRUE
) { bActive
= bNew
; }
106 inline const SwFmtHeader
&SwAttrSet::GetHeader(BOOL bInP
) const
107 { return (const SwFmtHeader
&)Get( RES_HEADER
,bInP
); }
108 inline const SwFmtFooter
&SwAttrSet::GetFooter(BOOL bInP
) const
109 { return (const SwFmtFooter
&)Get( RES_FOOTER
,bInP
); }
111 inline const SwFmtHeader
&SwFmt::GetHeader(BOOL bInP
) const
112 { return aSet
.GetHeader(bInP
); }
113 inline const SwFmtFooter
&SwFmt::GetFooter(BOOL bInP
) const
114 { return aSet
.GetFooter(bInP
); }