kmail

KMail::PopAccount Class Reference

KMail account for pop mail account. More...

#include <popaccount.h>

Inheritance diagram for KMail::PopAccount:

List of all members.


Public Member Functions

virtual unsigned short int defaultPort () const
bool filterOnServer (void) const
unsigned int filterOnServerCheckSize (void) const
virtual void init (void)
virtual void killAllJobs (bool disconnectSlave=false)
bool leaveOnServer (void) const
int leaveOnServerCount (void) const
int leaveOnServerDays (void) const
int leaveOnServerSize (void) const
virtual void processNewMail (bool _interactive)
virtual QString protocol () const
virtual void pseudoAssign (const KMAccount *a)
virtual void readConfig (KConfig &)
virtual void setFilterOnServer (bool)
virtual void setFilterOnServerCheckSize (unsigned int)
virtual void setLeaveOnServer (bool)
virtual void setLeaveOnServerCount (int)
virtual void setLeaveOnServerDays (int)
virtual void setLeaveOnServerSize (int)
virtual void setUsePipelining (bool)
virtual KIO::MetaData slaveConfig () const
virtual QString type (void) const
bool usePipelining (void) const
virtual void writeConfig (KConfig &)
virtual ~PopAccount ()

Protected Types

enum  Stage {
  Idle, List, Uidl, Head,
  Retr, Dele, Quit
}

Protected Slots

void slotAbortRequested ()
void slotCancel ()
void slotData (KIO::Job *, const QByteArray &)
void slotGetNextHdr ()
void slotGetNextMsg ()
void slotJobFinished ()
void slotMsgRetrieved (KIO::Job *, const QString &)
void slotProcessPendingMsgs ()
void slotResult (KIO::Job *)
void slotSlaveError (KIO::Slave *, int, const QString &)

Protected Member Functions

void connectJob ()
 PopAccount (AccountManager *owner, const QString &accountName, uint id)
void processRemainingQueuedMessages ()
void saveUidList ()
void startJob ()

Protected Attributes

QByteArray curMsgData
int curMsgLen
QDataStreamcurMsgStrm
int dataCounter
bool gotMsgs
QPtrListIterator< KMPopHeadersheaderIt
bool headers
QPtrList< KMPopHeadersheadersOnServer
QStringList idsOfForcedDeletes
QStringList idsOfMsgs
QStringList idsOfMsgsToDelete
int indexOfCurrentMsg
bool interactive
KIO::SimpleJob * job
QValueList< int > lensOfMsgs
bool mFilterOnServer
unsigned int mFilterOnServerCheckSize
QMap< QString, bool > mHeaderDeleteUids
QMap< QString, bool > mHeaderDownUids
QMap< QString, bool > mHeaderLaterUids
bool mLeaveOnServer
int mLeaveOnServerCount
int mLeaveOnServerDays
int mLeaveOnServerSize
QMap< QString, int > mMsgsPendingDownload
bool mProcessing
QStringList msgIdsAwaitingProcessing
QValueList< KMMessage * > msgsAwaitingProcessing
QStringList msgUidsAwaitingProcessing
QDict< int > mSizeOfNextSeenMsgsDict
QMap< QString, int > mTimeOfNextSeenMsgsMap
QValueVector< int > mTimeOfSeenMsgsVector
QMap< QString, QStringmUidForIdMap
bool mUidlFinished
QDict< int > mUidsOfNextSeenMsgsDict
QDict< int > mUidsOfSeenMsgsDict
bool mUsePipelining
int numBytes
int numBytesRead
int numBytesToRead
int numMsgBytesRead
int numMsgs
int processingDelay
QTimer processMsgsTimer
Stage stage

Detailed Description

KMail account for pop mail account.

Definition at line 28 of file popaccount.h.


Member Enumeration Documentation

enum KMail::PopAccount::Stage [protected]

Enumerator:
Idle 
List 
Uidl 
Head 
Retr 
Dele 
Quit 

Definition at line 99 of file popaccount.h.


Constructor & Destructor Documentation

KMail::PopAccount::~PopAccount (  )  [virtual]

Definition at line 87 of file popaccount.cpp.

KMail::PopAccount::PopAccount ( AccountManager owner,
const QString accountName,
uint  id 
) [protected]

Definition at line 56 of file popaccount.cpp.


Member Function Documentation

void KMail::PopAccount::connectJob (  )  [protected]

Connect up the standard signals/slots for the KIO Jobs.

Definition at line 287 of file popaccount.cpp.

unsigned short int KMail::PopAccount::defaultPort (  )  const [virtual]

Implements KMail::NetworkAccount.

Definition at line 108 of file popaccount.cpp.

