kmail

KMKernel Class Reference

#include <kmkernel.h>

Inheritance diagram for KMKernel:

KMailIface 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 DCOP 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

void dumpDeadLetters ()
void slotRequestConfigSync ()
void slotEmptyTrash ()
void slotShowConfigurationDialog ()
void slotRunBackgroundTasks ()
void slotConfigChanged ()

Signals

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

Public Member Functions

 KMKernel (QObject *parent=0, const char *name=0)
 ~KMKernel ()
void checkMail ()
QStringList accounts ()
void checkAccount (const QString &account)
int openComposer (const QString &to, const QString &cc, const QString &bcc, const QString &subject, const QString &body, int hidden, const KURL &messageFile, const KURL::List &attachURLs, const QCStringList &customHeaders)
int openComposer (const QString &to, const QString &cc, const QString &bcc, const QString &subject, const QString &body, int hidden, const KURL &messageFile, const KURL::List &attachURLs)
int openComposer (const QString &to, const QString &cc, const QString &bcc, const QString &subject, const QString &body, int hidden, const KURL &messageFile, const KURL &attachURL)
int openComposer (const QString &to, const QString &cc, const QString &bcc, const QString &subject, const QString &body, int hidden, const KURL &messageFile)
int openComposer (const QString &to, const QString &cc, const QString &bcc, const QString &subject, const QString &body, int hidden, const QString &attachName, const QCString &attachCte, const QCString &attachData, const QCString &attachType, const QCString &attachSubType, const QCString &attachParamAttr, const QString &attachParamValue, const QCString &attachContDisp)
int openComposer (const QString &to, const QString &cc, const QString &bcc, const QString &subject, const QString &body, int hidden, const QString &attachName, const QCString &attachCte, const QCString &attachData, const QCString &attachType, const QCString &attachSubType, const QCString &attachParamAttr, const QString &attachParamValue, const QCString &attachContDisp, const QCString &attachCharset)
DCOPRef openComposer (const QString &to, const QString &cc, const QString &bcc, const QString &subject, const QString &body, bool hidden)
void setDefaultTransport (const QString &transport)
DCOPRef newMessage (const QString &to, const QString &cc, const QString &bcc, bool hidden, bool useFolderId, const KURL &messageFile, const KURL &attachURL)
int sendCertificate (const QString &to, const QByteArray &certData)
void openReader ()
int dcopAddMessage (const QString &foldername, const QString &messagefile, const QString &MsgStatusFlags=QString())
int dcopAddMessage (const QString &foldername, const KURL &messagefile, const QString &MsgStatusFlags=QString())
void dcopResetAddMessage ()
int dcopAddMessage_fastImport (const QString &foldername, const QString &messagefile, const QString &MsgStatusFlags=QString())
int dcopAddMessage_fastImport (const QString &foldername, const KURL &messagefile, const QString &MsgStatusFlags=QString())
QStringList folderList () const
DCOPRef getFolder (const QString &vpath)
void selectFolder (QString folder)
int timeOfLastMessageCountChange () const
virtual bool showMail (Q_UINT32 serialNumber, QString messageId)
virtual QString getFrom (Q_UINT32 serialNumber)
virtual QString debugScheduler ()
virtual QString debugSernum (Q_UINT32 serialNumber)
int viewMessage (const KURL &messageFile)
virtual void pauseBackgroundJobs ()
virtual void resumeBackgroundJobs ()
void stopNetworkJobs ()
void resumeNetworkJobs ()
void init ()
void readConfig ()
void cleanupImapFolders ()
void testDir (const char *_name)
void recoverDeadLetters ()
void initFolders (KConfig *cfg, bool _firstMessage=false)
void closeAllKMailWindows ()
void cleanup (void)
void quit ()
bool transferMail (QString &destinationDir)
void ungrabPtrKb (void)
void kmailMsgHandler (QtMsgType aType, const char *aMsg)
bool doSessionManagement ()
bool firstInstance ()
void setFirstInstance (bool value)
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 QCStringList &customHeaders)
void byteArrayToRemoteFile (const QByteArray &, const KURL &, bool overwrite=FALSE)
bool folderIsDraftOrOutbox (const KMFolder *)
bool folderIsDrafts (const KMFolder *)
bool folderIsTemplates (const KMFolder *)
bool folderIsTrash (KMFolder *)
bool folderIsSentMailFolder (const KMFolder *)
KMFolderfindFolderById (const QString &idString)
KInstance * xmlGuiInstance ()
void setXmlGuiInstance (KInstance *instance)
KMFolderinboxFolder ()
KMFolderoutboxFolder ()
KMFoldersentFolder ()
KMFoldertrashFolder ()
KMFolderdraftsFolder ()
KMFoldertemplatesFolder ()
KMFolderMgrfolderMgr ()
KMFolderMgrimapFolderMgr ()
KMFolderMgrdimapFolderMgr ()
KMFolderMgrsearchFolderMgr ()
UndoStackundoStack ()
AccountManageracctMgr ()
KMFilterMgrfilterMgr ()
KMFilterMgrpopFilterMgr ()
KMFilterActionDictfilterActionDict ()
KMail::MessageSendermsgSender ()
KMMsgIndexmsgIndex ()
KPIM::ThreadWeaver::Weaver * weaver ()
KPIM::IdentityManager * identityManager ()
QString firstMessage ()
JobSchedulerjobScheduler ()
void compactAllFolders ()
void expireAllFoldersNow ()
KMailICalIfaceImpliCalIface ()
bool firstStart ()
QString previousVersion ()
bool startingUp ()
void setStartingUp (bool flag)
bool shuttingDown ()
void setShuttingDown (bool flag)
void serverReady (bool flag)
bool haveSystemTrayApplet ()
bool registerSystemTrayApplet (const KSystemTray *)
bool unregisterSystemTrayApplet (const KSystemTray *)
bool handleCommandLine (bool noArgsOpensReader)
void emergencyExit (const QString &reason)
unsigned long getNextMsgSerNum ()
QTextCodec * networkCodec ()
KMainWindow * mainWin ()
void setContextMenuShown (bool flag)
bool contextMenuShown () const
::KIMProxy * imProxy ()
bool mailCheckAborted () const
void enableMailCheck ()
void abortMailCheck ()
bool canQueryClose ()
void messageCountChanged ()
KWallet::Wallet * wallet ()
KMMainWidgetgetKMMainWidget ()
QValueList< QGuardedPtr< KMFolder > > allFolders ()
void raise ()

Static Public Member Functions

static bool askToGoOnline ()
static bool isOffline ()
static KMKernelself ()
static KConfig * config ()
static QString localDataPath ()

Protected Slots

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

Member Function Documentation

void KMKernel::checkMail (  )  [virtual]

dcop callable stuff

Implements KMailIface.

Definition at line 317 of file kmkernel.cpp.

int KMKernel::openComposer ( const QString &  to,
const QString &  cc,
const QString &  bcc,
const QString &  subject,
const QString &  body,
int  hidden,
const KURL &  messageFile,
const KURL::List &  attachURLs,
const QCStringList &  customHeaders 
)

returns id of composer if more are opened

Definition at line 369 of file kmkernel.cpp.

int KMKernel::openComposer ( const QString &  to,
const QString &  cc,
const QString &  bcc,
const QString &  subject,
const QString &  body,
int  hidden,
const KURL &  messageFile,
const KURL::List &  attachURLs 
) [inline, virtual]

For backward compatibility.

Implements KMailIface.

Definition at line 102 of file kmkernel.h.

int KMKernel::openComposer ( const QString &  to,
const QString &  cc,
const QString &  bcc,
const QString &  subject,
const QString &  body,
int  hidden,
const KURL &  messageFile,
const KURL &  attachURL 
) [inline, virtual]

For backward compatibility.

Implements KMailIface.

Definition at line 110 of file kmkernel.h.

int KMKernel::openComposer ( const QString &  to,
const QString &  cc,
const QString &  bcc,
const QString &  subject,
const QString &  body,
int  hidden,
const KURL &  messageFile 
) [inline, virtual]

For backward compatibility.

Implements KMailIface.

Definition at line 117 of file kmkernel.h.

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

For backward compatibility.

Deprecated:

Implements KMailIface.

Definition at line 443 of file kmkernel.cpp.

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

Open composer and return reference to DCOP interface of composer window.

If hidden is true, the window will not be shown. If you use that option, it's your responsibility to call the send() function of the composer in order to actually send the mail.

Implements KMailIface.

Definition at line 576 of file kmkernel.cpp.

void KMKernel::setDefaultTransport ( const QString &  transport  )  [virtual]

DCOP call used to set the default transport.

Implements KMailIface.

Definition at line 565 of file kmkernel.cpp.

DCOPRef KMKernel::newMessage ( const QString &  to,
const QString &  cc,
const QString &  bcc,
bool  hidden,
bool  useFolderId,
const KURL &  messageFile,
const KURL &  attachURL 
)

DCOP call used by the Kontact plugin to create a new message.

Definition at line 609 of file kmkernel.cpp.

int KMKernel::sendCertificate ( const QString &  to,
const QByteArray &  certData 
) [virtual]

Send a certificate request to the CA specified in to.

The certificate is stored in the byte array certData. It needs to stored according to BER and PKCS#10. This method will set content type encoding, mime types, etc. as per the MailTT specification.

Implements KMailIface.

Definition at line 669 of file kmkernel.cpp.

int KMKernel::dcopAddMessage ( const QString &  foldername,
const QString &  messagefile,
const QString &  MsgStatusFlags = QString() 
) [virtual]

