• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • kdepim
  • Sitemap
  • Contact Us
 

kmail

KMKernel Class Reference

#include <kmkernel.h>

Inheritance diagram for KMKernel:

Inheritance graph
[legend]

List of all members.


Detailed Description

Central point of coordination in KMail.

The KMKernel class represents the core of KMail, where the different parts come together and are coordinated. It is currently also the class which exports KMail's main D-BUS interfaces. The kernel is responsible for creating various (singleton) objects such as the UndoStack, the folder managers and filter manager, etc.

Definition at line 83 of file kmkernel.h.


Public Slots

Q_SCRIPTABLE QStringList accounts ()
Q_SCRIPTABLE bool canQueryClose ()
Q_SCRIPTABLE void checkAccount (const QString &account)
Q_SCRIPTABLE void checkMail ()
Q_SCRIPTABLE void compactAllFolders ()
Q_SCRIPTABLE int dbusAddMessage (const QString &foldername, const QString &messageFile, const QString &MsgStatusFlags=QString())
Q_SCRIPTABLE int dbusAddMessage_fastImport (const QString &foldername, const QString &messageFile, const QString &MsgStatusFlags=QString())
Q_SCRIPTABLE void dbusResetAddMessage ()
Q_SCRIPTABLE QString debugScheduler ()
Q_SCRIPTABLE QString debugSernum (quint32 serialNumber)
void dumpDeadLetters ()
Q_SCRIPTABLE QStringList folderList () const
Q_SCRIPTABLE QString getFolder (const QString &vpath)
Q_SCRIPTABLE QString getFrom (quint32 serialNumber)
Q_SCRIPTABLE bool handleCommandLine (bool noArgsOpensReader)
Q_SCRIPTABLE QDBusObjectPath newMessage (const QString &to, const QString &cc, const QString &bcc, bool hidden, bool useFolderId, const QString &messageFile, const QString &attachURL)
Q_SCRIPTABLE QDBusObjectPath openComposer (const QString &to, const QString &cc, const QString &bcc, const QString &subject, const QString &body, bool hidden)
Q_SCRIPTABLE int openComposer (const QString &to, const QString &cc, const QString &bcc, const QString &subject, const QString &body, bool hidden, const QString &attachName, const QByteArray &attachCte, const QByteArray &attachData, const QByteArray &attachType, const QByteArray &attachSubType, const QByteArray &attachParamAttr, const QString &attachParamValue, const QByteArray &attachContDisp, const QByteArray &attachCharset)
Q_SCRIPTABLE int openComposer (const QString &to, const QString &cc, const QString &bcc, const QString &subject, const QString &body, bool hidden, const QString &messageFile, const QStringList &attachmentPaths, const QStringList &customHeaders)
Q_SCRIPTABLE void openReader ()
Q_SCRIPTABLE void pauseBackgroundJobs ()
Q_SCRIPTABLE void resumeBackgroundJobs ()
Q_SCRIPTABLE void resumeNetworkJobs ()
Q_SCRIPTABLE void selectFolder (const QString &folder)
Q_SCRIPTABLE int sendCertificate (const QString &to, const QByteArray &certData)
Q_SCRIPTABLE void setDefaultTransport (const QString &transport)
Q_SCRIPTABLE bool showMail (quint32 serialNumber, const QString &messageId)
void slotConfigChanged ()
void slotEmptyTrash ()
void slotRequestConfigSync ()
void slotRunBackgroundTasks ()
void slotShowConfigurationDialog ()
Q_SCRIPTABLE void stopNetworkJobs ()
Q_SCRIPTABLE int timeOfLastMessageCountChange () const
Q_SCRIPTABLE int viewMessage (const KUrl &messageFile)

Signals

void configChanged ()
void customTemplatesChanged ()
void folderRemoved (KMFolder *aFolder)
void onlineStatusChanged (GlobalSettings::EnumNetworkState::type)
Q_SCRIPTABLE void unreadCountChanged ()

Public Member Functions