bool KMail::PopAccount::filterOnServer ( void   )  const [inline]

Shall messages be filter on the server (TRUE) or not (FALSE).

Definition at line 78 of file popaccount.h.

unsigned int KMail::PopAccount::filterOnServerCheckSize ( void   )  const [inline]

Size of messages which should be check on the pop server before download.

Definition at line 85 of file popaccount.h.

void KMail::PopAccount::init ( void   )  [virtual]

Set the config options to a decent state.

Reimplemented from KMail::NetworkAccount.

Definition at line 113 of file popaccount.cpp.

void KMail::PopAccount::killAllJobs ( bool  disconnectSlave = false  )  [virtual]

Kill all jobs that are currently in progress.

Implements KMail::NetworkAccount.

Definition at line 1081 of file popaccount.cpp.

bool KMail::PopAccount::leaveOnServer ( void   )  const [inline]

Shall messages be left on the server upon retreival (TRUE) or deleted (FALSE).

Definition at line 53 of file popaccount.h.

int KMail::PopAccount::leaveOnServerCount ( void   )  const [inline]

If value is positive, leave so many messages on the server.

Definition at line 65 of file popaccount.h.

int KMail::PopAccount::leaveOnServerDays ( void   )  const [inline]

If value is positive, leave mail on the server for so many days.

Definition at line 59 of file popaccount.h.

int KMail::PopAccount::leaveOnServerSize ( void   )  const [inline]

If value is positive, leave so many MBs on the server.

Definition at line 71 of file popaccount.h.

void KMail::PopAccount::processNewMail ( bool  interactive  )  [virtual]

Process new mail for this account if one arrived.

Returns TRUE if new mail has been found. Whether the mail is automatically loaded to an associated folder or not depends on the type of the account.

Implements KMAccount.

Definition at line 145 of file popaccount.cpp.

void KMail::PopAccount::processRemainingQueuedMessages (  )  [protected]

Process any queued messages.

Definition at line 815 of file popaccount.cpp.

QString KMail::PopAccount::protocol (  )  const [virtual]

Implements KMail::NetworkAccount.

Definition at line 104 of file popaccount.cpp.

void KMail::PopAccount::pseudoAssign ( const KMAccount a  )  [virtual]

A weak assignment operator.

Reimplemented from KMail::NetworkAccount.

Definition at line 128 of file popaccount.cpp.

void KMail::PopAccount::readConfig ( KConfig &  config  )  [virtual]

Read config file entries.

This method is called by the account manager when a new account is created. The config group is already properly set by the caller.

Reimplemented from KMail::NetworkAccount.

Definition at line 215 of file popaccount.cpp.

void KMail::PopAccount::saveUidList (  )  [protected]

Save the list of seen uids for this user/server.

Definition at line 829 of file popaccount.cpp.

void KMail::PopAccount::setFilterOnServer ( bool  b  )  [virtual]

Definition at line 275 of file popaccount.cpp.

void KMail::PopAccount::setFilterOnServerCheckSize ( unsigned int  aSize  )  [virtual]

Definition at line 281 of file popaccount.cpp.

void KMail::PopAccount::setLeaveOnServer ( bool  b  )  [virtual]

Definition at line 251 of file popaccount.cpp.

void KMail::PopAccount::setLeaveOnServerCount ( int  count  )  [virtual]

Definition at line 263 of file popaccount.cpp.

void KMail::PopAccount::setLeaveOnServerDays ( int  days  )  [virtual]

Definition at line 257 of file popaccount.cpp.

void KMail::PopAccount::setLeaveOnServerSize ( int  size  )  [virtual]

Definition at line 269 of file popaccount.cpp.

void KMail::PopAccount::setUsePipelining ( bool  b  )  [virtual]

Definition at line 245 of file popaccount.cpp.

MetaData KMail::PopAccount::slaveConfig (  )  const [virtual]

Configure the slave by adding to the meta data map.

Reimplemented from KMail::NetworkAccount.

Definition at line 424 of file popaccount.cpp.

void KMail::PopAccount::slotAbortRequested (  )  [protected, slot]

Kills the job if still stage == List.

Definition at line 352 of file popaccount.cpp.

void KMail::PopAccount::slotCancel (  )  [protected, slot]

Cleans up after a user cancels the current job.

Definition at line 299 of file popaccount.cpp.

void KMail::PopAccount::slotData ( KIO::Job *  job,
const QByteArray data 
) [protected, slot]

New data has arrived append it to the end of the current message.

Definition at line 877 of file popaccount.cpp.

void KMail::PopAccount::slotGetNextHdr (  )  [protected, slot]

If there are more headers to be downloaded then start a new kio job to get the next header.

