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 _NODE2LAY_HXX 28 #define _NODE2LAY_HXX 29 30 #include <tools/solar.h> 31 32 /* -----------------23.02.99 11:33------------------- 33 * Die Klasse SwNode2Layout stellt die Verbindung von Nodes zum Layout her. 34 * Sie liefert einen intelligenten Iterator ueber die zum Node oder Nodebereich 35 * gehoerenden Frames. Je nach Zweck der Iteration, z.B. um vor oder hinter 36 * den Frames andere Frames einzufuegen, werden Master/Follows erkannt und nur 37 * die relevanten zurueckgegeben. Auch wiederholte Tabellenueberschriften werden 38 * beachtet. 39 * Es ist auch moeglich, ueber SectionNodes zu iterieren, die durch Schachtelung 40 * manchmal gar keinem SectionFrm direkt zugeordnet sind, manchmal aber sogar 41 * mehreren. 42 * SwNode2Layout ist ein Schnittstelle zwischen der aufrufenden Methode und 43 * einem SwClientIter, sie waehlt je nach Aufgabenstellung das richtige 44 * SwModify aus, erzeugt einen SwClientIter und filtert dessen Iterationen 45 * je nach Aufgabenstellung. 46 * Die Aufgabenstellung wird durch die Wahl des Ctors bestimmt. 47 * 1. Das Einsammeln der UpperFrms, damit spaeter RestoreUpperFrms wird, 48 * wird von MakeFrms gerufen, wenn es keinen PrevNext gibt, vor/hinter den 49 * die Frames gehaengt werden koennen. 50 * 2. Die Lieferung der Frames hinter/vor die die neuen Frames eines Nodes 51 * gehaengt werden muessen, ebenfalls von MakeFrms gerufen. 52 * --------------------------------------------------*/ 53 54 class SwNode2LayImpl; 55 class SwFrm; 56 class SwLayoutFrm; 57 class SwNode; 58 class SwNodes; 59 class Point; 60 struct SwPosition; 61 62 class SwNode2Layout 63 { 64 SwNode2LayImpl *pImpl; 65 public: 66 // Dieser Ctor ist zum Einsammeln der UpperFrms gedacht. 67 SwNode2Layout( const SwNode& rNd ); 68 // Dieser Ctor ist fuer das Einfuegen vor oder hinter rNd gedacht, 69 // nIdx ist der Index des einzufuegenden Nodes 70 SwNode2Layout( const SwNode& rNd, sal_uLong nIdx ); 71 ~SwNode2Layout(); 72 SwFrm* NextFrm(); 73 SwLayoutFrm* UpperFrm( SwFrm* &rpFrm, const SwNode& rNode ); 74 void RestoreUpperFrms( SwNodes& rNds, sal_uLong nStt, sal_uLong nEnd ); 75 76 SwFrm *GetFrm( const Point* pDocPos = 0, 77 const SwPosition *pPos = 0, 78 const sal_Bool bCalcFrm = sal_True ) const; 79 }; 80 81 #endif 82