1*1d2dbeb0SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*1d2dbeb0SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*1d2dbeb0SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*1d2dbeb0SAndrew Rist * distributed with this work for additional information 6*1d2dbeb0SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*1d2dbeb0SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*1d2dbeb0SAndrew Rist * "License"); you may not use this file except in compliance 9*1d2dbeb0SAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 11*1d2dbeb0SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 13*1d2dbeb0SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*1d2dbeb0SAndrew Rist * software distributed under the License is distributed on an 15*1d2dbeb0SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*1d2dbeb0SAndrew Rist * KIND, either express or implied. See the License for the 17*1d2dbeb0SAndrew Rist * specific language governing permissions and limitations 18*1d2dbeb0SAndrew Rist * under the License. 19cdf0e10cSrcweir * 20*1d2dbeb0SAndrew Rist *************************************************************/ 21*1d2dbeb0SAndrew Rist 22*1d2dbeb0SAndrew Rist 23cdf0e10cSrcweir #ifndef _FMTHDFT_HXX 24cdf0e10cSrcweir #define _FMTHDFT_HXX 25cdf0e10cSrcweir 26cdf0e10cSrcweir #include <hintids.hxx> 27cdf0e10cSrcweir #include <format.hxx> 28cdf0e10cSrcweir #include <svl/poolitem.hxx> 29cdf0e10cSrcweir #include <calbck.hxx> 30cdf0e10cSrcweir 31cdf0e10cSrcweir class SwFrmFmt; 32cdf0e10cSrcweir class IntlWrapper; 33cdf0e10cSrcweir class SwFmt; 34cdf0e10cSrcweir 35cdf0e10cSrcweir //Kopfzeile, fuer Seitenformate 36cdf0e10cSrcweir //Client von FrmFmt das den Header beschreibt. 37cdf0e10cSrcweir 38cdf0e10cSrcweir class SW_DLLPUBLIC SwFmtHeader: public SfxPoolItem, public SwClient 39cdf0e10cSrcweir { 40cdf0e10cSrcweir sal_Bool bActive; //Nur zur Steuerung (Erzeugung des Inhaltes) 41cdf0e10cSrcweir 42cdf0e10cSrcweir public: 43cdf0e10cSrcweir SwFmtHeader( sal_Bool bOn = sal_False ); 44cdf0e10cSrcweir SwFmtHeader( SwFrmFmt *pHeaderFmt ); 45cdf0e10cSrcweir SwFmtHeader( const SwFmtHeader &rCpy ); 46cdf0e10cSrcweir ~SwFmtHeader(); 47cdf0e10cSrcweir SwFmtHeader& operator=( const SwFmtHeader &rCpy ); 48cdf0e10cSrcweir 49cdf0e10cSrcweir TYPEINFO(); 50cdf0e10cSrcweir 51cdf0e10cSrcweir // "pure virtual Methoden" vom SfxPoolItem 52cdf0e10cSrcweir virtual int operator==( const SfxPoolItem& ) const; 53cdf0e10cSrcweir virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; 54cdf0e10cSrcweir virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, 55cdf0e10cSrcweir SfxMapUnit eCoreMetric, 56cdf0e10cSrcweir SfxMapUnit ePresMetric, 57cdf0e10cSrcweir String &rText, 58cdf0e10cSrcweir const IntlWrapper* pIntl = 0 ) const; 59cdf0e10cSrcweir 60cdf0e10cSrcweir const SwFrmFmt *GetHeaderFmt() const { return (SwFrmFmt*)GetRegisteredIn(); } 61cdf0e10cSrcweir SwFrmFmt *GetHeaderFmt() { return (SwFrmFmt*)GetRegisteredIn(); } 62cdf0e10cSrcweir 63cdf0e10cSrcweir void RegisterToFormat( SwFmt& rFmt ); 64cdf0e10cSrcweir sal_Bool IsActive() const { return bActive; } 65cdf0e10cSrcweir void SetActive( sal_Bool bNew = sal_True ) { bActive = bNew; } 66cdf0e10cSrcweir }; 67cdf0e10cSrcweir 68cdf0e10cSrcweir 69cdf0e10cSrcweir //Fusszeile, fuer Seitenformate 70cdf0e10cSrcweir //Client von FrmFmt das den Footer beschreibt. 71cdf0e10cSrcweir 72cdf0e10cSrcweir class SW_DLLPUBLIC SwFmtFooter: public SfxPoolItem, public SwClient 73cdf0e10cSrcweir { 74cdf0e10cSrcweir sal_Bool bActive; //Nur zur Steuerung (Erzeugung des Inhaltes) 75cdf0e10cSrcweir 76cdf0e10cSrcweir public: 77cdf0e10cSrcweir SwFmtFooter( sal_Bool bOn = sal_False ); 78cdf0e10cSrcweir SwFmtFooter( SwFrmFmt *pFooterFmt ); 79cdf0e10cSrcweir SwFmtFooter( const SwFmtFooter &rCpy ); 80cdf0e10cSrcweir ~SwFmtFooter(); 81cdf0e10cSrcweir SwFmtFooter& operator=( const SwFmtFooter &rCpy ); 82cdf0e10cSrcweir 83cdf0e10cSrcweir TYPEINFO(); 84cdf0e10cSrcweir 85cdf0e10cSrcweir // "pure virtual Methoden" vom SfxPoolItem 86cdf0e10cSrcweir virtual int operator==( const SfxPoolItem& ) const; 87cdf0e10cSrcweir virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; 88cdf0e10cSrcweir virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, 89cdf0e10cSrcweir SfxMapUnit eCoreMetric, 90cdf0e10cSrcweir SfxMapUnit ePresMetric, 91cdf0e10cSrcweir String &rText, 92cdf0e10cSrcweir const IntlWrapper* pIntl = 0 ) const; 93cdf0e10cSrcweir 94cdf0e10cSrcweir const SwFrmFmt *GetFooterFmt() const { return (SwFrmFmt*)GetRegisteredIn(); } 95cdf0e10cSrcweir SwFrmFmt *GetFooterFmt() { return (SwFrmFmt*)GetRegisteredIn(); } 96cdf0e10cSrcweir 97cdf0e10cSrcweir void RegisterToFormat( SwFmt& rFmt ); 98cdf0e10cSrcweir sal_Bool IsActive() const { return bActive; } 99cdf0e10cSrcweir void SetActive( sal_Bool bNew = sal_True ) { bActive = bNew; } 100cdf0e10cSrcweir }; 101cdf0e10cSrcweir 102cdf0e10cSrcweir inline const SwFmtHeader &SwAttrSet::GetHeader(sal_Bool bInP) const 103cdf0e10cSrcweir { return (const SwFmtHeader&)Get( RES_HEADER,bInP); } 104cdf0e10cSrcweir inline const SwFmtFooter &SwAttrSet::GetFooter(sal_Bool bInP) const 105cdf0e10cSrcweir { return (const SwFmtFooter&)Get( RES_FOOTER,bInP); } 106cdf0e10cSrcweir 107cdf0e10cSrcweir inline const SwFmtHeader &SwFmt::GetHeader(sal_Bool bInP) const 108cdf0e10cSrcweir { return aSet.GetHeader(bInP); } 109cdf0e10cSrcweir inline const SwFmtFooter &SwFmt::GetFooter(sal_Bool bInP) const 110cdf0e10cSrcweir { return aSet.GetFooter(bInP); } 111cdf0e10cSrcweir 112cdf0e10cSrcweir #endif 113cdf0e10cSrcweir 114