Definition at line 1071 of file popaccount.cpp.

void KMail::PopAccount::slotGetNextMsg (  )  [protected, slot]

If there are more messages to be downloaded then start a new kio job to get the message whose id is at the head of the queue.

Definition at line 854 of file popaccount.cpp.

void KMail::PopAccount::slotJobFinished (  )  [protected, slot]

Called when a job is finished.

Basically a finite state machine for cycling through the Idle, List, Uidl, Retr, Quit stages

Definition at line 476 of file popaccount.cpp.

void KMail::PopAccount::slotMsgRetrieved ( KIO::Job *  ,
const QString infoMsg 
) [protected, slot]

A messages has been retrieved successfully.

The next data belongs to the next message.

Definition at line 444 of file popaccount.cpp.

void KMail::PopAccount::slotProcessPendingMsgs (  )  [protected, slot]

Messages are downloaded in the background and then once every x seconds a batch of messages are processed.

Messages are processed in batches to reduce flicker (multiple refreshes of the qlistview of messages headers in a single second causes flicker) when using a fast pop server such as one on a lan.

Processing a message means applying KMAccount::processNewMsg to it and adding its UID to the list of seen UIDs

Definition at line 309 of file popaccount.cpp.

void KMail::PopAccount::slotResult ( KIO::Job *   )  [protected, slot]

Finished downloading the current kio job, either due to an error or because the job has been canceled or because the complete message has been downloaded.

Definition at line 1015 of file popaccount.cpp.

void KMail::PopAccount::slotSlaveError ( KIO::Slave *  aSlave,
int  error,
const QString errorMsg 
) [protected, slot]

Slave error handling.

Definition at line 1044 of file popaccount.cpp.

void KMail::PopAccount::startJob (  )  [protected]

Start a KIO Job to get a list of messages on the pop server.

Definition at line 367 of file popaccount.cpp.

QString KMail::PopAccount::type ( void   )  const [virtual]

Inherited methods.

Reimplemented from KMAccount.

Definition at line 99 of file popaccount.cpp.

bool KMail::PopAccount::usePipelining ( void   )  const [inline]

Sending of several commands at once.

Definition at line 46 of file popaccount.h.

void KMail::PopAccount::writeConfig ( KConfig &  config  )  [virtual]

Write all account information to given config file.

The config group is already properly set by the caller.

Reimplemented from KMail::NetworkAccount.

Definition at line 230 of file popaccount.cpp.


Member Data Documentation

Definition at line 160 of file popaccount.h.

Definition at line 163 of file popaccount.h.

Definition at line 161 of file popaccount.h.

Definition at line 171 of file popaccount.h.

bool KMail::PopAccount::gotMsgs [protected]

Definition at line 128 of file popaccount.h.

Definition at line 137 of file popaccount.h.

bool KMail::PopAccount::headers [protected]

Definition at line 138 of file popaccount.h.

Definition at line 136 of file popaccount.h.

Definition at line 153 of file popaccount.h.

Definition at line 144 of file popaccount.h.

Definition at line 152 of file popaccount.h.

Definition at line 154 of file popaccount.h.

Definition at line 168 of file popaccount.h.

KIO::SimpleJob* KMail::PopAccount::job [protected]

Definition at line 132 of file popaccount.h.

Definition at line 145 of file popaccount.h.

Definition at line 129 of file popaccount.h.

Definition at line 130 of file popaccount.h.

Definition at line 140 of file popaccount.h.

Definition at line 141 of file popaccount.h.

Definition at line 142 of file popaccount.h.

Definition at line 124 of file popaccount.h.

Definition at line 126 of file popaccount.h.

Definition at line 125 of file popaccount.h.

Definition at line 127 of file popaccount.h.

Definition at line 134 of file popaccount.h.

Definition at line 169 of file popaccount.h.

Definition at line 151 of file popaccount.h.

Definition at line 150 of file popaccount.h.

Definition at line 149 of file popaccount.h.

Definition at line 146 of file popaccount.h.

Definition at line 170 of file popaccount.h.

Definition at line 148 of file popaccount.h.

Definition at line 147 of file popaccount.h.

Definition at line 123 of file popaccount.h.

int KMail::PopAccount::numBytes [protected]

Definition at line 167 of file popaccount.h.

Definition at line 167 of file popaccount.h.

Definition at line 167 of file popaccount.h.

Definition at line 167 of file popaccount.h.

int KMail::PopAccount::numMsgs [protected]

Definition at line 167 of file popaccount.h.

Definition at line 166 of file popaccount.h.

Definition at line 165 of file popaccount.h.

Definition at line 164 of file popaccount.h.


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