kioslaves/imap4

imapcommand.h

00001 #ifndef _IMAPCOMMAND_H
00002 #define _IMAPCOMMAND_H
00003 /**********************************************************************
00004  *
00005  *   imapcommand.h  - IMAP4rev1 command 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 <tqstringlist.h>
00027 #include <tqstring.h>
00028 #include <tqmap.h>
00029 
00037 class imapCommand
00038 {
00039 public:
00040 
00044   imapCommand ();
00052   imapCommand (const TQString & command, const TQString & parameter);
00058   bool isComplete ();
00064   const TQString & result ();
00070   const TQString & resultInfo ();
00076   const TQString & parameter ();
00082   const TQString & command ();
00088   const TQString & id ();
00089 
00096   void setId (const TQString &);
00102   void setComplete ();
00109   void setResult (const TQString &);
00116   void setResultInfo (const TQString &);
00123   void setCommand (const TQString &);
00130   void setParameter (const TQString &);
00139   const TQString getStr ();
00140 
00146   static imapCommand *clientNoop ();
00156   static imapCommand *clientFetch (ulong uid, const TQString & fields,
00157                                    bool nouid = false);
00168   static imapCommand *clientFetch (ulong fromUid, ulong toUid,
00169                                    const TQString & fields, bool nouid =
00170                                    false);
00181   static imapCommand *clientFetch (const TQString & sequence,
00182                                    const TQString & fields, bool nouid =
00183                                    false);
00192   static imapCommand *clientList (const TQString & reference,
00193                                   const TQString & path, bool lsub = false);
00201   static imapCommand *clientSelect (const TQString & path, bool examine =
00202                                     false);
00208   static imapCommand *clientClose();
00215   static imapCommand *clienStatus (const TQString & path,
00216                                     const TQString & parameters);
00224   static imapCommand *clientCopy (const TQString & box,
00225                                   const TQString & sequence, bool nouid =
00226                                   false);
00234   static imapCommand *clientAppend (const TQString & box,
00235                                     const TQString & flags, ulong size);
00241   static imapCommand *clientCreate (const TQString & path);
00247   static imapCommand *clientDelete (const TQString & path);
00253   static imapCommand *clientSubscribe (const TQString & path);
00259   static imapCommand *clientUnsubscribe (const TQString & path);
00264   static imapCommand *clientExpunge ();
00271   static imapCommand *clientRename (const TQString & src,
00272                                     const TQString & dest);
00279   static imapCommand *clientSearch (const TQString & search, bool nouid =
00280                                     false);
00289   static imapCommand *clientStore (const TQString & set, const TQString & item,
00290                                    const TQString & data, bool nouid = false);
00295   static imapCommand *clientLogout ();
00300   static imapCommand *clientStartTLS ();
00301 
00303 
00310   static imapCommand *clientSetACL ( const TQString& box, const TQString& user, const TQString& acl );
00311 
00318   static imapCommand *clientDeleteACL ( const TQString& box, const TQString& user );
00319 
00325   static imapCommand *clientGetACL ( const TQString& box );
00326 
00333   static imapCommand *clientListRights ( const TQString& box, const TQString& user );
00334 
00340   static imapCommand *clientMyRights ( const TQString& box );
00341 
00343 
00350   static imapCommand *clientSetAnnotation ( const TQString& box, const TQString& entry, const TQMap<TQString, TQString>& attributes );
00351 
00359   static imapCommand *clientGetAnnotation ( const TQString& box, const TQString& entry, const TQStringList& attributeNames );
00360 
00365   static imapCommand *clientNamespace ();
00366 
00372   static imapCommand *clientGetQuotaroot ( const TQString& box );
00373 
00380   static imapCommand *clientCustom ( const TQString& command, const TQString& arguments );
00381 
00382 protected:
00383   TQString aCommand;
00384   TQString mId;
00385   bool mComplete;
00386   TQString aParameter;
00387   TQString mResult;
00388   TQString mResultInfo;
00389 
00390 private:
00391   imapCommand & operator = (const imapCommand &);
00392 };
00393 
00394 #endif