6 #include "interfaces/mailinterfaces.h"
11 #include <QDBusObjectPath>
12 #include <Solid/Networking>
18 #include <kcomponentdata.h>
19 #include <akonadi/servermanager.h>
20 #include "messageviewer/viewer/viewer.h"
22 #define kmkernel KMKernel::self()
23 #define kmconfig KMKernel::config()
25 namespace MailCommon {
29 class QAbstractItemModel;
33 class EntityTreeModel;
34 class EntityMimeTypeFilterModel;
45 namespace MessageComposer {
47 class ComposerAutoCorrection;
61 namespace MessageComposer {
65 namespace KPIMIdentities {
67 class IdentityManager;
76 namespace MailCommon {
78 class FolderCollection;
79 class FolderCollectionMonitor;
106 Q_CLASSINFO(
"D-Bus Interface",
"org.kde.kmail.kmail")
118 Q_SCRIPTABLE
void checkMail();
125 Q_SCRIPTABLE
void setSystrayIconNotificationsEnabled(
bool enabled );
131 Q_SCRIPTABLE
void pauseBackgroundJobs();
137 Q_SCRIPTABLE
void resumeBackgroundJobs();
143 Q_SCRIPTABLE
void stopNetworkJobs();
149 Q_SCRIPTABLE
void resumeNetworkJobs();
151 Q_SCRIPTABLE QStringList accounts();
153 Q_SCRIPTABLE
void makeResourceOnline(MessageViewer::Viewer::ResourceOnlineMode mode);
160 Q_SCRIPTABLE
void checkAccount(
const QString & account );
162 Q_SCRIPTABLE
bool selectFolder(
const QString & folder );
164 Q_SCRIPTABLE
bool canQueryClose();
166 Q_SCRIPTABLE
bool handleCommandLine(
bool noArgsOpensReader );
184 Q_SCRIPTABLE
int openComposer(
const QString &
to,
188 const QString & body,
190 const QString & messageFile,
191 const QStringList & attachmentPaths,
192 const QStringList & customHeaders ,
const QString &replyTo = QString(),
const QString &inReplyTo = QString());
217 Q_SCRIPTABLE
int openComposer(
const QString & to,
220 const QString & subject,
221 const QString & body,
223 const QString & attachName,
224 const QByteArray & attachCte,
225 const QByteArray &attachData,
226 const QByteArray & attachType,
227 const QByteArray & attachSubType,
228 const QByteArray & attachParamAttr,
229 const QString & attachParamValue,
230 const QByteArray & attachContDisp,
231 const QByteArray & attachCharset,
232 unsigned int identity );
247 Q_SCRIPTABLE QDBusObjectPath openComposer(
const QString & to,
250 const QString & subject,
251 const QString & body,
270 Q_SCRIPTABLE QDBusObjectPath newMessage(
const QString & to,
275 const QString & messageFile,
276 const QString & attachURL );
280 Q_SCRIPTABLE
int viewMessage(
const QString & messageFile );
282 Q_SCRIPTABLE
void updateConfig();
284 Q_SCRIPTABLE
void showFolder(
const QString &collectionId);
292 void checkMailOnStartup();
299 static bool askToGoOnline();
305 static bool isOffline();
310 KSharedConfig::Ptr config();
317 Akonadi::ChangeRecorder *folderCollectionMonitor()
const;
322 Akonadi::EntityTreeModel *entityTreeModel()
const;
328 Akonadi::EntityMimeTypeFilterModel *collectionModel()
const;
330 void recoverDeadLetters();
331 void closeAllKMailWindows();
334 bool doSessionManagement();
337 void action(
bool mailto,
bool check,
const QString &to,
const QString &cc,
338 const QString &bcc,
const QString &subj,
const QString &body,
339 const KUrl &messageFile,
const KUrl::List &attach,
340 const QStringList &customHeaders ,
const QString &replyTo,
const QString &inReplyTo);
342 bool isImapFolder(
const Akonadi::Collection& ,
bool &isOnline)
const;
345 void setAccountStatus(
bool);
351 MessageComposer::MessageSender *msgSender();
353 void openFilterDialog(
bool createDummyFilter =
true);
354 void createFilter(
const QByteArray& field,
const QString& value);
357 KPIMIdentities::IdentityManager *identityManager();
359 MailCommon::JobScheduler*
jobScheduler()
const {
return mJobScheduler; }
362 void expireAllFoldersNow();
378 static QString localDataPath();
384 bool haveSystemTrayApplet()
const;
389 KMainWindow* mainWin();
398 Akonadi::Collection::List allFolders()
const;
400 void selectCollectionFromId(
const Akonadi::Collection::Id
id);
404 void stopAgentInstance();
407 bool showPopupAfterDnD();
409 bool excludeImportantMailFromExpiry();
411 qreal closeToQuotaThreshold();
413 Akonadi::Collection::Id lastSelectedFolder();
414 void setLastSelectedFolder(
const Akonadi::Collection::Id &col );
416 QStringList customTemplates();
418 void checkFolderFromResources(
const Akonadi::Collection::List& collectionList );
420 const QAbstractItemModel* treeviewModelSelection();
422 void savePaneSelection();
424 void updatePaneTagComboBox();
427 MessageComposer::ComposerAutoCorrection* composerAutoCorrection();
429 void toggleSystemTray();
432 void agentInstanceBroken(
const Akonadi::AgentInstance& instance );
437 void updateSystemTray();
441 void updatedTemplates();
444 void dumpDeadLetters();
451 void slotRequestConfigSync();
456 void slotSyncConfig();
458 void slotShowConfigurationDialog();
459 void slotRunBackgroundTasks();
461 void slotConfigChanged();
464 void configChanged();
465 void onlineStatusChanged( GlobalSettings::EnumNetworkState::type );
466 void customTemplatesChanged();
468 void startCheckMail();
473 void transportRemoved(
int id,
const QString &name );
475 void transportRenamed(
int id,
const QString &oldName,
const QString &newName );
476 void itemDispatchStarted();
477 void instanceStatusChanged(
const Akonadi::AgentInstance &);
479 void akonadiStateChanged( Akonadi::ServerManager::State );
481 void slotInstanceError(
const Akonadi::AgentInstance& instance,
const QString & message);
482 void slotInstanceWarning(
const Akonadi::AgentInstance&instance,
const QString& message);
483 void slotCollectionMoved(
const Akonadi::Collection &collection,
const Akonadi::Collection &source,
const Akonadi::Collection &destination );
484 void slotCollectionRemoved(
const Akonadi::Collection& col);
485 void slotDeleteIdentity( uint identity);
486 void slotInstanceRemoved(
const Akonadi::AgentInstance&);
487 void slotSystemNetworkStatusChanged( Solid::Networking::Status );
488 void slotCollectionChanged(
const Akonadi::Collection &,
const QSet<QByteArray> &
set);
491 void resourceGoOnLine();
492 void openReader(
bool onlyCheck );
496 mutable KPIMIdentities::IdentityManager *mIdentityManager;
497 MessageComposer::AkonadiSender *the_msgSender;
500 QString the_previousVersion;
506 bool the_shuttingDown;
508 bool the_firstInstance;
510 KSharedConfig::Ptr mConfig;
511 QTextCodec *netCodec;
512 KComponentData mXmlGuiInstance;
515 QTimer *mBackgroundTasksTimer;
516 MailCommon::JobScheduler* mJobScheduler;
521 Solid::Networking::Status mSystemNetworkStatus;
524 QHash<QString, bool> mResourceCryptoSettingCache;
525 MailCommon::FolderCollectionMonitor *mFolderCollectionMonitor;
526 Akonadi::EntityTreeModel *mEntityTreeModel;
527 Akonadi::EntityMimeTypeFilterModel *mCollectionModel;
534 QPointer<MailCommon::KMFilterDialog> mFilterEditDialog;
535 MessageComposer::ComposerAutoCorrection *mAutoCorrection;
538 #endif // _KMKERNEL_H
void firstStartDone()
Mark first start as done.
Central point of coordination in KMail.
Q_SCRIPTABLE void openReader()
const KComponentData & xmlGuiInstance()
bool firstInstance() const
MailCommon::JobScheduler * jobScheduler() const
QString messageId() const
void setFirstInstance(bool value)
void setStartingUp(bool flag)
bool shuttingDown() const
void set(quint32, const QString &, const QString &, const QString &, const QString &, time_t)
void setXmlGuiInstance(const KComponentData &instance)
void setShuttingDown(bool flag)
quint32 serialNumber() const
QTextCodec * networkCodec()
QString previousVersion() const