kmail

KMKernel Class Reference

Central point of coordination in KMail. More...

#include <kmkernel.h>

Inheritance diagram for KMKernel:
KMailIface

List of all members.

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 (TQObject *parent=0, const char *name=0)
void checkMail ()
TQStringList accounts ()
void checkAccount (const TQString &account)
int openComposer (const TQString &to, const TQString &cc, const TQString &bcc, const TQString &subject, const TQString &body, int hidden, const KURL &messageFile, const KURL::List &attachURLs, const QCStringList &customHeaders)
int openComposer (const TQString &to, const TQString &cc, const TQString &bcc, const TQString &subject, const TQString &body, int hidden, const KURL &messageFile, const KURL::List &attachURLs)
int openComposer (const TQString &to, const TQString &cc, const TQString &bcc, const TQString &subject, const TQString &body, int hidden, const KURL &messageFile, const KURL &attachURL)
int openComposer (const TQString &to, const TQString &cc, const TQString &bcc, const TQString &subject, const TQString &body, int hidden, const KURL &messageFile)
int openComposer (const TQString &to, const TQString &cc, const TQString &bcc, const TQString &subject, const TQString &body, int hidden, const TQString &attachName, const TQCString &attachCte, const TQCString &attachData, const TQCString &attachType, const TQCString &attachSubType, const TQCString &attachParamAttr, const TQString &attachParamValue, const TQCString &attachContDisp)
int openComposer (const TQString &to, const TQString &cc, const TQString &bcc, const TQString &subject, const TQString &body, int hidden, const TQString &attachName, const TQCString &attachCte, const TQCString &attachData, const TQCString &attachType, const TQCString &attachSubType, const TQCString &attachParamAttr, const TQString &attachParamValue, const TQCString &attachContDisp, const TQCString &attachCharset)
int openComposer (const TQString &to, const TQString &cc, const TQString &bcc, const TQString &subject, const TQString &body, int hidden, const TQString &attachName, const TQCString &attachCte, const TQCString &attachData, const TQCString &attachType, const TQCString &attachSubType, const TQCString &attachParamAttr, const TQString &attachParamValue, const TQCString &attachContDisp, const TQCString &attachCharset, unsigned int identity)
DCOPRef openComposer (const TQString &to, const TQString &cc, const TQString &bcc, const TQString &subject, const TQString &body, bool hidden)
void setDefaultTransport (const TQString &transport)
DCOPRef newMessage (const TQString &to, const TQString &cc, const TQString &bcc, bool hidden, bool useFolderId, const KURL &messageFile, const KURL &attachURL)
int sendCertificate (const TQString &to, const TQByteArray &certData)
void openReader ()
int dcopAddMessage (const TQString &foldername, const TQString &messagefile, const TQString &MsgStatusFlags=TQString())
int dcopAddMessage (const TQString &foldername, const KURL &messagefile, const TQString &MsgStatusFlags=TQString())
void dcopResetAddMessage ()
int dcopAddMessage_fastImport (const TQString &foldername, const TQString &messagefile, const TQString &MsgStatusFlags=TQString())
int dcopAddMessage_fastImport (const TQString &foldername, const KURL &messagefile, const TQString &MsgStatusFlags=TQString())
void showImportArchiveDialog ()
TQStringList folderList () const
DCOPRef getFolder (const TQString &vpath)
void selectFolder (TQString folder)
int timeOfLastMessageCountChange () const
virtual bool showMail (TQ_UINT32 serialNumber, TQString messageId)
virtual TQString getFrom (TQ_UINT32 serialNumber)
virtual TQString debugScheduler ()
virtual TQString debugSernum (TQ_UINT32 serialNumber)
int viewMessage (const KURL &messageFile)
virtual void pauseBackgroundJobs ()
virtual void resumeBackgroundJobs ()
void stopNetworkJobs ()
void resumeNetworkJobs ()
void init ()
void readConfig ()
void cleanupImapFolders ()
void recreateCorruptIndexFiles ()
void testDir (const char *_name)
void recoverDeadLetters ()
void initFolders (KConfig *cfg)
void closeAllKMailWindows ()
void cleanup (void)
void quit ()
bool transferMail (TQString &destinationDir)
void ungrabPtrKb (void)
void kmailMsgHandler (TQtMsgType aType, const char *aMsg)
bool doSessionManagement ()
bool firstInstance ()
void setFirstInstance (bool value)
void action (bool mailto, bool check, const TQString &to, const TQString &cc, const TQString &bcc, const TQString &subj, const TQString &body, const KURL &messageFile, const KURL::List &attach, const QCStringList &customHeaders)
void byteArrayToRemoteFile (const TQByteArray &, 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 TQString &idString)
KInstance * xmlGuiInstance ()
void setXmlGuiInstance (KInstance *instance)
KMFolderinboxFolder ()
KMFolderoutboxFolder ()
KMFoldersentFolder ()
KMFoldertrashFolder ()
KMFolderdraftsFolder ()
KMFoldertemplatesFolder ()
KMFolderMgr * folderMgr ()
KMFolderMgr * imapFolderMgr ()
KMFolderMgr * dimapFolderMgr ()
KMFolderMgr * searchFolderMgr ()
UndoStack * undoStack ()
AccountManageracctMgr ()
KMFilterMgr * filterMgr ()
KMFilterMgr * popFilterMgr ()
KMFilterActionDictfilterActionDict ()
KMail::MessageSender * msgSender ()
KMMsgIndex * msgIndex ()
KPIM::ThreadWeaver::Weaver * weaver ()
KPIM::IdentityManager * identityManager ()
JobSchedulerjobScheduler ()
void compactAllFolders ()
void expireAllFoldersNow ()
KMailICalIfaceImpliCalIface ()
bool firstStart ()
TQString 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 TQString &reason)
unsigned long getNextMsgSerNum ()
TQTextCodec * 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 ()
KMMainWidget * getKMMainWidget ()
TQValueList< TQGuardedPtr
< KMFolder > > 
allFolders ()
void raise ()
void loadProfile (const TQString &path)
void saveToProfile (const TQString &path) const
bool isCodecAsciiCompatible (const TQTextCodec *codec)

Static Public Member Functions

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

Protected Slots

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

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.


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

TQValueList< TQGuardedPtr< KMFolder > > KMKernel::allFolders (  ) 
Returns:
a list of all folders from all folder managers.

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

void KMKernel::checkMail (  )  [virtual]

dcop callable stuff

Implements KMailIface.

Definition at line 320 of file kmkernel.cpp.

void KMKernel::compactAllFolders (  )  [virtual]

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

Implements KMailIface.

Definition at line 2388 of file kmkernel.cpp.

int KMKernel::dcopAddMessage ( const TQString &  foldername,
const TQString &  messagefile,
const TQString &  MsgStatusFlags = TQString() 
) [virtual]
Parameters:
foldername the requested foldername in kmail (at the zero level in the foldertree.
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 800 of file kmkernel.cpp.

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

add messages without rejecting duplicates

Implements KMailIface.

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

void KMKernel::dumpDeadLetters (  )  [slot]

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

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

void KMKernel::expireAllFoldersNow (  ) 

Expire all folders, used for the gui action.

Definition at line 2381 of file kmkernel.cpp.

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

Find a folder by ID string in all folder managers.

Definition at line 2395 of file kmkernel.cpp.

bool KMKernel::folderIsDraftOrOutbox ( const KMFolder folder  ) 

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

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

TQString KMKernel::getFrom ( TQ_UINT32  serialNumber  )  [virtual]

DCOP-enabled for use in kaddressbook drop.

Implements KMailIface.

Definition at line 1173 of file kmkernel.cpp.

KMMainWidget * KMKernel::getKMMainWidget (  ) 

Get first mainwidget.

Definition at line 2330 of file kmkernel.cpp.

unsigned long KMKernel::getNextMsgSerNum (  ) 

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

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

Reimplemented from KMailIface.

Implements KMailIface.

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

KPIM::IdentityManager * KMKernel::identityManager (  ) 

return the pointer to the identity manager

Definition at line 2224 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 2407 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 1264 of file kmkernel.cpp.

TQString KMKernel::localDataPath (  )  [static]

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

The path ends with '/'.

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

KMainWindow * KMKernel::mainWin (  ) 

returns a reference to the first Mainwin or a temporary Mainwin

Definition at line 2237 of file kmkernel.cpp.

void KMKernel::messageCountChanged (  ) 

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

Definition at line 2449 of file kmkernel.cpp.

DCOPRef KMKernel::newMessage ( const TQString &  to,
const TQString &  cc,
const TQString &  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 649 of file kmkernel.cpp.

DCOPRef KMKernel::openComposer ( const TQString &  to,
const TQString &  cc,
const TQString &  bcc,
const TQString &  subject,
const TQString &  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 617 of file kmkernel.cpp.

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

For backward compatibility.

Deprecated:

Implements KMailIface.

Definition at line 476 of file kmkernel.cpp.

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

For backward compatibility.

Deprecated:

Implements KMailIface.

Definition at line 456 of file kmkernel.cpp.

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

For backward compatibility.

Implements KMailIface.

Definition at line 118 of file kmkernel.h.

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

For backward compatibility.

Implements KMailIface.

Definition at line 111 of file kmkernel.h.

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

For backward compatibility.

Implements KMailIface.

Definition at line 103 of file kmkernel.h.

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

returns id of composer if more are opened

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

void KMKernel::resumeBackgroundJobs (  )  [virtual]

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

Implements KMailIface.

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

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

normal control stuff

Definition at line 251 of file kmkernel.h.

int KMKernel::sendCertificate ( const TQString &  to,
const TQByteArray &  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 707 of file kmkernel.cpp.

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

DCOP call used to set the default transport.

Implements KMailIface.

Definition at line 606 of file kmkernel.cpp.

bool KMKernel::showMail ( TQ_UINT32  serialNumber,
TQString  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 1124 of file kmkernel.cpp.

void KMKernel::slotEmptyTrash (  )  [slot]

empty all the trash bins

Empties all trash folders.

Definition at line 2268 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 2059 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 1240 of file kmkernel.cpp.

bool KMKernel::transferMail ( TQString &  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 1840 of file kmkernel.cpp.

Wallet * KMKernel::wallet (  ) 

Open KDE wallet and set it to kmail folder.

Definition at line 2459 of file kmkernel.cpp.


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