void abortMailCheck ()
AccountManager * acctMgr ()
void action (bool mailto, bool check, const QString &to, const QString &cc, const QString &bcc, const QString &subj, const QString &body, const KUrl &messageFile, const KUrl::List &attach, const QStringList &customHeaders)
QList< QPointer< KMFolder > > allFolders ()
void byteArrayToRemoteFile (const QByteArray &, const KUrl &, bool overwrite=false)
void cleanup (void)
void cleanupImapFolders ()
void closeAllKMailWindows ()
bool contextMenuShown () const
KMFolderMgr * dimapFolderMgr ()
bool doSessionManagement ()
KMFolder * draftsFolder ()
void emergencyExit (const QString &reason)
void enableMailCheck ()
void expireAllFoldersNow ()
KMFilterActionDict * filterActionDict ()
KMFilterMgr * filterMgr ()
KMFolder * findFolderById (const QString &idString)
bool firstInstance ()
bool firstStart () const
bool folderIsDraftOrOutbox (const KMFolder *)
bool folderIsDrafts (const KMFolder *)
bool folderIsSentMailFolder (const KMFolder *)
bool folderIsTemplates (const KMFolder *)
bool folderIsTrash (KMFolder *)
KMFolderMgr * folderMgr ()
KMMainWidget * getKMMainWidget ()
unsigned long getNextMsgSerNum ()
bool haveSystemTrayApplet ()
KMailICalIfaceImpl & iCalIface ()
KPIMIdentities::IdentityManager * identityManager ()
KMFolderMgr * imapFolderMgr ()
KMFolder * inboxFolder ()
void init ()
void initFolders (KConfig *cfg)
JobScheduler * jobScheduler ()
 KMKernel (QObject *parent=0, const char *name=0)
bool mailCheckAborted () const
KMainWindow * mainWin ()
void messageCountChanged ()
KMail::MessageSender * msgSender ()
KMMessageTagMgr * msgTagMgr ()
QTextCodec * networkCodec ()
KMFolder * outboxFolder ()
KMFilterMgr * popFilterMgr ()
QString previousVersion () const
void quit ()
void raise ()
void readConfig ()
void recoverDeadLetters ()
bool registerSystemTrayApplet (const KSystemTrayIcon *)
KMFolderMgr * searchFolderMgr ()
KMFolder * sentFolder ()
void serverReady (bool flag)
void setContextMenuShown (bool flag)
void setFirstInstance (bool value)
void setShuttingDown (bool flag)
void setStartingUp (bool flag)
void setupDBus ()
void setXmlGuiInstance (const KComponentData &instance)
bool shuttingDown () const
bool startingUp () const
KMFolder * templatesFolder ()
void testDir (const char *_name)
bool transferMail (QString &destinationDir)
KMFolder * trashFolder ()
UndoStack * undoStack ()
bool unregisterSystemTrayApplet (const KSystemTrayIcon *)
void updatedTemplates ()
KWallet::Wallet * wallet ()
ThreadWeaver::Weaver * weaver ()
const KComponentData & xmlGuiInstance ()
 ~KMKernel ()

Static Public Member Functions

static bool askToGoOnline ()
static KConfig * config ()
static bool isOffline ()
static QString localDataPath ()
static KMKernel * self ()

Protected Slots

void slotDataReq (KIO::Job *, QByteArray &)
void slotResult (KJob *)

Constructor & Destructor Documentation

KMKernel::KMKernel ( QObject *  parent = 0,
const char *  name = 0 
) [explicit]

Definition at line 95 of file kmkernel.cpp.

KMKernel::~KMKernel (  ) 

Definition at line 172 of file kmkernel.cpp.


Member Function Documentation

void KMKernel::abortMailCheck (  ) 

Set the state of the abort requested variable to true, (to let the current jobs run, but stop when possible).

This is used to cancel mail checks when closing the last mainwindow

Definition at line 2221 of file kmkernel.cpp.

QStringList KMKernel::accounts (  )  [slot]

Definition at line 332 of file kmkernel.cpp.

