kmail Library API Documentation

KMAcctExpPop Class Reference

KMail account for experimental pop mail account. More...

#include <kmacctexppop.h>

List of all members.

Public Methods

virtual ~KMAcctExpPop ()
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)
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 Methods

 KMAcctExpPop (KMAcctMgr *owner, const QString &accountName)
void startJob ()
void connectJob ()
void processRemainingQueuedMessagesAndSaveUidList ()

Protected Attributes

bool mUsePipelining
bool mLeaveOnServer
bool gotMsgs
bool mFilterOnServer
unsigned int mFilterOnServerCheckSize
KIO::SimpleJob * job
QStringList idsOfMsgsPendingDownload
QValueList< int > lensOfMsgsPendingDownload
QPtrList< KMPopHeaders > headersOnServer
QPtrListIterator< KMPopHeaders > headerIt
bool headers
QStringList headerDeleteUids
QStringList headerDownUids
QStringList headerLaterUids
QStringList idsOfMsgs
QValueList< int > lensOfMsgs
QStringList uidsOfMsgs
QStringList uidsOfSeenMsgs
QStringList uidsOfNextSeenMsgs
QStringList idsOfMsgsToDelete
int indexOfCurrentMsg
QValueList< KMMessage * > msgsAwaitingProcessing
QStringList msgIdsAwaitingProcessing
QStringList msgUidsAwaitingProcessing
QByteArray curMsgData
QDataStreamcurMsgStrm
int curMsgLen
int stage
QTimer processMsgsTimer
QTimerss
int processingDelay
int numMsgs
int numBytes
int numBytesToRead
int numBytesRead
int numMsgBytesRead
bool interactive
bool mProcessing
bool mUidlFinished
int dataCounter

Friends

class KMAcctMgr
class KMPasswdDialog


Detailed Description

KMail account for experimental pop mail account.

Definition at line 24 of file kmacctexppop.h.


Member Function Documentation

void KMAcctExpPop::pseudoAssign const KMAccount *    a [virtual]
 

A weak assignment operator.

Definition at line 99 of file kmacctexppop.cpp.

References filterOnServer(), filterOnServerCheckSize(), leaveOnServer(), slotAbortRequested(), and usePipelining().

bool KMAcctExpPop::usePipelining void    const [inline]
 

Sending of several commands at once.

Definition at line 42 of file kmacctexppop.h.

Referenced by pseudoAssign().

bool KMAcctExpPop::leaveOnServer void    const [inline]
 

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

Definition at line 49 of file kmacctexppop.h.

Referenced by pseudoAssign().

bool KMAcctExpPop::filterOnServer void    const [inline]
 

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

Definition at line 56 of file kmacctexppop.h.

Referenced by pseudoAssign().

unsigned int KMAcctExpPop::filterOnServerCheckSize void    const [inline]
 

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

Definition at line 63 of file kmacctexppop.h.

Referenced by pseudoAssign().

QString KMAcctExpPop::type void    const [virtual]
 

Inherited methods.

Definition at line 73 of file kmacctexppop.cpp.

void KMAcctExpPop::startJob   [protected]
 

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

Definition at line 281 of file kmacctexppop.cpp.

References QPtrList< KMPopHeaders >::clear(), QValueList< int >::clear(), QObject::connect(), connectJob(), KMBroadcastStatus::instance(), KMBroadcastStatus::reset(), KMBroadcastStatus::setStatusMsg(), KMBroadcastStatus::setStatusProgressEnable(), slotAbortRequested(), and slotSlaveError().

void KMAcctExpPop::connectJob   [protected]
 

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

Definition at line 201 of file kmacctexppop.cpp.

References QObject::connect(), slotData(), slotMsgRetrieved(), and slotResult().

Referenced by slotJobFinished(), and startJob().

void KMAcctExpPop::processRemainingQueuedMessagesAndSaveUidList   [protected]
 

Process any queued messages and save the list of seen uids for this user/server.

Definition at line 624 of file kmacctexppop.cpp.

References slotProcessPendingMsgs(), and QTimer::stop().

Referenced by slotCancel(), and slotJobFinished().

void KMAcctExpPop::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 224 of file kmacctexppop.cpp.

