filters
listepara.h
00001 /* A PARA IS A TITLE, A SET OF WORDS OR A LIST. TO KNOW ITS TYPE, 00002 * YOU MUST LOOK AT IN THE LAYOUT CLASS. 00003 */ 00004 /* 00005 ** Header file for inclusion with kword_xml2latex.c 00006 ** 00007 ** Copyright (C) 2000 Robert JACOLIN 00008 ** 00009 ** This library is free software; you can redistribute it and/or 00010 ** modify it under the terms of the GNU Library General Public 00011 ** License as published by the Free Software Foundation; either 00012 ** version 2 of the License, or (at your option) any later version. 00013 ** 00014 ** This library is distributed in the hope that it will be useful, 00015 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00017 ** Library General Public License for more details. 00018 ** 00019 ** To receive a copy of the GNU Library General Public License, write to the 00020 ** Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00021 * Boston, MA 02110-1301, USA. 00022 ** 00023 */ 00024 00025 #ifndef __KWORD_LISTPARA_H__ 00026 #define __KWORD_LISTPARA_H__ 00027 00028 #include "para.h" 00029 00030 class ListPara: public Para 00031 { 00032 Para *_start, *_end; 00033 int _size; 00034 00035 public: 00036 ListPara(); 00037 virtual ~ListPara(); 00038 00039 void initialiser(Para*); 00040 void add(Para*); 00041 void rem(); 00042 00043 Para* getFirst() const { return _start; } 00044 Para* getLast() const { return _end; } 00045 int getSize() const { return _size; } 00046 00047 void vider(); 00048 00049 private: 00050 }; 00051 00052 class ParaIter { 00053 Para *_courant; 00054 00055 protected: 00056 00057 public: 00062 00063 ParaIter() { _courant = 0; } 00065 ParaIter(ListPara &l) { _courant = l.getFirst(); } 00067 ParaIter(ListPara *l) { 00068 if(l != 0) 00069 _courant = l->getFirst(); 00070 else 00071 _courant = 0; 00072 } 00074 00079 00080 virtual ~ParaIter() { } 00082 00087 00088 Para* getCourant() const { return _courant; } 00089 bool isTerminate() const { return (_courant == 0); } 00091 00096 void next () { _courant = _courant->getNext(); } 00097 void setList(const ListPara &l) { _courant = l.getFirst(); } 00099 00104 00105 }; 00106 00107 #endif /* __KWORD_LISTPARA_H__ */