selectinfo.h
00001 /********************************************************************** 00002 * 00003 * imapinfo.h - IMAP4rev1 SELECT / EXAMINE handler 00004 * Copyright (C) 2000 Sven Carstens <s.carstens@gmx.de> 00005 * 00006 * This program is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; either version 2 of the License, or 00009 * (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License along 00017 * with this program; if not, write to the Free Software Foundation, Inc., 00018 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00019 * 00020 * Send comments and bug fixes to 00021 * 00022 *********************************************************************/ 00023 00024 #ifndef KIOSLAVE_SELECTINFO_H 00025 #define KIOSLAVE_SELECTINFO_H 00026 00027 #include <QStringList> 00028 #include <QString> 00029 00030 //class handling the info we get on EXAMINE and SELECT 00031 class imapInfo 00032 { 00033 public: 00034 00035 imapInfo (); 00036 imapInfo (const QStringList &); 00037 imapInfo (const imapInfo &); 00038 imapInfo & operator = (const imapInfo &); 00039 00040 ulong _flags (const QString &) const; 00041 00042 void setCount (ulong l) 00043 { 00044 countAvailable_ = true; 00045 count_ = l; 00046 } 00047 00048 void setRecent (ulong l) 00049 { 00050 recentAvailable_ = true; 00051 recent_ = l; 00052 } 00053 00054 void setUnseen (ulong l) 00055 { 00056 unseenAvailable_ = true; 00057 unseen_ = l; 00058 } 00059 00060 void setUidValidity (ulong l) 00061 { 00062 uidValidityAvailable_ = true; 00063 uidValidity_ = l; 00064 } 00065 00066 void setUidNext (ulong l) 00067 { 00068 uidNextAvailable_ = true; 00069 uidNext_ = l; 00070 } 00071 00072 void setFlags (ulong l) 00073 { 00074 flagsAvailable_ = true; 00075 flags_ = l; 00076 } 00077 00078 void setFlags (const QString & inFlag) 00079 { 00080 flagsAvailable_ = true; 00081 flags_ = _flags (inFlag); 00082 } 00083 00084 void setPermanentFlags (ulong l) 00085 { 00086 permanentFlagsAvailable_ = true; 00087 permanentFlags_ = l; 00088 } 00089 00090 void setPermanentFlags (const QString & inFlag) 00091 { 00092 permanentFlagsAvailable_ = true; 00093 permanentFlags_ = _flags (inFlag); 00094 } 00095 00096 void setReadWrite (bool b) 00097 { 00098 readWriteAvailable_ = true; 00099 readWrite_ = b; 00100 } 00101 00102 ulong count () const 00103 { 00104 return count_; 00105 } 00106 00107 ulong recent () const 00108 { 00109 return recent_; 00110 } 00111 00112 ulong unseen () const 00113 { 00114 return unseen_; 00115 } 00116 00117 ulong uidValidity () const 00118 { 00119 return uidValidity_; 00120 } 00121 00122 ulong uidNext () const 00123 { 00124 return uidNext_; 00125 } 00126 00127 ulong flags () const 00128 { 00129 return flags_; 00130 } 00131 00132 ulong permanentFlags () const 00133 { 00134 return permanentFlags_; 00135 } 00136 00137 bool readWrite () const 00138 { 00139 return readWrite_; 00140 } 00141 00142 ulong countAvailable () const 00143 { 00144 return countAvailable_; 00145 } 00146 00147 ulong recentAvailable () const 00148 { 00149 return recentAvailable_; 00150 } 00151 00152 ulong unseenAvailable () const 00153 { 00154 return unseenAvailable_; 00155 } 00156 00157 ulong uidValidityAvailable () const 00158 { 00159 return uidValidityAvailable_; 00160 } 00161 00162 ulong uidNextAvailable () const 00163 { 00164 return uidNextAvailable_; 00165 } 00166 00167 ulong flagsAvailable () const 00168 { 00169 return flagsAvailable_; 00170 } 00171 00172 ulong permanentFlagsAvailable () const 00173 { 00174 return permanentFlagsAvailable_; 00175 } 00176 00177 bool readWriteAvailable () const 00178 { 00179 return readWriteAvailable_; 00180 } 00181 00182 private: 00183 00184 ulong count_; 00185 ulong recent_; 00186 ulong unseen_; 00187 ulong uidValidity_; 00188 ulong uidNext_; 00189 ulong flags_; 00190 ulong permanentFlags_; 00191 bool readWrite_; 00192 00193 bool countAvailable_; 00194 bool recentAvailable_; 00195 bool unseenAvailable_; 00196 bool uidValidityAvailable_; 00197 bool uidNextAvailable_; 00198 bool flagsAvailable_; 00199 bool permanentFlagsAvailable_; 00200 bool readWriteAvailable_; 00201 }; 00202 00203 #endif // KIOSLAVE_SELECTINFO_H