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