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 _CNTFRM_HXX 24 #define _CNTFRM_HXX 25 #include "frame.hxx" 26 #include "flowfrm.hxx" 27 #include "cshtyp.hxx" 28 29 class SwLayoutFrm; 30 class SwCntntNode; 31 class SwBorderAttrs; 32 class SwAttrSetChg; 33 class SwTxtFrm; 34 35 //Implementiert in cntfrm.cxx, wird von cntfrm.cxx und crsrsh.cxx angezogen 36 extern sal_Bool GetFrmInPage( const SwCntntFrm*, SwWhichPage, SwPosPage, SwPaM* ); 37 38 class SwCntntFrm: public SwFrm, public SwFlowFrm 39 { 40 friend void MakeNxt( SwFrm *pFrm, SwFrm *pNxt ); //ruft MakePrtArea 41 42 // --> OD 2007-11-26 #b6614158# 43 // parameter <bObjsInNewUpper>, indicating that objects are existing in 44 // remaining area of new upper 45 sal_Bool _WouldFit( SwTwips nSpace, 46 SwLayoutFrm *pNewUpper, 47 sal_Bool bTstMove, 48 const bool bObjsInNewUpper ); 49 // <-- 50 virtual void MakeAll(); 51 52 void _UpdateAttr( const SfxPoolItem*, const SfxPoolItem*, sal_uInt8 &, 53 SwAttrSetChg *pa = 0, SwAttrSetChg *pb = 0 ); 54 55 virtual sal_Bool ShouldBwdMoved( SwLayoutFrm *pNewUpper, sal_Bool, sal_Bool& ); 56 57 const SwCntntFrm* ImplGetNextCntntFrm( bool bFwd ) const; 58 59 protected: 60 61 sal_Bool MakePrtArea( const SwBorderAttrs & ); 62 63 virtual void Modify( const SfxPoolItem*, const SfxPoolItem* ); 64 virtual SwTwips ShrinkFrm( SwTwips, sal_Bool bTst = sal_False, sal_Bool bInfo = sal_False ); 65 virtual SwTwips GrowFrm ( SwTwips, sal_Bool bTst = sal_False, sal_Bool bInfo = sal_False ); 66 67 SwCntntFrm( SwCntntNode * const, SwFrm* ); 68 69 public: 70 virtual ~SwCntntFrm(); 71 TYPEINFO(); //bereits in Basisklassen drin 72 73 virtual void Cut(); 74 virtual void Paste( SwFrm* pParent, SwFrm* pSibling = 0 ); 75 76 inline SwCntntNode *GetNode(); 77 inline const SwCntntNode *GetNode() const; 78 sal_uInt16 GetSectionLevel(); 79 80 inline const SwCntntFrm *GetFollow() const; 81 inline SwCntntFrm *GetFollow(); 82 SwTxtFrm* FindMaster() const; 83 84 //Layoutabhaengiges Cursortravelling 85 virtual sal_Bool LeftMargin( SwPaM * ) const; 86 virtual sal_Bool RightMargin( SwPaM *, sal_Bool bAPI = sal_False ) const; 87 virtual sal_Bool UnitUp( SwPaM *, const SwTwips nOffset = 0, 88 sal_Bool bSetInReadOnly = sal_False ) const; 89 virtual sal_Bool UnitDown( SwPaM *, const SwTwips nOffset = 0, 90 sal_Bool bSetInReadOnly = sal_False ) const; 91 inline sal_Bool StartNextPage( SwPaM * ) const; 92 inline sal_Bool StartPrevPage( SwPaM * ) const; 93 inline sal_Bool StartCurrPage( SwPaM * ) const; 94 inline sal_Bool EndCurrPage( SwPaM * ) const; 95 inline sal_Bool EndNextPage( SwPaM * ) const; 96 inline sal_Bool EndPrevPage( SwPaM * ) const; 97 98 // nMaxHeight is the required height 99 // bSplit indicates, that the paragraph has to be split 100 // bTst indicates, that we are currently doing a test formatting 101 virtual sal_Bool WouldFit( SwTwips &nMaxHeight, sal_Bool &bSplit, sal_Bool bTst ); 102 103 sal_Bool MoveFtnCntFwd( sal_Bool, SwFtnBossFrm* );//von MoveFwd gerufen bei Ftn-Inhalt 104 105 inline SwCntntFrm* GetNextCntntFrm() const; 106 inline SwCntntFrm* GetPrevCntntFrm() const; 107 static bool CalcLowers( SwLayoutFrm* pLay, const SwLayoutFrm* pDontLeave, long nBottom, bool bSkipRowSpanCells ); 108 void RegisterToNode( SwCntntNode& ); 109 static void DelFrms( const SwCntntNode& ); 110 }; 111 112 inline SwCntntFrm* SwCntntFrm::GetNextCntntFrm() const 113 { 114 if ( GetNext() && GetNext()->IsCntntFrm() ) 115 return (SwCntntFrm*)GetNext(); 116 else 117 return (SwCntntFrm*)ImplGetNextCntntFrm( true ); 118 } 119 120 inline SwCntntFrm* SwCntntFrm::GetPrevCntntFrm() const 121 { 122 if ( GetPrev() && GetPrev()->IsCntntFrm() ) 123 return (SwCntntFrm*)GetPrev(); 124 else 125 return (SwCntntFrm*)ImplGetNextCntntFrm( false ); 126 } 127 128 inline SwCntntNode *SwCntntFrm::GetNode() 129 { 130 return (SwCntntNode*)GetDep(); 131 } 132 inline const SwCntntNode *SwCntntFrm::GetNode() const 133 { 134 return (SwCntntNode*)GetDep(); 135 } 136 137 inline const SwCntntFrm *SwCntntFrm::GetFollow() const 138 { 139 return (const SwCntntFrm*)SwFlowFrm::GetFollow(); 140 } 141 inline SwCntntFrm *SwCntntFrm::GetFollow() 142 { 143 return (SwCntntFrm*)SwFlowFrm::GetFollow(); 144 } 145 146 #endif 147