kioslaves

imapParser Class Reference

#include <imapparser.h>

Inheritance diagram for imapParser:

List of all members.


Public Types

enum  IMAP_STATE { ISTATE_NO, ISTATE_CONNECT, ISTATE_LOGIN, ISTATE_SELECT }

Public Member Functions

bool clientAuthenticate (KIO::SlaveBase *slave, KIO::AuthInfo &ai, const QString &aFQDN, const QString &aAuth, bool isSSL, QString &resultInfo)
bool clientLogin (const QString &aUser, const QString &aPass, QString &resultInfo)
imapCommanddoCommand (imapCommand *aCmd)
const QByteArraygetContinuation ()
const QString getCurrentBox ()
imapCachegetLastHandled ()
const QStringListgetResults ()
const imapInfogetSelected ()
enum IMAP_STATE getState ()
const imapInfogetStatus ()
bool hasCapability (const QString &)
 imapParser ()
QString namespaceForBox (const QString &box)
void parseAcl (parseString &result)
const mailAddressparseAddress (parseString &inWords, mailAddress &buffer)
void parseAddressList (parseString &inWords, QPtrList< mailAddress > &list)
void parseAnnotation (parseString &result)
void parseBody (parseString &inWords)
mimeHeaderparseBodyStructure (parseString &inWords, QString &section, mimeHeader *inHeader=0)
void parseCapability (parseString &result)
void parseCustom (parseString &result)
void parseDelegate (parseString &result)
QAsciiDict< QStringparseDisposition (parseString &inWords)
mailHeaderparseEnvelope (parseString &inWords)
void parseExists (ulong value, parseString &result)
void parseExpunge (ulong value, parseString &result)
void parseFetch (ulong value, parseString &inWords)
void parseFlags (parseString &result)
void parseList (parseString &result)
void parseListRights (parseString &result)
QByteArray parseLiteral (parseString &inWords, bool relay=false, bool stopAtBracket=false)
QCString parseLiteralC (parseString &inWords, bool relay=false, bool stopAtBracket=false, int *outlen=0)
int parseLoop ()
void parseLsub (parseString &result)
void parseMyRights (parseString &result)
void parseNamespace (parseString &result)
void parseOtherUser (parseString &result)
void parseOutOfOffice (parseString &result)
QAsciiDict< QStringparseParameters (parseString &inWords)
void parseQuota (parseString &result)
void parseQuotaRoot (parseString &result)
virtual bool parseRead (QByteArray &buffer, ulong len, ulong relay=0)
virtual bool parseReadLine (QByteArray &buffer, ulong relay=0)
void parseRecent (ulong value, parseString &result)
virtual void parseRelay (ulong)
virtual void parseRelay (const QByteArray &buffer)
void parseResult (QByteArray &result, parseString &rest, const QString &command=QString::null)
void parseSearch (parseString &result)
void parseSentence (parseString &inWords)
mimeHeaderparseSimplePart (parseString &inWords, QString &section, mimeHeader *localPart=0)
void parseStatus (parseString &result)
void parseUntagged (parseString &result)
virtual void parseWriteLine (const QString &)
void removeCapability (const QString &cap)
imapCommandsendCommand (imapCommand *aCmd)
void setState (enum IMAP_STATE state)
virtual ~imapParser ()

Static Public Member Functions

static QCString b2c (const QByteArray &ba)
static bool parseOneNumber (parseString &inWords, ulong &num)
static QCString parseOneWordC (parseString &inWords, bool stopAtBracket=FALSE, int *len=0)
static void parseURL (const KURL &_url, QString &_box, QString &_section, QString &_type, QString &_uid, QString &_validity, QString &_info)
static void skipWS (parseString &inWords)

Protected Attributes

ulong commandCounter
QPtrList< imapCommandcompleteQueue
QByteArray continuation
QString currentBox
enum IMAP_STATE currentState
QStringList imapCapabilities
QStringList imapNamespaces
imapCachelastHandled
QStringList lastResults
imapInfo lastStatus
QValueList< imapListlistResponses
QMap< QString, QStringnamespaceToDelimiter
QString seenUid
imapInfo selectInfo
QPtrList< imapCommandsentQueue
QStringList unhandled

