kioslaves

selectinfo.h

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