tdeioslave/imap4

imapcommand.h
1 #ifndef _IMAPCOMMAND_H
2 #define _IMAPCOMMAND_H
3 /**********************************************************************
4  *
5  * imapcommand.h - IMAP4rev1 command handler
6  * Copyright (C) 2000 Sven Carstens <s.carstens@gmx.de>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21  *
22  * Send comments and bug fixes to
23  *
24  *********************************************************************/
25 
26 #include <tqstringlist.h>
27 #include <tqstring.h>
28 #include <tqmap.h>
29 
38 {
39 public:
40 
44  imapCommand ();
52  imapCommand (const TQString & command, const TQString & parameter);
58  bool isComplete ();
64  const TQString & result ();
70  const TQString & resultInfo ();
76  const TQString & parameter ();
82  const TQString & command ();
88  const TQString & id ();
89 
96  void setId (const TQString &);
102  void setComplete ();
109  void setResult (const TQString &);
116  void setResultInfo (const TQString &);
123  void setCommand (const TQString &);
130  void setParameter (const TQString &);
139  const TQString getStr ();
140 
146  static imapCommand *clientNoop ();
156  static imapCommand *clientFetch (ulong uid, const TQString & fields,
157  bool nouid = false);
168  static imapCommand *clientFetch (ulong fromUid, ulong toUid,
169  const TQString & fields, bool nouid =
170  false);
181  static imapCommand *clientFetch (const TQString & sequence,
182  const TQString & fields, bool nouid =
183  false);
192  static imapCommand *clientList (const TQString & reference,
193  const TQString & path, bool lsub = false);
201  static imapCommand *clientSelect (const TQString & path, bool examine =
202  false);
208  static imapCommand *clientClose();
215  static imapCommand *clienStatus (const TQString & path,
216  const TQString & parameters);
224  static imapCommand *clientCopy (const TQString & box,
225  const TQString & sequence, bool nouid =
226  false);
234  static imapCommand *clientAppend (const TQString & box,
235  const TQString & flags, ulong size);
241  static imapCommand *clientCreate (const TQString & path);
247  static imapCommand *clientDelete (const TQString & path);
253  static imapCommand *clientSubscribe (const TQString & path);
259  static imapCommand *clientUnsubscribe (const TQString & path);
264  static imapCommand *clientExpunge ();
271  static imapCommand *clientRename (const TQString & src,
272  const TQString & dest);
279  static imapCommand *clientSearch (const TQString & search, bool nouid =
280  false);
289  static imapCommand *clientStore (const TQString & set, const TQString & item,
290  const TQString & data, bool nouid = false);
295  static imapCommand *clientLogout ();
300  static imapCommand *clientStartTLS ();
301 
303 
310  static imapCommand *clientSetACL ( const TQString& box, const TQString& user, const TQString& acl );
311 
318  static imapCommand *clientDeleteACL ( const TQString& box, const TQString& user );
319 
325  static imapCommand *clientGetACL ( const TQString& box );
326 
333  static imapCommand *clientListRights ( const TQString& box, const TQString& user );
334 
340  static imapCommand *clientMyRights ( const TQString& box );
341 
343 
350  static imapCommand *clientSetAnnotation ( const TQString& box, const TQString& entry, const TQMap<TQString, TQString>& attributes );
351 
359  static imapCommand *clientGetAnnotation ( const TQString& box, const TQString& entry, const TQStringList& attributeNames );
360 
365  static imapCommand *clientNamespace ();
366 
372  static imapCommand *clientGetQuotaroot ( const TQString& box );
373 
380  static imapCommand *clientCustom ( const TQString& command, const TQString& arguments );
381 
382 protected:
383  TQString aCommand;
384  TQString mId;
385  bool mComplete;
386  TQString aParameter;
387  TQString mResult;
388  TQString mResultInfo;
389 
390 private:
391  imapCommand & operator = (const imapCommand &);
392 };
393 
394 #endif