Detailed Description

Definition at line 187 of file imapparser.h.


Member Enumeration Documentation

the different states the client can be in

Enumerator:
ISTATE_NO  Not connected.
ISTATE_CONNECT  Connected but not logged in.
ISTATE_LOGIN  Logged in.
ISTATE_SELECT  A folder is currently selected.

Definition at line 193 of file imapparser.h.


Constructor & Destructor Documentation

imapParser::imapParser (  ) 

Definition at line 75 of file imapparser.cc.

imapParser::~imapParser (  )  [virtual]

Definition at line 84 of file imapparser.cc.


Member Function Documentation

static QCString imapParser::b2c ( const QByteArray ba  )  [inline, static]

Definition at line 376 of file imapparser.h.

bool imapParser::clientAuthenticate ( KIO::SlaveBase *  slave,
KIO::AuthInfo &  ai,
const QString aFQDN,
const QString aAuth,
bool  isSSL,
QString resultInfo 
)

non-plaintext login

Parameters:
aUser Username
aPass Password
aAuth authentication method
isSSL are we using SSL
resultInfo The resultinfo from the command
Returns:
success or failure

Definition at line 218 of file imapparser.cc.

bool imapParser::clientLogin ( const QString aUser,
const QString aPass,
QString resultInfo 
)

plaintext login

Parameters:
aUser Username
aPass Password
resultInfo The resultinfo from the command
Returns:
success or failure

Definition at line 149 of file imapparser.cc.

imapCommand * imapParser::doCommand ( imapCommand aCmd  ) 

perform a command and wait to parse the result

Parameters:
aCmd The command to perform
Returns:
The completed command

Definition at line 91 of file imapparser.cc.

const QByteArray& imapParser::getContinuation (  )  [inline]

Definition at line 417 of file imapparser.h.

const QString imapParser::getCurrentBox (  )  [inline]

Definition at line 211 of file imapparser.h.

imapCache* imapParser::getLastHandled (  )  [inline]

return the last handled foo

Todo:
work out what a foo is

Definition at line 395 of file imapparser.h.

const QStringList& imapParser::getResults (  )  [inline]

return the last results

Definition at line 401 of file imapparser.h.

const imapInfo& imapParser::getSelected (  )  [inline]

return the select info

Definition at line 412 of file imapparser.h.

enum IMAP_STATE imapParser::getState (  )  [inline]

Get the current state.

Definition at line 206 of file imapparser.h.

const imapInfo& imapParser::getStatus (  )  [inline]

return the last status code

Definition at line 407 of file imapparser.h.

bool imapParser::hasCapability ( const QString cap  ) 

see if server has a capability

Definition at line 2048 of file imapparser.cc.

QString imapParser::namespaceForBox ( const QString box  ) 

find the namespace for the given box

Definition at line 2069 of file imapparser.cc.

void imapParser::parseAcl ( parseString result  ) 

parse a ACL line

Definition at line 723 of file imapparser.cc.

const mailAddress & imapParser::parseAddress ( parseString inWords,
mailAddress buffer 
)

parse an address and return the ref again

Definition at line 926 of file imapparser.cc.

void imapParser::parseAddressList ( parseString inWords,
QPtrList< mailAddress > &  list 
)

parse an address list and return a list of addresses

Definition at line 896 of file imapparser.cc.

void imapParser::parseAnnotation ( parseString result  ) 

parse a ANNOTATION line

Definition at line 734 of file imapparser.cc.

void imapParser::parseBody ( parseString inWords  ) 

parse the result of the body command

Definition at line 1337 of file imapparser.cc.

mimeHeader * imapParser::parseBodyStructure ( parseString inWords,
QString section,
mimeHeader inHeader = 0 
)

parse the body structure recursively

Definition at line 1209 of file imapparser.cc.

void imapParser::parseCapability ( parseString result  ) 

parse a CAPABILITY line

Definition at line 675 of file imapparser.cc.

