kmail

KMail::PopAccount Class Reference

#include <popaccount.h>

Inheritance diagram for KMail::PopAccount:

KMail::NetworkAccount KMAccount List of all members.

Detailed Description

KMail account for pop mail account.

Definition at line 28 of file popaccount.h.


Public Member Functions

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

Protected Types

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

Protected Slots

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

Protected Member Functions

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

Protected Attributes

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

Friends

class ::AccountManager

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.

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.

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 &   )  [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.

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 *  ,
const QByteArray & 
[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 & 
[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 *  ,
int  ,
const QString & 
[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 &   )  [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.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys