kmail

KMAccount Class Reference

Inheritance diagram for KMAccount:

KMAcctLocal KMAcctMaildir KMail::NetworkAccount KMail::ImapAccountBase KMail::PopAccount KMAcctCachedImap KMAcctImap List of all members.

Detailed Description

Definition at line 73 of file kmaccount.h.


Public Types

enum  CheckStatus {
  CheckOK, CheckIgnored, CheckCanceled, CheckAborted,
  CheckError
}

Signals

virtual void finishedCheck (bool newMail, CheckStatus status)
virtual void newMailsProcessed (const QMap< QString, int > &newInFolder)

Public Member Functions

virtual ~KMAccount ()
virtual QString type () const
virtual void setName (const QString &)
virtual QString name () const
virtual void clearPasswd ()
virtual void init ()
virtual void pseudoAssign (const KMAccount *a)
KMFolderfolder (void) const
virtual void setFolder (KMFolder *, bool addAccount=false)
QString trash () const
virtual void setTrash (const QString &aTrash)
virtual void processNewMail (bool interactive)=0
virtual void readConfig (KConfig &config)
virtual void writeConfig (KConfig &config)
virtual void setCheckInterval (int aInterval)
int checkInterval (void) const
int defaultCheckInterval (void) const
void deleteFolderJobs ()
virtual void ignoreJobsForMessage (KMMessage *)
virtual void setCheckExclude (bool aExclude)
bool checkExclude (void) const
const QString & precommand (void) const
virtual void setPrecommand (const QString &cmd)
bool runPrecommand (const QString &precommand)
bool hasInbox () const
virtual void setHasInbox (bool has)
virtual void invalidateIMAPFolders ()
virtual bool mailCheckCanProceed () const
bool checkingMail ()
virtual void setCheckingMail (bool checking)
void checkDone (bool newMail, CheckStatus status)
virtual void cancelMailCheck ()
ProgressItem * mailCheckProgressItem () const

Static Public Member Functions

static QString encryptStr (const QString &inStr)
static QString decryptStr (const QString &inStr)
static QString importPassword (const QString &)

Static Public Attributes

static const int DefaultCheckInterval = 5

Protected Slots

virtual void mailCheck ()
virtual void sendReceipts ()
virtual void precommandExited (bool)

Protected Member Functions

 KMAccount (AccountManager *owner, const QString &accountName, uint id)
virtual bool processNewMsg (KMMessage *msg)
virtual void sendReceipt (KMMessage *msg)
virtual void installTimer ()
virtual void deinstallTimer ()
void addToNewInFolder (QString folderId, int num)

Protected Attributes

QString mPrecommand
QString mTrash
AccountManagermOwner
QGuardedPtr< KMAcctFoldermFolder
QTimer * mTimer
int mInterval
bool mExclude
bool mCheckingMail: 1
bool mPrecommandSuccess
QValueList< KMMessage * > mReceipts
QPtrList< FolderJobmJobList
bool mHasInbox: 1
QGuardedPtr< ProgressItem > mMailCheckProgressItem

Friends

class KMail::AccountManager
class ::KMail::FolderJob
class ::AccountsPageReceivingTab
class ::KMFolderCachedImap

Member Function Documentation

virtual QString KMAccount::type ( void   )  const [inline, virtual]

Returns type of the account.

Reimplemented in KMAcctCachedImap, KMAcctImap, KMAcctLocal, KMAcctMaildir, and KMail::PopAccount.

Definition at line 93 of file kmaccount.h.

void KMAccount::setName ( const QString &   )  [virtual]

Reimplemented, set account name.

Definition at line 114 of file kmaccount.cpp.

virtual QString KMAccount::name (  )  const [inline, virtual]

Account name (reimpl because of ambiguous QObject::name()).

Definition at line 103 of file kmaccount.h.

void KMAccount::clearPasswd (  )  [virtual]

Set password to "" (empty string).

Reimplemented in KMail::NetworkAccount.

Definition at line 121 of file kmaccount.cpp.

void KMAccount::init (  )  [virtual]

Set intelligent default values to the fields of the account.

Reimplemented in KMail::ImapAccountBase, KMAcctCachedImap, KMAcctLocal, KMAcctMaildir, KMail::NetworkAccount, and KMail::PopAccount.

Definition at line 98 of file kmaccount.cpp.

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

A weak assignment operator.

Reimplemented in KMail::ImapAccountBase, KMAcctCachedImap, KMAcctImap, KMAcctLocal, KMAcctMaildir, KMail::NetworkAccount, and KMail::PopAccount.

Definition at line 431 of file kmaccount.cpp.

KMFolder* KMAccount::folder ( void   )  const [inline]

There can be exactly one folder that is fed by messages from an account.

Definition at line 123 of file kmaccount.h.

QString KMAccount::trash (  )  const [inline]

the id of the trash folder (if any) for this account

Definition at line 129 of file kmaccount.h.

virtual void KMAccount::processNewMail ( bool  interactive  )  [pure 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.

Implemented in KMAcctCachedImap, KMAcctImap, KMAcctLocal, KMAcctMaildir, and KMail::PopAccount.

void KMAccount::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 in KMail::ImapAccountBase, KMAcctCachedImap, KMAcctImap, KMAcctLocal, KMAcctMaildir, KMail::NetworkAccount, and KMail::PopAccount.

Definition at line 140 of file kmaccount.cpp.

void KMAccount::writeConfig ( KConfig &  config  )  [virtual]

Write all account information to given config file.

The config group is already properly set by the caller.

Reimplemented in KMail::ImapAccountBase, KMAcctCachedImap, KMAcctLocal, KMAcctMaildir, KMail::NetworkAccount, and KMail::PopAccount.

Definition at line 163 of file kmaccount.cpp.

void KMAccount::setCheckInterval ( int  aInterval  )  [virtual]

Set/get interval for checking if new mail arrived (in minutes).

An interval of zero (or less) disables the automatic checking.

Definition at line 283 of file kmaccount.cpp.

int KMAccount::defaultCheckInterval ( void   )  const [inline]

This can be used to provide a more complex calculation later if we want.

Definition at line 162 of file kmaccount.h.

void KMAccount::deleteFolderJobs (  ) 

Deletes the set of FolderJob associated with this account.

Definition at line 293 of file kmaccount.cpp.

void KMAccount::ignoreJobsForMessage ( KMMessage  )  [virtual]

delete jobs associated with this message

Reimplemented in KMAcctImap.

Definition at line 301 of file kmaccount.cpp.

void KMAccount::setCheckExclude ( bool  aExclude  )  [virtual]

Set/get whether account should be part of the accounts checked with "Check Mail".

Definition at line 315 of file kmaccount.cpp.

const QString& KMAccount::precommand ( void   )  const [inline]

Pre command.

Definition at line 183 of file kmaccount.h.

bool KMAccount::runPrecommand ( const QString &  precommand  ) 

Runs the precommand.

If the precommand is empty, the method will just return success and not actually do anything

Returns:
True if successful, false otherwise

Definition at line 346 of file kmaccount.cpp.

QString KMAccount::encryptStr ( const QString &  inStr  )  [static]

Very primitive en/de-cryption so that the password is not readable in the config file.

But still very easy breakable.

Definition at line 398 of file kmaccount.cpp.

bool KMAccount::hasInbox (  )  const [inline]

Returns:
whether this account has an inbox

Definition at line 204 of file kmaccount.h.

void KMAccount::invalidateIMAPFolders (  )  [virtual]

If this account is a disconnected IMAP account, invalidate it.

Reimplemented in KMAcctCachedImap.

Definition at line 426 of file kmaccount.cpp.

virtual bool KMAccount::mailCheckCanProceed (  )  const [inline, virtual]

Determines whether the account can be checked, currently.

Reimplementations can use this to prevent mailchecks due to exceeded connection limits, or because a network link iis down.

Returns:
whether mail checks can proceed

Reimplemented in KMail::NetworkAccount.

Definition at line 218 of file kmaccount.h.

bool KMAccount::checkingMail (  )  [inline]

Set/Get if this account is currently checking mail.

Reimplemented in KMail::ImapAccountBase.

Definition at line 223 of file kmaccount.h.

void KMAccount::checkDone ( bool  newMail,
CheckStatus  status 
)

Call this if the newmail-check ended.

Parameters:
newMail true if new mail arrived
status the status of the mail check

Definition at line 444 of file kmaccount.cpp.

virtual void KMAccount::cancelMailCheck (  )  [inline, virtual]

Abort all running mail checks.

Used when closing the last KMMainWin. Ensure that mail check can be restarted later, e.g. if reopening a mainwindow from a composer window.

Reimplemented in KMail::ImapAccountBase, KMAcctCachedImap, and KMAcctImap.

Definition at line 238 of file kmaccount.h.

ProgressItem* KMAccount::mailCheckProgressItem (  )  const [inline]

Call ->progress( int foo ) on this to update the account's progress indicators.

Definition at line 244 of file kmaccount.h.

virtual void KMAccount::finishedCheck ( bool  newMail,
CheckStatus  status 
) [virtual, signal]

Emitted after the mail check is finished.

Parameters:
newMail true if there was new mail
status the status of the mail check

virtual void KMAccount::newMailsProcessed ( const QMap< QString, int > &  newInFolder  )  [virtual, signal]

Emitted after the mail check is finished.

Parameters:
newInFolder number of new messages for each folder

bool KMAccount::processNewMsg ( KMMessage msg  )  [protected, virtual]

Does filtering and storing in a folder for the given message.

Shall be called from within processNewMail() to process the new messages. Returns false if failed to add new message.

Definition at line 197 of file kmaccount.cpp.

void KMAccount::sendReceipt ( KMMessage msg  )  [protected, virtual]

Send receipt of message back to sender (confirming delivery).

Checks the config settings, calls

See also:
KMMessage::createDeliveryReceipt and queues the resulting message in mReceipts.

Definition at line 178 of file kmaccount.cpp.

void KMAccount::installTimer (  )  [protected, virtual]

Install/deinstall automatic new-mail checker timer.

Definition at line 322 of file kmaccount.cpp.

void KMAccount::addToNewInFolder ( QString  folderId,
int  num 
) [protected]

Call this to increase the number of new messages in a folder for messages which are _not_ processed with processNewMsg().

Parameters:
folderId the id of the folder
num the number of new message in this folder

Definition at line 465 of file kmaccount.cpp.


Member Data Documentation

const int KMAccount::DefaultCheckInterval = 5 [static]

The default check interval.

Definition at line 88 of file kmaccount.h.


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