void imapParser::parseCustom ( parseString result  ) 

parse a custom command line

Definition at line 794 of file imapparser.cc.

void imapParser::parseDelegate ( parseString result  ) 

parse a DELEGATE line

Definition at line 806 of file imapparser.cc.

QAsciiDict< QString > imapParser::parseDisposition ( parseString inWords  ) 

parse the disposition list (disposition (name value pairs)) the disposition has the key 'content-disposition'

Definition at line 1018 of file imapparser.cc.

mailHeader * imapParser::parseEnvelope ( parseString inWords  ) 

read a envelope from imap and parse the addresses

Definition at line 943 of file imapparser.cc.

void imapParser::parseExists ( ulong  value,
parseString result 
)

parse a EXISTS line

Definition at line 884 of file imapparser.cc.

void imapParser::parseExpunge ( ulong  value,
parseString result 
)

parse a EXPUNGE line

Definition at line 890 of file imapparser.cc.

void imapParser::parseFetch ( ulong  value,
parseString inWords 
)

parses the results of a fetch command processes it with the following sub parsers

Definition at line 1464 of file imapparser.cc.

void imapParser::parseFlags ( parseString result  ) 

parse a FLAGS line

Definition at line 681 of file imapparser.cc.

void imapParser::parseList ( parseString result  ) 

parse a LIST line

Definition at line 686 of file imapparser.cc.

void imapParser::parseListRights ( parseString result  ) 

parse a LISTRIGHTS line

Definition at line 712 of file imapparser.cc.

QByteArray imapParser::parseLiteral ( parseString inWords,
bool  relay = false,
bool  stopAtBracket = false 
) [inline]

Definition at line 365 of file imapparser.h.

QCString imapParser::parseLiteralC ( parseString inWords,
bool  relay = false,
bool  stopAtBracket = false,
int *  outlen = 0 
)

parse a literal or word, may require more data

Definition at line 1909 of file imapparser.cc.

int imapParser::parseLoop (  ) 

main loop for the parser reads one line and dispatches it to the appropriate sub parser

Definition at line 1747 of file imapparser.cc.

void imapParser::parseLsub ( parseString result  ) 

parse a LSUB line

Definition at line 706 of file imapparser.cc.

void imapParser::parseMyRights ( parseString result  ) 

parse a MYRIGHTS line

Definition at line 831 of file imapparser.cc.

void imapParser::parseNamespace ( parseString result  ) 

parse a NAMESPACE line

Definition at line 1672 of file imapparser.cc.

bool imapParser::parseOneNumber ( parseString inWords,
ulong &  num 
) [static]

parse one number using parseOneWord

Definition at line 2041 of file imapparser.cc.

QCString imapParser::parseOneWordC ( parseString inWords,
bool  stopAtBracket = FALSE,
int *  len = 0 
) [static]

parse one word (maybe quoted) upto next space " ) ] }

Definition at line 1959 of file imapparser.cc.

void imapParser::parseOtherUser ( parseString result  ) 

parse a OTHER-USER line

Definition at line 801 of file imapparser.cc.

void imapParser::parseOutOfOffice ( parseString result  ) 

parse a OUT-OF-OFFICE line

Definition at line 820 of file imapparser.cc.

QAsciiDict< QString > imapParser::parseParameters ( parseString inWords  ) 

parse a parameter list (name value pairs)

Definition at line 1055 of file imapparser.cc.

void imapParser::parseQuota ( parseString result  ) 

parse a QUOTA line

Definition at line 753 of file imapparser.cc.

void imapParser::parseQuotaRoot ( parseString result  ) 

parse a QUOTAROOT line

Definition at line 777 of file imapparser.cc.

bool imapParser::parseRead ( QByteArray buffer,
ulong  len,
ulong  relay = 0 
) [virtual]

read at least len bytes

Reimplemented in IMAP4Protocol.

Definition at line 1823 of file imapparser.cc.

bool imapParser::parseReadLine ( QByteArray buffer,
ulong  relay = 0 
) [virtual]

read at least a line (up to CRLF)