References QValueList< KMMessage * >::begin(), QValueList< KMMessage * >::clear(), QValueList< int >::clear(), and QValueList< KMMessage * >::end().

Referenced by processRemainingQueuedMessagesAndSaveUidList().

void KMAcctExpPop::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 647 of file kmacctexppop.cpp.

References QValueList< int >::begin(), QValueList< int >::remove(), and QMemArray< char >::resize().

Referenced by slotJobFinished(), and slotMsgRetrieved().

void KMAcctExpPop::slotMsgRetrieved KIO::Job *   ,
const QString  
[protected, slot]
 

A messages has been retrieved successfully.

The next data belongs to the next message.

Definition at line 352 of file kmacctexppop.cpp.

References QValueList< KMMessage * >::append(), QValueList< int >::at(), KMFolder::crlf2lf(), QPtrListIterator< KMPopHeaders >::current(), QMemArray< char >::data(), QMemArray< char >::resize(), QMemArray< char >::size(), slotGetNextHdr(), and slotGetNextMsg().

Referenced by connectJob().

void KMAcctExpPop::slotData KIO::Job *   ,
const QByteArray  
[protected, slot]
 

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

Definition at line 674 of file kmacctexppop.cpp.

References QValueList< int >::append(), QString::arg(), QMemArray< char >::data(), QString::find(), KMBroadcastStatus::instance(), QString::left(), QString::mid(), QValueList< int >::remove(), KMBroadcastStatus::setStatusMsg(), KMBroadcastStatus::setStatusProgressPercent(), QString::simplifyWhiteSpace(), QMemArray< char >::size(), QString::toInt(), QString::truncate(), and QDataStream::writeRawBytes().

Referenced by connectJob().

void KMAcctExpPop::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 774 of file kmacctexppop.cpp.

References slotCancel(), and slotJobFinished().

Referenced by connectJob().

void KMAcctExpPop::slotCancel   [protected, slot]
 

Cleans up after a user cancels the current job.

Definition at line 214 of file kmacctexppop.cpp.

References QValueList< int >::clear(), processRemainingQueuedMessagesAndSaveUidList(), and slotJobFinished().

Referenced by slotAbortRequested(), slotResult(), and slotSlaveError().

void KMAcctExpPop::slotAbortRequested   [protected, slot]
 

Kills the job if still stage == List.

Definition at line 267 of file kmacctexppop.cpp.

References QObject::disconnect(), KMBroadcastStatus::instance(), and slotCancel().

Referenced by pseudoAssign(), and startJob().

void KMAcctExpPop::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 384 of file kmacctexppop.cpp.

References KMBroadcastStatus::abortRequested(), QPtrList< KMPopHeaders >::append(), QValueList< int >::at(), QPtrListIterator< KMPopHeaders >::atLast(), QValueList< int >::begin(), QPtrList< KMPopHeaders >::clear(), connectJob(), QPtrList< KMPopHeaders >::count(), QPtrListIterator< KMPopHeaders >::current(), QPtrList< KMPopHeaders >::current(), QValueList< int >::end(), QPtrList< KMPopHeaders >::first(), KMBroadcastStatus::instance(), QStringList::join(), QPtrList< KMPopHeaders >::next(), processRemainingQueuedMessagesAndSaveUidList(), QValueList< int >::remove(), KMBroadcastStatus::reset(), KMBroadcastStatus::setStatusMsgTransmissionCompleted(), KMBroadcastStatus::setStatusProgressEnable(), KMBroadcastStatus::setStatusProgressPercent(), slotGetNextHdr(), slotGetNextMsg(), QTimer::start(), and QPtrListIterator< KMPopHeaders >::toFirst().

Referenced by slotCancel(), and slotResult().

void KMAcctExpPop::slotSlaveError KIO::Slave *   ,
int   ,
const QString  
[protected, slot]
 

Slave error handling.

Definition at line 803 of file kmacctexppop.cpp.

References QTimer::singleShot(), and slotCancel().

Referenced by startJob().

void KMAcctExpPop::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 830 of file kmacctexppop.cpp.

References QMemArray< char >::resize().

Referenced by slotJobFinished(), and slotMsgRetrieved().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kmail Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat May 1 11:37:35 2004 by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2003