#include <popaccount.h>

Inherits KMail::NetworkAccount.

Public Member Functions

virtual void init (void)
 
virtual TDEIO::MetaData slaveConfig () const
 
virtual void pseudoAssign (const KMAccount *a)
 
virtual TQString 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 TQString type (void) const
 
virtual void readConfig (TDEConfig &)
 
virtual void writeConfig (TDEConfig &)
 
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 (TDEIO::Job *, const TQString &)
 
void slotData (TDEIO::Job *, const TQByteArray &)
 
void slotResult (TDEIO::Job *)
 
void slotCancel ()
 
void slotAbortRequested ()
 
void slotJobFinished ()
 
void slotSlaveError (TDEIO::Slave *, int, const TQString &)
 
void slotGetNextHdr ()
 

Protected Member Functions

 PopAccount (AccountManager *owner, const TQString &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
 
TDEIO::SimpleJob * job
 
TQMap< TQString, int > mMsgsPendingDownload
 
TQPtrList< KMPopHeaders > headersOnServer
 
TQPtrListIterator< KMPopHeaders > headerIt
 
bool headers
 
TQMap< TQString, bool > mHeaderDeleteUids
 
TQMap< TQString, bool > mHeaderDownUids
 
TQMap< TQString, bool > mHeaderLaterUids
 
TQStringList idsOfMsgs
 
TQValueList< int > lensOfMsgs
 
TQMap< TQString, TQString > mUidForIdMap
 
TQDict< int > mUidsOfSeenMsgsDict
 
TQDict< int > mUidsOfNextSeenMsgsDict
 
TQValueVector< int > mTimeOfSeenMsgsVector
 
TQMap< TQString, int > mTimeOfNextSeenMsgsMap
 
TQDict< int > mSizeOfNextSeenMsgsDict
 
TQStringList idsOfMsgsToDelete
 
TQStringList idsOfForcedDeletes
 
int indexOfCurrentMsg
 
TQValueList< KMMessage * > msgsAwaitingProcessing
 
TQStringList msgIdsAwaitingProcessing
 
TQStringList msgUidsAwaitingProcessing
 
TQByteArray curMsgData
 
TQDataStream * curMsgStrm
 
int curMsgLen
 
Stage stage
 
TQTimer processMsgsTimer
 
int processingDelay
 
int numMsgs
 
int numBytes
 
int numBytesToRead
 
int numBytesRead
 
int numMsgBytesRead
 
bool interactive
 
bool mProcessing
 
bool mUidlFinished
 
int dataCounter
 

Friends

class ::AccountManager
 

Detailed Description

KMail account for pop mail account.

Definition at line 27 of file popaccount.h.

Member Function Documentation

◆ connectJob()

void KMail::PopAccount::connectJob ( )
protected

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

Definition at line 287 of file popaccount.cpp.

◆ filterOnServer()

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.

◆ filterOnServerCheckSize()

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.

◆ leaveOnServer()

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.

◆ leaveOnServerCount()

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.

◆ leaveOnServerDays()

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.

◆ leaveOnServerSize()

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.

◆ processRemainingQueuedMessages()

void KMail::PopAccount::processRemainingQueuedMessages ( )
protected

Process any queued messages.

Definition at line 815 of file popaccount.cpp.

◆ pseudoAssign()

void KMail::PopAccount::pseudoAssign ( const KMAccount *  a)
virtual

A weak assignment operator.

Definition at line 128 of file popaccount.cpp.

◆ saveUidList()

void KMail::PopAccount::saveUidList ( )
protected

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

Definition at line 829 of file popaccount.cpp.

◆ slotAbortRequested

void KMail::PopAccount::slotAbortRequested ( )
protectedslot

Kills the job if still stage == List.

Definition at line 352 of file popaccount.cpp.

◆ slotCancel

void KMail::PopAccount::slotCancel ( )
protectedslot

Cleans up after a user cancels the current job.

Definition at line 299 of file popaccount.cpp.

◆ slotData

void KMail::PopAccount::slotData ( TDEIO::Job *  job,
const TQByteArray &  data 
)
protectedslot

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

Definition at line 877 of file popaccount.cpp.

◆ slotGetNextHdr

void KMail::PopAccount::slotGetNextHdr ( )
protectedslot

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

Definition at line 1071 of file popaccount.cpp.

◆ slotGetNextMsg

void KMail::PopAccount::slotGetNextMsg ( )
protectedslot

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

Definition at line 854 of file popaccount.cpp.

◆ slotJobFinished

void KMail::PopAccount::slotJobFinished ( )
protectedslot

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.

◆ slotMsgRetrieved

void KMail::PopAccount::slotMsgRetrieved ( TDEIO::Job *  ,
const TQString &  infoMsg 
)
protectedslot

A messages has been retrieved successfully.

The next data belongs to the next message.

Definition at line 444 of file popaccount.cpp.

◆ slotProcessPendingMsgs

void KMail::PopAccount::slotProcessPendingMsgs ( )
protectedslot

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.

◆ slotResult

void KMail::PopAccount::slotResult ( TDEIO::Job *  )
protectedslot

Finished downloading the current tdeio 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.

◆ slotSlaveError

void KMail::PopAccount::slotSlaveError ( TDEIO::Slave *  aSlave,
int  error,
const TQString &  errorMsg 
)
protectedslot

Slave error handling.

Definition at line 1044 of file popaccount.cpp.

◆ startJob()

void KMail::PopAccount::startJob ( )
protected

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

Definition at line 367 of file popaccount.cpp.

◆ type()

TQString KMail::PopAccount::type ( void  ) const
virtual

Inherited methods.

Definition at line 99 of file popaccount.cpp.

◆ usePipelining()

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

Sending of several commands at once.

Definition at line 46 of file popaccount.h.


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