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: cntfrm.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 "flowfrm.hxx"
42 //Implementiert in cntfrm.cxx, wird von cntfrm.cxx und crsrsh.cxx angezogen
43 extern BOOL
GetFrmInPage( const SwCntntFrm
*, SwWhichPage
, SwPosPage
, SwPaM
* );
45 class SwCntntFrm
: public SwFrm
, public SwFlowFrm
47 friend void MakeNxt( SwFrm
*pFrm
, SwFrm
*pNxt
); //ruft MakePrtArea
49 // --> OD 2007-11-26 #b6614158#
50 // parameter <bObjsInNewUpper>, indicating that objects are existing in
51 // remaining area of new upper
52 BOOL
_WouldFit( SwTwips nSpace
,
53 SwLayoutFrm
*pNewUpper
,
55 const bool bObjsInNewUpper
);
57 virtual void MakeAll();
59 void _UpdateAttr( SfxPoolItem
*, SfxPoolItem
*, BYTE
&,
60 SwAttrSetChg
*pa
= 0, SwAttrSetChg
*pb
= 0 );
62 virtual BOOL
ShouldBwdMoved( SwLayoutFrm
*pNewUpper
, BOOL
, BOOL
& );
64 const SwCntntFrm
* ImplGetNextCntntFrm( bool bFwd
) const;
68 BOOL
MakePrtArea( const SwBorderAttrs
& );
70 virtual void Modify( SfxPoolItem
*, SfxPoolItem
* );
71 virtual SwTwips
ShrinkFrm( SwTwips
, BOOL bTst
= FALSE
, BOOL bInfo
= FALSE
);
72 virtual SwTwips
GrowFrm ( SwTwips
, BOOL bTst
= FALSE
, BOOL bInfo
= FALSE
);
74 SwCntntFrm( SwCntntNode
* const );
77 virtual ~SwCntntFrm();
78 TYPEINFO(); //bereits in Basisklassen drin
81 virtual void Paste( SwFrm
* pParent
, SwFrm
* pSibling
= 0 );
83 inline SwCntntNode
*GetNode();
84 inline const SwCntntNode
*GetNode() const;
85 USHORT
GetSectionLevel();
87 inline const SwCntntFrm
*GetFollow() const;
88 inline SwCntntFrm
*GetFollow();
89 SwTxtFrm
* FindMaster() const;
91 //Layoutabhaengiges Cursortravelling
92 virtual BOOL
LeftMargin( SwPaM
* ) const;
93 virtual BOOL
RightMargin( SwPaM
*, BOOL bAPI
= FALSE
) const;
94 virtual BOOL
UnitUp( SwPaM
*, const SwTwips nOffset
= 0,
95 BOOL bSetInReadOnly
= FALSE
) const;
96 virtual BOOL
UnitDown( SwPaM
*, const SwTwips nOffset
= 0,
97 BOOL bSetInReadOnly
= FALSE
) const;
98 inline BOOL
StartNextPage( SwPaM
* ) const;
99 inline BOOL
StartPrevPage( SwPaM
* ) const;
100 inline BOOL
StartCurrPage( SwPaM
* ) const;
101 inline BOOL
EndCurrPage( SwPaM
* ) const;
102 inline BOOL
EndNextPage( SwPaM
* ) const;
103 inline BOOL
EndPrevPage( SwPaM
* ) const;
105 // nMaxHeight is the required height
106 // bSplit indicates, that the paragraph has to be split
107 // bTst indicates, that we are currently doing a test formatting
108 virtual sal_Bool
WouldFit( SwTwips
&nMaxHeight
, sal_Bool
&bSplit
, sal_Bool bTst
);
110 BOOL
MoveFtnCntFwd( BOOL
, SwFtnBossFrm
* );//von MoveFwd gerufen bei Ftn-Inhalt
112 inline SwCntntFrm
* GetNextCntntFrm() const;
113 inline SwCntntFrm
* GetPrevCntntFrm() const;
116 inline SwCntntFrm
* SwCntntFrm::GetNextCntntFrm() const
118 if ( GetNext() && GetNext()->IsCntntFrm() )
119 return (SwCntntFrm
*)GetNext();
121 return (SwCntntFrm
*)ImplGetNextCntntFrm( true );
124 inline SwCntntFrm
* SwCntntFrm::GetPrevCntntFrm() const
126 if ( GetPrev() && GetPrev()->IsCntntFrm() )
127 return (SwCntntFrm
*)GetPrev();
129 return (SwCntntFrm
*)ImplGetNextCntntFrm( false );
132 inline SwCntntNode
*SwCntntFrm::GetNode()
134 return (SwCntntNode
*)GetDep();
136 inline const SwCntntNode
*SwCntntFrm::GetNode() const
138 return (SwCntntNode
*)GetDep();
141 inline const SwCntntFrm
*SwCntntFrm::GetFollow() const
143 return (const SwCntntFrm
*)SwFlowFrm::GetFollow();
145 inline SwCntntFrm
*SwCntntFrm::GetFollow()
147 return (SwCntntFrm
*)SwFlowFrm::GetFollow();