AccountManager* KMKernel::acctMgr (  )  [inline]

Definition at line 311 of file kmkernel.h.

void KMKernel::action ( bool  mailto,
bool  check,
const QString &  to,
const QString &  cc,
const QString &  bcc,
const QString &  subj,
const QString &  body,
const KUrl &  messageFile,
const KUrl::List &  attach,
const QStringList &  customHeaders 
)

Definition at line 1799 of file kmkernel.cpp.

QList< QPointer< KMFolder > > KMKernel::allFolders (  ) 

Returns:
a list of all folders from all folder managers.

Definition at line 2287 of file kmkernel.cpp.

bool KMKernel::askToGoOnline (  )  [static]

End of D-Bus callable stuff.

A static helper function that asks the user if they want to go online.

Returns:
true if the user wants to go online

false if the user wants to stay offline

Definition at line 1160 of file kmkernel.cpp.

void KMKernel::byteArrayToRemoteFile ( const QByteArray &  aData,
const KUrl &  aURL,
bool  overwrite = false 
)

Definition at line 1818 of file kmkernel.cpp.

bool KMKernel::canQueryClose (  )  [slot]

Definition at line 2226 of file kmkernel.cpp.

void KMKernel::checkAccount ( const QString &  account  )  [slot]

Checks the account with the specified name for new mail.

If the account name is empty, all accounts not excluded from manual mail check will be checked.

Definition at line 337 of file kmkernel.cpp.

void KMKernel::checkMail (  )  [slot]

Start of D-Bus callable stuff.

The D-Bus methods need to be public slots, otherwise they can't be accessed.

Definition at line 327 of file kmkernel.cpp.

void KMKernel::cleanup ( void   ) 

Definition at line 1616 of file kmkernel.cpp.

void KMKernel::cleanupImapFolders (  ) 

Definition at line 1482 of file kmkernel.cpp.

void KMKernel::closeAllKMailWindows (  ) 

Definition at line 1584 of file kmkernel.cpp.

void KMKernel::compactAllFolders (  )  [slot]

Compact all folders, used for the GUI action (and from D-Bus).

Definition at line 2192 of file kmkernel.cpp.

KConfig * KMKernel::config (  )  [static]

Definition at line 2097 of file kmkernel.cpp.

void KMKernel::configChanged (  )  [signal]

bool KMKernel::contextMenuShown (  )  const [inline]

Definition at line 366 of file kmkernel.h.

void KMKernel::customTemplatesChanged (  )  [signal]

int KMKernel::dbusAddMessage ( const QString &  foldername,
const QString &  messageFile,
const QString &  MsgStatusFlags = QString() 
) [slot]

Definition at line 696 of file kmkernel.cpp.

int KMKernel::dbusAddMessage_fastImport ( const QString &  foldername,
const QString &  messageFile,
const QString &  MsgStatusFlags = QString() 
) [slot]

Add messages without rejecting duplicates.

Definition at line 867 of file kmkernel.cpp.

void KMKernel::dbusResetAddMessage (  )  [slot]

Definition at line 861 of file kmkernel.cpp.

QString KMKernel::debugScheduler (  )  [slot]

Definition at line 1079 of file kmkernel.cpp.

QString KMKernel::debugSernum ( quint32  serialNumber  )  [slot]

Definition at line 1085 of file kmkernel.cpp.

KMFolderMgr* KMKernel::dimapFolderMgr (  )  [inline]

Definition at line 308 of file kmkernel.h.

bool KMKernel::doSessionManagement (  ) 

Definition at line 1567 of file kmkernel.cpp.

KMFolder* KMKernel::draftsFolder (  )  [inline]

Definition at line 303 of file kmkernel.h.

void KMKernel::dumpDeadLetters (  )  [slot]

Save contents of all open composer widnows to ~/dead.letter.

Definition at line 1786 of file kmkernel.cpp.

void KMKernel::emergencyExit ( const QString &  reason  ) 

Reimplemented from KMailIface.

Definition at line 1943 of file kmkernel.cpp.

