kmail

#include <kmkernel.h>

Inheritance diagram for KMKernel:
KMailIface

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 (TDEConfig *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)
 
TDEInstance * xmlGuiInstance ()
 
void setXmlGuiInstance (TDEInstance *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 ()
 
TDEMainWindow * mainWin ()
 
void setContextMenuShown (bool flag)
 
bool contextMenuShown () const
 
::KIMProxy * imProxy ()
 
bool mailCheckAborted () const
 
void enableMailCheck ()
 
void abortMailCheck ()
 
bool canQueryClose ()
 
void messageCountChanged ()
 
TDEWallet::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)
 
- Public Member Functions inherited from KMailIface
void unreadCountChanged (const TQString &folderURL, int numUnread)
 

Static Public Member Functions

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

Protected Slots

void slotDataReq (TDEIO::Job *, TQByteArray &)
 
void slotResult (TDEIO::Job *)
 
void slotNetworkStateChanged (TDENetworkConnectionStatus::TDENetworkConnectionStatus, TDENetworkConnectionStatus::TDENetworkConnectionStatus, TQString)
 

Additional Inherited Members

- Public Attributes inherited from KMailIface
k_dcop_signals __pad0__: void unreadCountChanged()
 
k_dcop_hidden __pad1__: virtual DCOPRef newMessage(const TQString &to
 
k_dcop_hidden const TQString & cc
 
k_dcop_hidden const TQString const TQString & bcc
 
k_dcop_hidden const TQString const TQString bool hidden
 
k_dcop_hidden const TQString const TQString bool bool useFolderId
 
k_dcop_hidden const TQString const TQString bool bool const KURL & messageFile
 
k_dcop_hidden const TQString const TQString bool bool const KURL const KURL & attachURL = 0
 

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 91 of file kmkernel.h.

Member Function Documentation

◆ abortMailCheck()

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

◆ allFolders()

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

Definition at line 2537 of file kmkernel.cpp.

◆ askToGoOnline()

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

◆ checkMail()

void KMKernel::checkMail ( )
virtual

dcop callable stuff

Implements KMailIface.

Definition at line 334 of file kmkernel.cpp.

◆ compactAllFolders()

void KMKernel::compactAllFolders ( )
virtual

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

Implements KMailIface.

Definition at line 2402 of file kmkernel.cpp.

◆ dcopAddMessage()

int KMKernel::dcopAddMessage ( const TQString &  foldername,
const TQString &  messagefile,
const TQString &  MsgStatusFlags = TQString() 
)
virtual
Parameters
foldernamethe requested foldername in kmail (at the zero level in the foldertree.
messagefilethe name of the filename (local) with the message to be added.
MsgStatusFlagsa 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 814 of file kmkernel.cpp.

◆ dcopAddMessage_fastImport()

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

◆ dcopResetAddMessage()

void KMKernel::dcopResetAddMessage ( )
virtual

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

Implements KMailIface.

Definition at line 989 of file kmkernel.cpp.

◆ dumpDeadLetters

void KMKernel::dumpDeadLetters ( )
slot

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

Definition at line 1975 of file kmkernel.cpp.

◆ enableMailCheck()

void KMKernel::enableMailCheck ( )

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

enable mail checking again

Definition at line 2426 of file kmkernel.cpp.

◆ expireAllFoldersNow()

void KMKernel::expireAllFoldersNow ( )

Expire all folders, used for the gui action.

Definition at line 2395 of file kmkernel.cpp.

◆ findFolderById()

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

Find a folder by ID string in all folder managers.

Definition at line 2409 of file kmkernel.cpp.

◆ folderIsDraftOrOutbox()

bool KMKernel::folderIsDraftOrOutbox ( const KMFolder folder)

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

Definition at line 2164 of file kmkernel.cpp.

◆ folderIsSentMailFolder()

bool KMKernel::folderIsSentMailFolder ( const KMFolder folder)

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

Definition at line 2222 of file kmkernel.cpp.

◆ getFrom()

TQString KMKernel::getFrom ( TQ_UINT32  serialNumber)
virtual

DCOP-enabled for use in kaddressbook drop.

Implements KMailIface.

Definition at line 1187 of file kmkernel.cpp.

◆ getKMMainWidget()

KMMainWidget * KMKernel::getKMMainWidget ( )

Get first mainwidget.

Definition at line 2344 of file kmkernel.cpp.

◆ getNextMsgSerNum()

unsigned long KMKernel::getNextMsgSerNum ( )

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

◆ handleCommandLine()

bool KMKernel::handleCommandLine ( bool  noArgsOpensReader)
virtual

Reimplemented from KMailIface.

Implements KMailIface.

Definition at line 211 of file kmkernel.cpp.

◆ haveSystemTrayApplet()

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

◆ identityManager()

KPIM::IdentityManager * KMKernel::identityManager ( )

return the pointer to the identity manager

Definition at line 2238 of file kmkernel.cpp.

◆ imProxy()

KIMProxy * KMKernel::imProxy ( )

Get a reference to KMail's KIMProxy instance.

Returns
a pointer to a valid KIMProxy

Definition at line 2421 of file kmkernel.cpp.

◆ isOffline()

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

◆ localDataPath()

TQString KMKernel::localDataPath ( )
static

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

The path ends with '/'.

Definition at line 2111 of file kmkernel.cpp.

◆ mailCheckAborted()

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

◆ mainWin()

TDEMainWindow * KMKernel::mainWin ( )

returns a reference to the first Mainwin or a temporary Mainwin

Definition at line 2251 of file kmkernel.cpp.

◆ messageCountChanged()

void KMKernel::messageCountChanged ( )

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

Definition at line 2463 of file kmkernel.cpp.

◆ newMessage()

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

◆ openComposer() [1/7]

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

◆ openComposer() [2/7]

int KMKernel::openComposer ( const TQString &  to,
const TQString &  cc,
const TQString &  bcc,
const TQString &  subject,
const TQString &  body,
int  hidden,
const KURL &  messageFile 
)
inlinevirtual

For backward compatibility.

Implements KMailIface.

Definition at line 126 of file kmkernel.h.

◆ openComposer() [3/7]

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 
)
inlinevirtual

For backward compatibility.

Implements KMailIface.

Definition at line 119 of file kmkernel.h.

◆ openComposer() [4/7]

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 
)
inlinevirtual

