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"
24 #define kmkernel KMKernel::self()
25 #define kmconfig KMKernel::config()
32 class EntityTreeModel;
33 class EntityMimeTypeFilterModel;
41 namespace MessageComposer {
46 class StorageServiceManager;
60 namespace MessageComposer {
64 namespace KPIMIdentities {
66 class IdentityManager;
69 namespace MailCommon {
71 class FolderCollection;
72 class FolderCollectionMonitor;
108 Q_CLASSINFO(
"D-Bus Interface",
"org.kde.kmail.kmail")
120 Q_SCRIPTABLE
void checkMail();
127 Q_SCRIPTABLE
void setSystrayIconNotificationsEnabled(
bool enabled );
133 Q_SCRIPTABLE
void pauseBackgroundJobs();
139 Q_SCRIPTABLE
void resumeBackgroundJobs();
145 Q_SCRIPTABLE
void stopNetworkJobs();
151 Q_SCRIPTABLE
void resumeNetworkJobs();
155 Q_SCRIPTABLE
void makeResourceOnline(MessageViewer::Viewer::ResourceOnlineMode mode);
162 Q_SCRIPTABLE
void checkAccount(
const QString & account );
164 Q_SCRIPTABLE
bool selectFolder(
const QString & folder );
166 Q_SCRIPTABLE
bool canQueryClose();
168 Q_SCRIPTABLE
bool handleCommandLine(
bool noArgsOpensReader );
186 Q_SCRIPTABLE
int openComposer(
const QString &
to,
219 Q_SCRIPTABLE
int openComposer(
const QString & to,
231 const QString & attachParamValue,
234 unsigned int identity );
282 Q_SCRIPTABLE
int viewMessage(
const QString & messageFile );
284 Q_SCRIPTABLE
void updateConfig();
286 Q_SCRIPTABLE
void showFolder(
const QString &collectionId);
288 Q_SCRIPTABLE
void reloadFolderArchiveConfig();
296 void checkMailOnStartup();
303 static bool askToGoOnline();
309 static bool isOffline();
314 KSharedConfig::Ptr config();
320 Akonadi::ChangeRecorder *folderCollectionMonitor()
const;
325 Akonadi::EntityTreeModel *entityTreeModel()
const;
331 Akonadi::EntityMimeTypeFilterModel *collectionModel()
const;
333 void recoverDeadLetters();
334 void closeAllKMailWindows();
337 bool doSessionManagement();
340 void action(
bool mailto,
bool check,
const QString &to,
const QString &cc,
342 const KUrl &messageFile,
const KUrl::List &attach,
345 bool isImapFolder(
const Akonadi::Collection& ,
bool &isOnline)
const;
348 void setAccountStatus(
bool);
354 MessageComposer::MessageSender *msgSender();
356 void openFilterDialog(
bool createDummyFilter =
true);
360 KPIMIdentities::IdentityManager *identityManager();
362 MailCommon::JobScheduler*
jobScheduler()
const {
return mJobScheduler; }
365 void expireAllFoldersNow();
375 static QString localDataPath();
381 bool haveSystemTrayApplet()
const;
386 KMainWindow* mainWin();
395 Akonadi::Collection::List allFolders()
const;
397 void selectCollectionFromId(
const Akonadi::Collection::Id
id);
401 void stopAgentInstance();
404 bool showPopupAfterDnD();
406 bool excludeImportantMailFromExpiry();
408 qreal closeToQuotaThreshold();
410 Akonadi::Collection::Id lastSelectedFolder();
411 void setLastSelectedFolder(
const Akonadi::Collection::Id &col );
415 void checkFolderFromResources(
const Akonadi::Collection::List& collectionList );
419 void savePaneSelection();
421 void updatePaneTagComboBox();
424 PimCommon::AutoCorrection* composerAutoCorrection();
426 void toggleSystemTray();
428 PimCommon::StorageServiceManager *storageServiceManager()
const;
430 bool allowToDebugBalooSupport()
const;
433 void agentInstanceBroken(
const Akonadi::AgentInstance& instance );
438 void updateSystemTray();
442 void updatedTemplates();
445 void dumpDeadLetters();
452 void slotRequestConfigSync();
457 void slotSyncConfig();
459 void slotShowConfigurationDialog();
460 void slotRunBackgroundTasks();
462 void slotConfigChanged();
465 void configChanged();
466 void onlineStatusChanged( GlobalSettings::EnumNetworkState::type );
467 void customTemplatesChanged();
469 void startCheckMail();
474 void transportRemoved(
int id,
const QString &name );
476 void transportRenamed(
int id,
const QString &oldName,
const QString &newName );
477 void itemDispatchStarted();
478 void instanceStatusChanged(
const Akonadi::AgentInstance &);
480 void akonadiStateChanged( Akonadi::ServerManager::State );
482 void slotInstanceError(
const Akonadi::AgentInstance& instance,
const QString & message);
483 void slotInstanceWarning(
const Akonadi::AgentInstance&instance,
const QString& message);
484 void slotCollectionRemoved(
const Akonadi::Collection& col);
485 void slotDeleteIdentity( uint identity);
486 void slotInstanceRemoved(
const Akonadi::AgentInstance&);
487 void slotSystemNetworkStatusChanged( Solid::Networking::Status );
490 void slotCheckAccount(Akonadi::ServerManager::State state);
492 void verifyAccount();
493 void resourceGoOnLine();
494 void openReader(
bool onlyCheck );
498 mutable KPIMIdentities::IdentityManager *mIdentityManager;
499 MessageComposer::AkonadiSender *the_msgSender;
506 bool the_shuttingDown;
508 bool the_firstInstance;
510 KSharedConfig::Ptr mConfig;
512 KComponentData mXmlGuiInstance;
515 QTimer *mBackgroundTasksTimer;
516 MailCommon::JobScheduler* mJobScheduler;
521 Solid::Networking::Status mSystemNetworkStatus;
525 MailCommon::FolderCollectionMonitor *mFolderCollectionMonitor;
526 Akonadi::EntityTreeModel *mEntityTreeModel;
527 Akonadi::EntityMimeTypeFilterModel *mCollectionModel;
533 PimCommon::AutoCorrection *mAutoCorrection;
535 PimCommon::StorageServiceManager *mStorageManager;
539 #endif // _KMKERNEL_H
QTextCodec * networkCodec() const
Central point of coordination in KMail.
Q_SCRIPTABLE void openReader()
UndoStack * undoStack() const
const KComponentData & xmlGuiInstance()
bool firstInstance() const
MailCommon::JobScheduler * jobScheduler() const
void setFirstInstance(bool value)
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
QString previousVersion() const