void KMKernel::enableMailCheck (  ) 

Set the state of the abort requested variable to false, i.e.

enable mail checking again

Definition at line 2211 of file kmkernel.cpp.

void KMKernel::expireAllFoldersNow (  ) 

Expire all folders, used for the gui action.

Definition at line 2185 of file kmkernel.cpp.

KMFilterActionDict* KMKernel::filterActionDict (  )  [inline]

Definition at line 314 of file kmkernel.h.

KMFilterMgr* KMKernel::filterMgr (  )  [inline]

Definition at line 312 of file kmkernel.h.

KMFolder * KMKernel::findFolderById ( const QString &  idString  ) 

Find a folder by ID string in all folder managers.

Definition at line 2199 of file kmkernel.cpp.

bool KMKernel::firstInstance (  )  [inline]

Definition at line 275 of file kmkernel.h.

bool KMKernel::firstStart (  )  const [inline]

Definition at line 329 of file kmkernel.h.

bool KMKernel::folderIsDraftOrOutbox ( const KMFolder *  folder  ) 

Returns true if the folder is either the outbox or one of the drafts-folders.

Definition at line 1963 of file kmkernel.cpp.

bool KMKernel::folderIsDrafts ( const KMFolder *  folder  ) 

Definition at line 1971 of file kmkernel.cpp.

bool KMKernel::folderIsSentMailFolder ( const KMFolder *  folder  ) 

Returns true if the folder is one of the sent-mail folders.

Definition at line 2017 of file kmkernel.cpp.

bool KMKernel::folderIsTemplates ( const KMFolder *  folder  ) 

Definition at line 1987 of file kmkernel.cpp.

bool KMKernel::folderIsTrash ( KMFolder *  folder  ) 

Definition at line 2003 of file kmkernel.cpp.

QStringList KMKernel::folderList (  )  const [slot]

Definition at line 964 of file kmkernel.cpp.

KMFolderMgr* KMKernel::folderMgr (  )  [inline]

Definition at line 306 of file kmkernel.h.

void KMKernel::folderRemoved ( KMFolder *  aFolder  )  [signal]

QString KMKernel::getFolder ( const QString &  vpath  )  [slot]

Definition at line 975 of file kmkernel.cpp.

QString KMKernel::getFrom ( quint32  serialNumber  )  [slot]

Definition at line 1060 of file kmkernel.cpp.

KMMainWidget * KMKernel::getKMMainWidget (  ) 

Get first mainwidget.

Definition at line 2138 of file kmkernel.cpp.

unsigned long KMKernel::getNextMsgSerNum (  ) 

Returns a message serial number that hasn't been used yet.

bool KMKernel::handleCommandLine ( bool  noArgsOpensReader  )  [slot]

Definition at line 204 of file kmkernel.cpp.

bool KMKernel::haveSystemTrayApplet (  ) 

Returns true if we have a system tray applet.

This is needed in order to know whether the application should be allowed to exit in case the last visible composer or separate message window is closed.

Definition at line 1923 of file kmkernel.cpp.

KMailICalIfaceImpl & KMKernel::iCalIface (  ) 

Definition at line 2109 of file kmkernel.cpp.

KPIMIdentities::IdentityManager * KMKernel::identityManager (  ) 

return the pointer to the identity manager

Definition at line 2033 of file kmkernel.cpp.

KMFolderMgr* KMKernel::imapFolderMgr (  )  [inline]

Definition at line 307 of file kmkernel.h.

KMFolder* KMKernel::inboxFolder (  )  [inline]

Definition at line 299 of file kmkernel.h.

void KMKernel::init ( void   ) 

Definition at line 1369 of file kmkernel.cpp.

void KMKernel::initFolders ( KConfig *  cfg  ) 

Definition at line 1288 of file kmkernel.cpp.

bool KMKernel::isOffline (  )  [static]

Checks if the current network state is online or offline.

Returns:
true if the network state is offline

false if the network state is online

Definition at line 1152 of file kmkernel.cpp.

JobScheduler* KMKernel::jobScheduler (  )  [inline]