Reimplemented in IMAP4Protocol.

Definition at line 1833 of file imapparser.cc.

void imapParser::parseRecent ( ulong  value,
parseString result 
)

parse a RECENT line

Definition at line 1666 of file imapparser.cc.

void imapParser::parseRelay ( ulong  len  )  [virtual]

relay hook to announce the fetched data directly to an upper level

Reimplemented in IMAP4Protocol.

Definition at line 1816 of file imapparser.cc.

void imapParser::parseRelay ( const QByteArray buffer  )  [virtual]

relay hook to send the fetched data directly to an upper level

Reimplemented in IMAP4Protocol.

Definition at line 1808 of file imapparser.cc.

void imapParser::parseResult ( QByteArray result,
parseString rest,
const QString command = QString::null 
)

parse a RESULT line

Definition at line 531 of file imapparser.cc.

void imapParser::parseSearch ( parseString result  ) 

parse a SEARCH line

Definition at line 838 of file imapparser.cc.

void imapParser::parseSentence ( parseString inWords  ) 

parse a parenthesized list

Definition at line 1626 of file imapparser.cc.

mimeHeader * imapParser::parseSimplePart ( parseString inWords,
QString section,
mimeHeader localPart = 0 
)

parse only one not nested part

Definition at line 1088 of file imapparser.cc.

void imapParser::parseStatus ( parseString result  ) 

parse a STATUS line

Definition at line 848 of file imapparser.cc.

void imapParser::parseUntagged ( parseString result  ) 

parses all untagged responses and passes them on to the following parsers

Definition at line 341 of file imapparser.cc.

void imapParser::parseURL ( const KURL &  _url,
QString _box,
QString _section,
QString _type,
QString _uid,
QString _validity,
QString _info 
) [static]

extract the box,section,list type, uid, uidvalidity,info from an url

Definition at line 1851 of file imapparser.cc.

void imapParser::parseWriteLine ( const QString str  )  [virtual]

write argument to server

Reimplemented in IMAP4Protocol.

Definition at line 1843 of file imapparser.cc.

void imapParser::removeCapability ( const QString cap  ) 

Definition at line 2064 of file imapparser.cc.

imapCommand * imapParser::sendCommand ( imapCommand aCmd  ) 

do setup and send the command to parseWriteLine

Parameters:
aCmd The command to perform
Returns:
The completed command

Definition at line 104 of file imapparser.cc.

void imapParser::setState ( enum IMAP_STATE  state  )  [inline]

Set the current state.

Definition at line 208 of file imapparser.h.

static void imapParser::skipWS ( parseString inWords  )  [inline, static]

Definition at line 427 of file imapparser.h.


Member Data Documentation

ulong imapParser::commandCounter [protected]

Definition at line 477 of file imapparser.h.

Definition at line 463 of file imapparser.h.

the last continuation request (there MUST not be more than one pending)

Definition at line 471 of file imapparser.h.

the box selected

Definition at line 447 of file imapparser.h.

the current state we're in

Definition at line 444 of file imapparser.h.

the results from the capabilities, split at ' '

Definition at line 456 of file imapparser.h.

list of namespaces in the form: section=namespace=delimiter section is 0 (personal), 1 (other users) or 2 (shared)

Definition at line 492 of file imapparser.h.

Definition at line 475 of file imapparser.h.

the results from search/acl commands

Definition at line 480 of file imapparser.h.

the results from the last status command

Definition at line 453 of file imapparser.h.

the results from list/lsub/listrights commands

Definition at line 459 of file imapparser.h.

namespace prefix - delimiter association The namespace is cleaned before so that it does not contain the delimiter

Definition at line 486 of file imapparser.h.

the last uid seen while a fetch

Definition at line 474 of file imapparser.h.

here we store the result from select/examine and unsolicited updates

Definition at line 450 of file imapparser.h.

queues handling the running commands

Definition at line 462 of file imapparser.h.

everything we didn't handle, everything but the greeting is bogus

Definition at line 468 of file imapparser.h.


The documentation for this class was generated from the following files: