kmmsglist.h
00001 /* 00002 * kmail: KDE mail client 00003 * Copyright (c) 1996-1998 Stefan Taferner <taferner@kde.org> 00004 * 00005 * This program is free software; you can redistribute it and/or modify 00006 * it under the terms of the GNU General Public License as published by 00007 * the Free Software Foundation; either version 2 of the License, or 00008 * (at your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License 00016 * along with this program; if not, write to the Free Software 00017 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00018 * 00019 */ 00020 #ifndef kmmsglist_h 00021 #define kmmsglist_h 00022 00023 #include "kmmsgbase.h" 00024 00025 #include <tqmemarray.h> 00026 00037 class KMMsgList: public TQMemArray<KMMsgBase*> 00038 { 00039 public: 00040 00042 KMMsgList(int initialSize=32); 00043 00045 ~KMMsgList(); 00046 00049 void remove(unsigned int idx); 00050 00053 KMMsgBase* take(unsigned int idx); 00054 00057 void insert(unsigned int idx, KMMsgBase* msg, bool syncDict = true); 00058 00062 unsigned int append(KMMsgBase* msg, bool syncDict = true); 00063 00067 void clear(bool autoDelete=TRUE, bool syncDict = false); 00068 00071 bool resize(unsigned int size); 00072 00075 bool reset(unsigned int size); 00076 00080 void set(unsigned int idx, KMMsgBase* msg); 00081 00083 unsigned int high() const { return mHigh; } 00084 00086 unsigned int count() const { return mCount; } 00087 00088 protected: 00090 void rethinkHigh(); 00091 00092 unsigned int mHigh, mCount; 00093 }; 00094 00095 00096 #endif /*kmmsglist_h*/