For backward compatibility.

Implements KMailIface.

Definition at line 111 of file kmkernel.h.

◆ openComposer() [5/7]

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

◆ openComposer() [6/7]

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

◆ openComposer() [7/7]

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

◆ pauseBackgroundJobs()

void KMKernel::pauseBackgroundJobs ( )
virtual

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

Implements KMailIface.

Definition at line 1242 of file kmkernel.cpp.

◆ resumeBackgroundJobs()

void KMKernel::resumeBackgroundJobs ( )
virtual

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

Implements KMailIface.

Definition at line 1248 of file kmkernel.cpp.

◆ resumeNetworkJobs()

void KMKernel::resumeNetworkJobs ( )
virtual

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

Implements KMailIface.

Definition at line 1264 of file kmkernel.cpp.

◆ self()

static KMKernel* KMKernel::self ( )
inlinestatic

normal control stuff

Definition at line 259 of file kmkernel.h.

◆ sendCertificate()

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

◆ setDefaultTransport()

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

DCOP call used to set the default transport.

Implements KMailIface.

Definition at line 620 of file kmkernel.cpp.

◆ showMail()

bool KMKernel::showMail ( TQ_UINT32  serialNumber,
TQString  messageId 
)
virtual

Shows the specified message in a separate message window.

Parameters
serialNumberthe serial number of the message to be shown.
messageIdthis parameter is ignored.

Implements KMailIface.

Definition at line 1138 of file kmkernel.cpp.

◆ slotEmptyTrash

void KMKernel::slotEmptyTrash ( )
slot

empty all the trash bins

Empties all trash folders.

Definition at line 2282 of file kmkernel.cpp.

◆ slotRequestConfigSync

void KMKernel::slotRequestConfigSync ( )
slot

Call this slot instead of directly TDEConfig::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 2073 of file kmkernel.cpp.

◆ stopNetworkJobs()

void KMKernel::stopNetworkJobs ( )
virtual

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

Implements KMailIface.

Definition at line 1254 of file kmkernel.cpp.

◆ transferMail()

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

◆ wallet()

Wallet * KMKernel::wallet ( )

Open KDE wallet and set it to kmail folder.

Definition at line 2508 of file kmkernel.cpp.


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