6 #include <tqguardedptr.h>
8 #include <weaverlogger.h>
10 #include <tdemacros.h>
11 #include <tdeconfig.h>
12 #include <tdeversion.h>
13 #include <tdeimproxy.h>
14 #include <tdemacros.h>
16 #ifdef __TDE_HAVE_TDEHWLIB
17 # include <tdenetworkconnections.h>
19 namespace TDENetworkConnectionStatus {
20 enum TDENetworkConnectionStatus {
25 #include "kmailIface.h"
26 #include "kmmsgbase.h"
27 #include "globalsettings.h"
29 #define kmkernel KMKernel::self()
30 #define kmconfig KMKernel::config()
44 class MailServiceImpl;
50 namespace KPIM {
class ProgressDialog; }
51 using KMail::MailServiceImpl;
53 using KMail::UndoStack;
55 using KPIM::ProgressDialog;
65 class IdentityManager;
69 class KProgressDialog;
80 class ConfigureDialog;
97 KMKernel (TQObject *parent=0,
const char *name=0);
103 TQStringList accounts();
104 void checkAccount (
const TQString &account);
106 int openComposer (
const TQString &to,
const TQString &cc,
const TQString &bcc,
107 const TQString &subject,
const TQString &body,
int hidden,
108 const KURL &messageFile,
const KURL::List &attachURLs,
109 const QCStringList &customHeaders);
111 int openComposer (
const TQString &to,
const TQString &cc,
const TQString &bcc,
112 const TQString &subject,
const TQString &body,
int hidden,
113 const KURL &messageFile,
const KURL::List &attachURLs)
115 QCStringList noCustomHeaders;
116 return openComposer(to, cc, bcc, subject, body, hidden, messageFile, attachURLs, noCustomHeaders);
119 int openComposer (
const TQString &to,
const TQString &cc,
const TQString &bcc,
120 const TQString &subject,
const TQString &body,
int hidden,
121 const KURL &messageFile,
const KURL& attachURL)
123 return openComposer(to, cc, bcc, subject, body, hidden, messageFile, KURL::List(attachURL));
126 int openComposer (
const TQString &to,
const TQString &cc,
const TQString &bcc,
127 const TQString &subject,
const TQString &body,
int hidden,
128 const KURL &messageFile)
130 return openComposer(to, cc, bcc, subject, body, hidden, messageFile, KURL::List());
135 int openComposer (
const TQString &to,
const TQString &cc,
136 const TQString &bcc,
const TQString &subject,
137 const TQString &body,
int hidden,
138 const TQString &attachName,
139 const TQCString &attachCte,
140 const TQCString &attachData,
141 const TQCString &attachType,
142 const TQCString &attachSubType,
143 const TQCString &attachParamAttr,
144 const TQString &attachParamValue,
145 const TQCString &attachContDisp);
150 int openComposer (
const TQString &to,
const TQString &cc,
151 const TQString &bcc,
const TQString &subject,
152 const TQString &body,
int hidden,
153 const TQString &attachName,
154 const TQCString &attachCte,
155 const TQCString &attachData,
156 const TQCString &attachType,
157 const TQCString &attachSubType,
158 const TQCString &attachParamAttr,
159 const TQString &attachParamValue,
160 const TQCString &attachContDisp,
161 const TQCString &attachCharset);
163 int openComposer (
const TQString &to,
const TQString &cc,
164 const TQString &bcc,
const TQString &subject,
165 const TQString &body,
int hidden,
166 const TQString &attachName,
167 const TQCString &attachCte,
168 const TQCString &attachData,
169 const TQCString &attachType,
170 const TQCString &attachSubType,
171 const TQCString &attachParamAttr,
172 const TQString &attachParamValue,
173 const TQCString &attachContDisp,
174 const TQCString &attachCharset,
175 unsigned int identity);
177 DCOPRef openComposer(
const TQString &to,
const TQString &cc,
178 const TQString &bcc,
const TQString &subject,
179 const TQString &body,
bool hidden);
186 DCOPRef newMessage(
const TQString &to,
191 const KURL &messageFile,
192 const KURL &attachURL);
194 int sendCertificate(
const TQString& to,
const TQByteArray& certData );
196 void openReader() { openReader(
false ); }
198 int dcopAddMessage(
const TQString & foldername,
const TQString & messagefile,
199 const TQString & MsgStatusFlags = TQString());
200 int dcopAddMessage(
const TQString & foldername,
const KURL & messagefile,
201 const TQString & MsgStatusFlags = TQString());
205 const TQString & MsgStatusFlags = TQString());
207 const TQString & MsgStatusFlags = TQString());
208 void showImportArchiveDialog();
210 TQStringList folderList()
const;
211 DCOPRef getFolder(
const TQString& vpath );
212 void selectFolder( TQString folder );
213 int timeOfLastMessageCountChange()
const;
214 virtual bool showMail( TQ_UINT32 serialNumber, TQString messageId );
215 virtual TQString
getFrom( TQ_UINT32 serialNumber );
216 virtual TQString debugScheduler();
217 virtual TQString debugSernum( TQ_UINT32 serialNumber );
218 int viewMessage(
const KURL & messageFile );
249 static bool askToGoOnline();
255 static bool isOffline();
260 static TDEConfig *config();
264 void cleanupImapFolders();
265 void recreateCorruptIndexFiles();
266 void testDir(
const char *_name);
267 void recoverDeadLetters();
268 void initFolders(TDEConfig* cfg);
269 void closeAllKMailWindows();
277 bool transferMail( TQString & destinationDir );
278 void ungrabPtrKb(
void);
279 void kmailMsgHandler(TQtMsgType aType,
const char* aMsg);
280 bool doSessionManagement();
281 bool firstInstance() {
return the_firstInstance; }
282 void setFirstInstance(
bool value) { the_firstInstance = value; }
283 void action (
bool mailto,
bool check,
const TQString &to,
const TQString &cc,
284 const TQString &bcc,
const TQString &subj,
const TQString &body,
285 const KURL &messageFile,
const KURL::List &attach,
286 const QCStringList &customHeaders);
287 void byteArrayToRemoteFile(
const TQByteArray&,
const KURL&,
288 bool overwrite = FALSE);
289 bool folderIsDraftOrOutbox(
const KMFolder * );
290 bool folderIsDrafts(
const KMFolder * );
291 bool folderIsTemplates(
const KMFolder * );
296 bool folderIsSentMailFolder(
const KMFolder * );
300 KMFolder* findFolderById(
const TQString& idString );
302 TDEInstance *xmlGuiInstance() {
return mXmlGuiInstance; }
303 void setXmlGuiInstance( TDEInstance *instance ) { mXmlGuiInstance = instance; }
305 KMFolder *inboxFolder() {
return the_inboxFolder; }
306 KMFolder *outboxFolder() {
return the_outboxFolder; }
307 KMFolder *sentFolder() {
return the_sentFolder; }
308 KMFolder *trashFolder() {
return the_trashFolder; }
309 KMFolder *draftsFolder() {
return the_draftsFolder; }
310 KMFolder *templatesFolder() {
return the_templatesFolder; }
312 KMFolderMgr *folderMgr() {
return the_folderMgr; }
313 KMFolderMgr *imapFolderMgr() {
return the_imapFolderMgr; }
314 KMFolderMgr *dimapFolderMgr() {
return the_dimapFolderMgr; }
315 KMFolderMgr *searchFolderMgr() {
return the_searchFolderMgr; }
316 UndoStack *undoStack() {
return the_undoStack; }
318 KMFilterMgr *filterMgr() {
return the_filterMgr; }
319 KMFilterMgr *popFilterMgr() {
return the_popFilterMgr; }
321 KMail::MessageSender *msgSender();
322 KMMsgIndex *msgIndex();
324 KPIM::ThreadWeaver::Weaver *weaver() {
return the_weaver; }
326 KPIM::IdentityManager *identityManager();
331 void compactAllFolders();
333 void expireAllFoldersNow();
337 bool firstStart() {
return the_firstStart; }
338 TQString previousVersion() {
return the_previousVersion; }
339 bool startingUp() {
return the_startingUp; }
340 void setStartingUp (
bool flag) { the_startingUp = flag; }
341 bool shuttingDown() {
return the_shuttingDown; }
342 void setShuttingDown(
bool flag) { the_shuttingDown = flag; }
343 void serverReady (
bool flag) { the_server_is_ready = flag; }
348 static TQString localDataPath();
354 bool haveSystemTrayApplet();
356 bool registerSystemTrayApplet(
const KSystemTray* );
357 bool unregisterSystemTrayApplet(
const KSystemTray* );
361 void emergencyExit(
const TQString& reason );
365 TQTextCodec *networkCodec() {
return netCodec; }
368 TDEMainWindow* mainWin();
374 void setContextMenuShown(
bool flag ) { mContextMenuShown = flag; }
375 bool contextMenuShown()
const {
return mContextMenuShown; }
381 ::KIMProxy* imProxy();
387 bool mailCheckAborted()
const;
391 void enableMailCheck();
397 void abortMailCheck();
399 bool canQueryClose();
404 void messageCountChanged();
407 TDEWallet::Wallet *wallet();
410 KMMainWidget *getKMMainWidget();
413 TQValueList< TQGuardedPtr<KMFolder> > allFolders();
417 void loadProfile(
const TQString& path );
419 void saveToProfile(
const TQString& path )
const;
421 bool isCodecAsciiCompatible(
const TQTextCodec *codec );
425 void dumpDeadLetters();
432 void slotRequestConfigSync();
435 void slotEmptyTrash();
437 void slotShowConfigurationDialog();
438 void slotRunBackgroundTasks();
440 void slotConfigChanged();
443 void slotDataReq(TDEIO::Job*,TQByteArray&);
444 void slotResult(TDEIO::Job*);
445 void slotNetworkStateChanged(TDENetworkConnectionStatus::TDENetworkConnectionStatus, TDENetworkConnectionStatus::TDENetworkConnectionStatus, TQString);
448 void configChanged();
449 void folderRemoved(
KMFolder* aFolder );
450 void onlineStatusChanged( GlobalSettings::EnumNetworkState::type );
453 void openReader(
bool onlyCheck );
454 KMMsgStatus strToStatus(
const TQString &flags);
455 bool networkStateConnected();
465 KMFolderMgr *the_folderMgr;
466 KMFolderMgr *the_imapFolderMgr;
467 KMFolderMgr *the_dimapFolderMgr;
468 KMFolderMgr *the_searchFolderMgr;
469 UndoStack *the_undoStack;
471 KMFilterMgr *the_filterMgr;
472 KMFilterMgr *the_popFilterMgr;
474 mutable KPIM::IdentityManager *mIdentityManager;
475 KMSender *the_msgSender;
476 KMMsgIndex *the_msgIndex;
483 TQMap<TDEIO::Job *, putData> mPutJobs;
486 TQString the_previousVersion;
492 bool the_shuttingDown;
494 bool the_server_is_ready;
497 bool the_firstInstance;
498 bool mMailCheckAborted;
500 TDESharedConfig::Ptr mConfig;
501 TQTextCodec *netCodec;
502 TDEInstance* mXmlGuiInstance;
503 ConfigureDialog *mConfigureDialog;
505 TQTimer *mBackgroundTasksTimer;
510 MailServiceImpl *mMailService;
515 int mTimeOfLastMessageCountChange;
520 bool mContextMenuShown;
522 TQValueList<const KSystemTray*> systemTrayApplets;
523 TQValueList<const TQTextCodec*> mNonAsciiCompatibleCodecs;
526 KPIM::ThreadWeaver::Weaver *the_weaver;
527 KPIM::ThreadWeaver::WeaverThreadLogger *the_weaverLogger;
529 TDEWallet::Wallet *mWallet;
532 TQStringList mAddMessageMsgIds;
533 TQString mAddMessageLastFolder;
536 #ifdef __TDE_HAVE_TDEHWLIB
537 TDEGlobalNetworkManager *mNetworkManager;
Dictionary that contains a list of all registered filter actions with their creation functions.
Central point of coordination in KMail.
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)
For backward compatibility.
int openComposer(const TQString &to, const TQString &cc, const TQString &bcc, const TQString &subject, const TQString &body, int hidden, const KURL &messageFile)
For backward compatibility.
unsigned long getNextMsgSerNum()
Returns a message serial number that hasn't been used yet.
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)
For backward compatibility.
This class implements a "reader window", that is a window used for reading or viewing messages.
The implementation of the interface.
checkMail wont show reader but will check mail.
virtual void setDefaultTransport(const TQString &transport)=0
Set the KMail Default transport.
virtual void dcopResetAddMessage()=0
Clears the list of added message ids which is used to filter out duplicates.
virtual void resumeBackgroundJobs()=0
Resume compaction/expiry, and allow launching new ones.
virtual void pauseBackgroundJobs()=0
Abort any running compaction/expiry, and don't launch any new ones until resumeBackgroundJobs() is ca...
virtual int dcopAddMessage_fastImport(const TQString &foldername, const TQString &messagefile, const TQString &MsgStatusFlags=TQString())=0
Does essentially the same as dcopAddMessage except that it doesn't reject duplicate messages.
virtual bool showMail(TQ_UINT32 serialNumber, TQString messageId)=0
Shows the specified message in a separate message window.
virtual bool handleCommandLine(bool noArgsOpensReader)=0
DCOP-enabled for KMailUniqueAppHandler in the kontact plugin.
virtual int dcopAddMessage(const TQString &foldername, const TQString &messagefile, const TQString &MsgStatusFlags=TQString())=0
virtual int sendCertificate(const TQString &to, const TQByteArray &certData)=0
Send a certificate request to the CA specified in to.
virtual void stopNetworkJobs()=0
Stop all network related jobs and enter offline mode.
virtual void resumeNetworkJobs()=0
Resume all network related jobs and enter online mode.
virtual TQString getFrom(TQ_UINT32 serialNumber)=0
DCOP-enabled for use in kaddressbook drop.
The account manager is responsible for creating accounts of various types via the factory method crea...
The unique JobScheduler instance (owned by kmkernel) implements "background processing" of folder ope...