xref: /trunk/main/sw/inc/fmtcnct.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
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.
14  *
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).
20  *
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.
25  *
26  ************************************************************************/
27 #ifndef _FMTCNCT_HXX
28 #define _FMTCNCT_HXX
29 
30 #include <hintids.hxx>
31 #include <svl/poolitem.hxx>
32 #include <format.hxx>
33 #include <calbck.hxx>
34 
35 
36 class SwFlyFrmFmt;
37 class IntlWrapper;
38 
39 //Verbindung (Textfluss) zwischen zwei FlyFrms
40 
41 class SW_DLLPUBLIC SwFmtChain: public SfxPoolItem
42 {
43 	SwClient aPrev,	//Vorgaenger (SwFlyFrmFmt), wenn es diesen gibt.
44 			 aNext; //Nachfolger (SwFlyFrmFmt), wenn es diesen gibt.
45 
46 
47 public:
48 	SwFmtChain() : SfxPoolItem( RES_CHAIN ) {}
49 	SwFmtChain( const SwFmtChain &rCpy );
50 
51 	inline SwFmtChain &operator=( const SwFmtChain& );
52 
53 	// "pure virtual Methoden" vom SfxPoolItem
54 	virtual int             operator==( const SfxPoolItem& ) const;
55 	virtual SfxPoolItem*	Clone( SfxItemPool* pPool = 0 ) const;
56 	virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
57 									SfxMapUnit eCoreMetric,
58 									SfxMapUnit ePresMetric,
59 									String &rText,
60                                     const IntlWrapper*    pIntl = 0 ) const;
61 
62 	virtual	sal_Bool        	 QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
63 
64 	SwFlyFrmFmt* GetPrev() const { return (SwFlyFrmFmt*)aPrev.GetRegisteredIn(); }
65 	SwFlyFrmFmt* GetNext() const { return (SwFlyFrmFmt*)aNext.GetRegisteredIn(); }
66 
67 
68 	void SetPrev( SwFlyFrmFmt *pFmt );
69 	void SetNext( SwFlyFrmFmt *pFmt );
70 };
71 
72 SwFmtChain &SwFmtChain::operator=( const SwFmtChain &rCpy )
73 {
74 	SetPrev( rCpy.GetPrev() );
75 	SetNext( rCpy.GetNext() );
76 	return *this;
77 }
78 
79 
80 inline const SwFmtChain &SwAttrSet::GetChain(sal_Bool bInP) const
81 	{ return (const SwFmtChain&)Get( RES_CHAIN,bInP); }
82 
83 inline const SwFmtChain &SwFmt::GetChain(sal_Bool bInP) const
84 	{ return aSet.GetChain(bInP); }
85 
86 #endif
87 
88