Definition at line 322 of file kmkernel.h.

QString KMKernel::localDataPath (  )  [static]

Returns the full path of the user's local data directory for KMail.

The path ends with '/'.

Definition at line 1916 of file kmkernel.cpp.

bool KMKernel::mailCheckAborted (  )  const

Returns true IFF the user has requested that the current mail checks should be aborted.

Needs to be periodically polled.

Definition at line 2216 of file kmkernel.cpp.

KMainWindow * KMKernel::mainWin (  ) 

returns a reference to the first Mainwin or a temporary Mainwin

Definition at line 2041 of file kmkernel.cpp.

void KMKernel::messageCountChanged (  ) 

Called by the folder tree if the count of unread/total messages changed.

Definition at line 2248 of file kmkernel.cpp.

KMail::MessageSender * KMKernel::msgSender (  ) 

Definition at line 2310 of file kmkernel.cpp.

KMMessageTagMgr* KMKernel::msgTagMgr (  )  [inline]

Definition at line 316 of file kmkernel.h.

QTextCodec* KMKernel::networkCodec (  )  [inline]

Definition at line 356 of file kmkernel.h.

QDBusObjectPath KMKernel::newMessage ( const QString &  to,
const QString &  cc,
const QString &  bcc,
bool  hidden,
bool  useFolderId,
const QString &  messageFile,
const QString &  attachURL 
) [slot]

D-Bus call used by the Kontact plugin to create a new message.

Definition at line 606 of file kmkernel.cpp.

void KMKernel::onlineStatusChanged ( GlobalSettings::EnumNetworkState::type   )  [signal]

QDBusObjectPath KMKernel::openComposer ( const QString &  to,
const QString &  cc,
const QString &  bcc,
const QString &  subject,
const QString &  body,
bool  hidden 
) [slot]

Definition at line 572 of file kmkernel.cpp.

int KMKernel::openComposer ( const QString &  to,
const QString &  cc,
const QString &  bcc,
const QString &  subject,
const QString &  body,
bool  hidden,
const QString &  attachName,
const QByteArray &  attachCte,
const QByteArray &  attachData,
const QByteArray &  attachType,
const QByteArray &  attachSubType,
const QByteArray &  attachParamAttr,
const QString &  attachParamValue,
const QByteArray &  attachContDisp,
const QByteArray &  attachCharset 
) [slot]

Definition at line 460 of file kmkernel.cpp.

int KMKernel::openComposer ( const QString &  to,
const QString &  cc,
const QString &  bcc,
const QString &  subject,
const QString &  body,
bool  hidden,
const QString &  messageFile,
const QStringList &  attachmentPaths,
const QStringList &  customHeaders 
) [slot]

returns id of composer if more are opened

Definition at line 386 of file kmkernel.cpp.

Q_SCRIPTABLE void KMKernel::openReader (  )  [inline, slot]

Definition at line 99 of file kmkernel.h.

KMFolder* KMKernel::outboxFolder (  )  [inline]

Definition at line 300 of file kmkernel.h.

void KMKernel::pauseBackgroundJobs (  )  [slot]

Pauses all background jobs and does not allow new background jobs to be started.

Definition at line 1115 of file kmkernel.cpp.

KMFilterMgr* KMKernel::popFilterMgr (  )  [inline]

Definition at line 313 of file kmkernel.h.

QString KMKernel::previousVersion (  )  const [inline]

Definition at line 330 of file kmkernel.h.

void KMKernel::quit (  ) 

Definition at line 1184 of file kmkernel.cpp.

void KMKernel::raise (  ) 

Definition at line 1001 of file kmkernel.cpp.

void KMKernel::readConfig ( void   ) 

Definition at line 1475 of file kmkernel.cpp.

void KMKernel::recoverDeadLetters (  ) 

Definition at line 1261 of file kmkernel.cpp.

bool KMKernel::registerSystemTrayApplet ( const KSystemTrayIcon *  applet  ) 

Definition at line 1928 of file kmkernel.cpp.