kioslave/mbox
readmbox.h
00001 /* 00002 * This is a simple kioslave to handle mbox-files. 00003 * Copyright (C) 2004 Mart Kelder (mart.kde@hccnet.nl) 00004 * 00005 * This library is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU Lesser General Public 00007 * License as published by the Free Software Foundation; either 00008 * version 2 of the License, or (at your option) any later version. 00009 * 00010 * This library 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 GNU 00013 * Lesser General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU Lesser General Public 00016 * License along with this library; if not, write to the Free Software 00017 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00018 */ 00019 #ifndef READMBOX_H 00020 #define READMBOX_H 00021 00022 #include "mboxfile.h" 00023 //Added by qt3to4: 00024 #include <QTextStream> 00025 00026 class UrlInfo; 00027 class MBox; 00028 00029 class QFile; 00030 class QString; 00031 class QTextStream; 00032 00033 struct utimbuf; 00034 00038 class ReadMBox : public MBoxFile 00039 { 00040 public: 00049 ReadMBox( const UrlInfo* info, MBoxProtocol* parent, bool onlynew = false, bool savetime = false ); 00050 00054 ~ReadMBox(); 00055 00060 QString currentLine() const; 00061 00067 QString currentID() const; 00068 00075 bool nextLine(); 00076 00083 bool searchMessage( const QString& id ); 00084 00091 unsigned int skipMessage(); 00092 00096 void rewind(); 00097 00102 bool atEnd() const; 00103 00108 bool inListing() const; 00109 private: 00114 bool open( bool savetime ); 00115 00119 void close(); 00120 00121 private: 00122 QFile* m_file; 00123 QTextStream* m_stream; 00124 QString m_current_line; 00125 QString m_current_id; 00126 bool m_atend; 00127 00128 struct utimbuf* m_prev_time; 00129 00130 bool m_only_new, m_savetime; 00131 00132 bool m_status, m_prev_status, m_header; 00133 }; 00134 #endif