Parameters:
foldername the requested foldername in kmail (at the zero level in the foldertree.

Parameters:
messagefile the name of the filename (local) with the message to be added.
MsgStatusFlags a string coding the status of the message with a char for each status e.g. a 'N' for new this param is optional
Returns:
=1, message added to folder, if folder doesn't exist, folder has been created. =0, an error occurred. =-1, couldn't create folder and it didn't exist =-2, couldn't read messageFile. =-3, Can't allocate memory. =-4, Message already exists in folder.

Implements KMailIface.

Definition at line 762 of file kmkernel.cpp.

void KMKernel::dcopResetAddMessage (  )  [virtual]

Clears the list of added message ids which is used to filter out duplicates.

Implements KMailIface.

Definition at line 937 of file kmkernel.cpp.

int KMKernel::dcopAddMessage_fastImport ( const QString &  foldername,
const QString &  messagefile,
const QString &  MsgStatusFlags = QString() 
) [virtual]

add messages without rejecting duplicates

Implements KMailIface.

Definition at line 943 of file kmkernel.cpp.

bool KMKernel::showMail ( Q_UINT32  serialNumber,
QString  messageId 
) [virtual]

Shows the specified message in a separate message window.

Parameters:
serialNumber the serial number of the message to be shown.
messageId this parameter is ignored.

Implements KMailIface.

Definition at line 1078 of file kmkernel.cpp.

QString KMKernel::getFrom ( Q_UINT32  serialNumber  )  [virtual]

DCOP-enabled for use in kaddressbook drop.

Implements KMailIface.

Definition at line 1128 of file kmkernel.cpp.

void KMKernel::pauseBackgroundJobs (  )  [virtual]

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

Implements KMailIface.

Definition at line 1185 of file kmkernel.cpp.

void KMKernel::resumeBackgroundJobs (  )  [virtual]

Resumes all background jobs and allows new jobs to be started.

Implements KMailIface.

Definition at line 1191 of file kmkernel.cpp.

void KMKernel::stopNetworkJobs (  )  [virtual]

Stops all network related jobs and enter offline mode New network jobs cannot be started.

Implements KMailIface.

Definition at line 1197 of file kmkernel.cpp.

void KMKernel::resumeNetworkJobs (  )  [virtual]

Resumes all network related jobs and enter online mode New network jobs can be started.

Implements KMailIface.

Definition at line 1207 of file kmkernel.cpp.

bool KMKernel::askToGoOnline (  )  [static]

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 1229 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 1221 of file kmkernel.cpp.

static KMKernel* KMKernel::self (  )  [inline, static]

normal control stuff

Definition at line 232 of file kmkernel.h.

bool KMKernel::transferMail ( QString &  destinationDir  ) 

Returns true if the transfer was successful, otherwise false.

In any case destinationDir contains the path to the current mail storage when the method returns.

Definition at line 1759 of file kmkernel.cpp.

bool KMKernel::folderIsDraftOrOutbox ( const KMFolder  ) 

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

Definition at line 2064 of file kmkernel.cpp.

bool KMKernel::folderIsSentMailFolder ( const KMFolder  ) 

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

Definition at line 2122 of file kmkernel.cpp.

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

Find a folder by ID string in all folder managers.

Definition at line 2309 of file kmkernel.cpp.

KPIM::IdentityManager * KMKernel::identityManager (  ) 

return the pointer to the identity manager

Definition at line 2138 of file kmkernel.cpp.

void KMKernel::compactAllFolders (  )  [virtual]

Compact all folders, used for the gui action (and from DCOP).

Implements KMailIface.

Definition at line 2302 of file kmkernel.cpp.

void KMKernel::expireAllFoldersNow (  ) 

Expire all folders, used for the gui action.

Definition at line 2295 of file kmkernel.cpp.

QString KMKernel::localDataPath (  )  [static]

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

The path ends with '/'.

Definition at line 2011 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 2018 of file kmkernel.cpp.

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

Reimplemented from KMailIface.

Implements KMailIface.

Definition at line 194 of file kmkernel.cpp.

unsigned long KMKernel::getNextMsgSerNum (  ) 

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

KMainWindow * KMKernel::mainWin (  ) 

returns a reference to the first Mainwin or a temporary Mainwin

Definition at line 2151 of file kmkernel.cpp.

KIMProxy * KMKernel::imProxy (  ) 

Get a reference to KMail's KIMProxy instance.

Returns:
a pointer to a valid KIMProxy

Definition at line 2321 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 2331 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 2326 of file kmkernel.cpp.

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 2336 of file kmkernel.cpp.

void KMKernel::messageCountChanged (  ) 

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

Definition at line 2361 of file kmkernel.cpp.

Wallet * KMKernel::wallet (  ) 

Open KDE wallet and set it to kmail folder.

Definition at line 2371 of file kmkernel.cpp.

KMMainWidget * KMKernel::getKMMainWidget (  ) 

Get first mainwidget.

Definition at line 2244 of file kmkernel.cpp.

QValueList< QGuardedPtr< KMFolder > > KMKernel::allFolders (  ) 

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

Definition at line 2400 of file kmkernel.cpp.

void KMKernel::dumpDeadLetters (  )  [slot]

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

Definition at line 1894 of file kmkernel.cpp.

void KMKernel::slotRequestConfigSync (  )  [slot]

Call this slot instead of directly KConfig::sync() to minimize the overall config writes.

Calling this slot will schedule a sync of the application config file using a timer, so that many consecutive calls can be condensed into a single sync, which is more efficient.

Definition at line 1984 of file kmkernel.cpp.

void KMKernel::slotEmptyTrash (  )  [slot]

empty all the trash bins

Definition at line 2182 of file kmkernel.cpp.


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