merged tag ooo/OOO330_m14
[LibreOffice.git] / sw / inc / fmthdft.hxx
blob14c71d6a02642a6811275ebe6af7e4f29de0e593
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
27 #ifndef _FMTHDFT_HXX
28 #define _FMTHDFT_HXX
30 #include <hintids.hxx>
31 #include <format.hxx>
32 #include <svl/poolitem.hxx>
33 #include <calbck.hxx>
35 class SwFrmFmt;
36 class IntlWrapper;
39 //Kopfzeile, fuer Seitenformate
40 //Client von FrmFmt das den Header beschreibt.
42 class SW_DLLPUBLIC SwFmtHeader: public SfxPoolItem, public SwClient
44 BOOL bActive; //Nur zur Steuerung (Erzeugung des Inhaltes)
46 public:
47 SwFmtHeader( BOOL bOn = FALSE );
48 SwFmtHeader( SwFrmFmt *pHeaderFmt );
49 SwFmtHeader( const SwFmtHeader &rCpy );
50 ~SwFmtHeader();
51 SwFmtHeader& operator=( const SwFmtHeader &rCpy );
53 TYPEINFO();
55 // "pure virtual Methoden" vom SfxPoolItem
56 virtual int operator==( const SfxPoolItem& ) const;
57 virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
58 virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
59 SfxMapUnit eCoreMetric,
60 SfxMapUnit ePresMetric,
61 String &rText,
62 const IntlWrapper* pIntl = 0 ) const;
64 const SwFrmFmt *GetHeaderFmt() const { return (SwFrmFmt*)pRegisteredIn; }
65 SwFrmFmt *GetHeaderFmt() { return (SwFrmFmt*)pRegisteredIn; }
67 BOOL IsActive() const { return bActive; }
68 void SetActive( BOOL bNew = TRUE ) { bActive = bNew; }
71 //Fusszeile, fuer Seitenformate
72 //Client von FrmFmt das den Footer beschreibt.
74 class SW_DLLPUBLIC SwFmtFooter: public SfxPoolItem, public SwClient
76 BOOL bActive; //Nur zur Steuerung (Erzeugung des Inhaltes)
78 public:
79 SwFmtFooter( BOOL bOn = FALSE );
80 SwFmtFooter( SwFrmFmt *pFooterFmt );
81 SwFmtFooter( const SwFmtFooter &rCpy );
82 ~SwFmtFooter();
83 SwFmtFooter& operator=( const SwFmtFooter &rCpy );
85 TYPEINFO();
87 // "pure virtual Methoden" vom SfxPoolItem
88 virtual int operator==( const SfxPoolItem& ) const;
89 virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
90 virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
91 SfxMapUnit eCoreMetric,
92 SfxMapUnit ePresMetric,
93 String &rText,
94 const IntlWrapper* pIntl = 0 ) const;
96 const SwFrmFmt *GetFooterFmt() const { return (SwFrmFmt*)pRegisteredIn; }
97 SwFrmFmt *GetFooterFmt() { return (SwFrmFmt*)pRegisteredIn; }
99 BOOL IsActive() const { return bActive; }
100 void SetActive( BOOL bNew = TRUE ) { bActive = bNew; }
103 inline const SwFmtHeader &SwAttrSet::GetHeader(BOOL bInP) const
104 { return (const SwFmtHeader&)Get( RES_HEADER,bInP); }
105 inline const SwFmtFooter &SwAttrSet::GetFooter(BOOL bInP) const
106 { return (const SwFmtFooter&)Get( RES_FOOTER,bInP); }
108 inline const SwFmtHeader &SwFmt::GetHeader(BOOL bInP) const
109 { return aSet.GetHeader(bInP); }
110 inline const SwFmtFooter &SwFmt::GetFooter(BOOL bInP) const
111 { return aSet.GetFooter(bInP); }
113 #endif