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{
39public:
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
382protected:
383 TQString aCommand;
384 TQString mId;
385 bool mComplete;
386 TQString aParameter;
387 TQString mResult;
388 TQString mResultInfo;
389
390private:
391 imapCommand & operator = (const imapCommand &);
392};
393
394#endif
encapulate a IMAP command
Definition: imapcommand.h:38
static imapCommand * clientSubscribe(const TQString &path)
Create a SUBSCRIBE command.
static imapCommand * clienStatus(const TQString &path, const TQString &parameters)
Create a STATUS command.
void setParameter(const TQString &)
set the command parameter(s)
const TQString & id()
get the id
Definition: imapcommand.cpp:94
static imapCommand * clientCreate(const TQString &path)
Create a CREATE command.
static imapCommand * clientNoop()
Create a NOOP command.
static imapCommand * clientRename(const TQString &src, const TQString &dest)
Create a RENAME command.
static imapCommand * clientGetQuotaroot(const TQString &box)
Create a GETQUOTAROOT command.
static imapCommand * clientMyRights(const TQString &box)
Create a MYRIGHTS command.
const TQString getStr()
returns the data to send to the server The function returns the complete data to be sent to the serve...
static imapCommand * clientList(const TQString &reference, const TQString &path, bool lsub=false)
Create a LIST command.
static imapCommand * clientSetAnnotation(const TQString &box, const TQString &entry, const TQMap< TQString, TQString > &attributes)
Create a SETANNOTATION command.
void setComplete()
set the completed state
const TQString & parameter()
get the parameter
void setCommand(const TQString &)
set the command
static imapCommand * clientSetACL(const TQString &box, const TQString &user, const TQString &acl)
Create a SETACL command.
static imapCommand * clientGetACL(const TQString &box)
Create a GETACL command.
static imapCommand * clientDelete(const TQString &path)
Create a DELETE command.
bool isComplete()
is it complete?
Definition: imapcommand.cpp:76
static imapCommand * clientListRights(const TQString &box, const TQString &user)
Create a LISTRIGHTS command.
const TQString & command()
get the command
static imapCommand * clientFetch(ulong uid, const TQString &fields, bool nouid=false)
Create a FETCH command.
static imapCommand * clientDeleteACL(const TQString &box, const TQString &user)
Create a DELETEACL command.
static imapCommand * clientUnsubscribe(const TQString &path)
Create a UNSUBSCRIBE command.
static imapCommand * clientNamespace()
Create a NAMESPACE command.
void setId(const TQString &)
set the id
void setResultInfo(const TQString &)
set the completed state
static imapCommand * clientSearch(const TQString &search, bool nouid=false)
Create a SEARCH command.
static imapCommand * clientExpunge()
Create a EXPUNGE command.
const TQString & resultInfo()
get information about the result
Definition: imapcommand.cpp:88
static imapCommand * clientStartTLS()
Create a STARTTLS command.
static imapCommand * clientClose()
Create a CLOSE command.
void setResult(const TQString &)
set the completed state
static imapCommand * clientLogout()
Create a LOGOUT command.
static imapCommand * clientCopy(const TQString &box, const TQString &sequence, bool nouid=false)
Create a COPY command.
static imapCommand * clientSelect(const TQString &path, bool examine=false)
Create a SELECT command.
const TQString & result()
get the result of the command
Definition: imapcommand.cpp:82
static imapCommand * clientCustom(const TQString &command, const TQString &arguments)
Create a custom command.
static imapCommand * clientGetAnnotation(const TQString &box, const TQString &entry, const TQStringList &attributeNames)
Create a GETANNOTATION command.
static imapCommand * clientStore(const TQString &set, const TQString &item, const TQString &data, bool nouid=false)
Create a STORE command.
imapCommand()
Constructor.
Definition: imapcommand.cpp:58
static imapCommand * clientAppend(const TQString &box, const TQString &flags, ulong size)
Create a APPEND command.