kioslaves/imap4

imapinfo.h

00001 #ifndef _IMAPINFO_H
00002 #define _IMAPINFO_H
00003 /**********************************************************************
00004  *
00005  *   imapinfo.h  - IMAP4rev1 SELECT / EXAMINE handler
00006  *   Copyright (C) 2000 Sven Carstens
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 
00035   enum MessageAttribute
00036   {
00037     Seen = 1 << 0,
00038     Answered = 1 << 1,
00039     Flagged = 1 << 2,
00040     Deleted = 1 << 3,
00041     Draft = 1 << 4,
00042     Recent = 1 << 5,
00043     User = 1 << 6
00044   };
00045 
00046 
00047     imapInfo ();
00048     imapInfo (const QStringList &);
00049     imapInfo (const imapInfo &);
00050     imapInfo & operator = (const imapInfo &);
00051 
00052   static ulong _flags (const QCString &);
00053 
00054   void setCount (ulong l)
00055   {
00056     countAvailable_ = true;
00057     count_ = l;
00058   }
00059 
00060   void setRecent (ulong l)
00061   {
00062     recentAvailable_ = true;
00063     recent_ = l;
00064   }
00065 
00066   void setUnseen (ulong l)
00067   {
00068     unseenAvailable_ = true;
00069     unseen_ = l;
00070   }
00071 
00072   void setUidValidity (ulong l)
00073   {
00074     uidValidityAvailable_ = true;
00075     uidValidity_ = l;
00076   }
00077 
00078   void setUidNext (ulong l)
00079   {
00080     uidNextAvailable_ = true;
00081     uidNext_ = l;
00082   }
00083 
00084   void setFlags (ulong l)
00085   {
00086     flagsAvailable_ = true;
00087     flags_ = l;
00088   }
00089 
00090   void setFlags (const QCString & inFlag)
00091   {
00092     flagsAvailable_ = true;
00093     flags_ = _flags (inFlag);
00094   }
00095 
00096   void setPermanentFlags (ulong l)
00097   {
00098     permanentFlagsAvailable_ = true;
00099     permanentFlags_ = l;
00100   }
00101 
00102   void setPermanentFlags (const QCString & inFlag)
00103   {
00104     permanentFlagsAvailable_ = true;
00105     permanentFlags_ = _flags (inFlag);
00106   }
00107 
00108   void setReadWrite (bool b)
00109   {
00110     readWriteAvailable_ = true;
00111     readWrite_ = b;
00112   }
00113 
00114   void setAlert( const char* cstr )
00115   {
00116     alert_ = cstr;
00117   }
00118 
00119   ulong count () const
00120   {
00121     return count_;
00122   }
00123 
00124   ulong recent () const
00125   {
00126     return recent_;
00127   }
00128 
00129   ulong unseen () const
00130   {
00131     return unseen_;
00132   }
00133 
00134   ulong uidValidity () const
00135   {
00136     return uidValidity_;
00137   }
00138 
00139   ulong uidNext () const
00140   {
00141     return uidNext_;
00142   }
00143 
00144   ulong flags () const
00145   {
00146     return flags_;
00147   }
00148 
00149   ulong permanentFlags () const
00150   {
00151     return permanentFlags_;
00152   }
00153 
00154   bool readWrite () const
00155   {
00156     return readWrite_;
00157   }
00158 
00159   ulong countAvailable () const
00160   {
00161     return countAvailable_;
00162   }
00163 
00164   ulong recentAvailable () const
00165   {
00166     return recentAvailable_;
00167   }
00168 
00169   ulong unseenAvailable () const
00170   {
00171     return unseenAvailable_;
00172   }
00173 
00174   ulong uidValidityAvailable () const
00175   {
00176     return uidValidityAvailable_;
00177   }
00178 
00179   ulong uidNextAvailable () const
00180   {
00181     return uidNextAvailable_;
00182   }
00183 
00184   ulong flagsAvailable () const
00185   {
00186     return flagsAvailable_;
00187   }
00188 
00189   ulong permanentFlagsAvailable () const
00190   {
00191     return permanentFlagsAvailable_;
00192   }
00193 
00194   bool readWriteAvailable () const
00195   {
00196     return readWriteAvailable_;
00197   }
00198 
00199   QCString alert() const
00200   {
00201     return alert_;
00202   }
00203 
00204 private:
00205 
00206   QCString alert_;
00207 
00208   ulong count_;
00209   ulong recent_;
00210   ulong unseen_;
00211   ulong uidValidity_;
00212   ulong uidNext_;
00213   ulong flags_;
00214   ulong permanentFlags_;
00215   bool readWrite_;
00216 
00217   bool countAvailable_;
00218   bool recentAvailable_;
00219   bool unseenAvailable_;
00220   bool uidValidityAvailable_;
00221   bool uidNextAvailable_;
00222   bool flagsAvailable_;
00223   bool permanentFlagsAvailable_;
00224   bool readWriteAvailable_;
00225 };
00226 
00227 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys