19 #ifndef MAILCOMMON_MAILKERNEL_H
20 #define MAILCOMMON_MAILKERNEL_H
25 #include <Akonadi/Collection>
26 #include <Akonadi/KMime/SpecialMailCollections>
28 #include <KSharedConfig>
32 namespace MailCommon {
63 return mKernelIf != 0;
68 Q_ASSERT( mKernelIf );
79 mSettingsIf = settingsIf;
84 Q_ASSERT( mSettingsIf );
100 Q_ASSERT( mFilterIf );
110 Akonadi::Collection collectionFromId(
const Akonadi::Collection::Id &
id )
const;
112 Akonadi::Collection inboxCollectionFolder();
113 Akonadi::Collection outboxCollectionFolder();
114 Akonadi::Collection sentCollectionFolder();
115 Akonadi::Collection trashCollectionFolder();
116 Akonadi::Collection draftsCollectionFolder();
117 Akonadi::Collection templatesCollectionFolder();
119 bool isSystemFolderCollection(
const Akonadi::Collection &col );
124 bool isMainFolderCollection(
const Akonadi::Collection &col );
129 bool folderIsDraftOrOutbox(
const Akonadi::Collection &collection );
131 bool folderIsDrafts(
const Akonadi::Collection & );
133 bool folderIsTemplates(
const Akonadi::Collection &collection );
142 bool folderIsTrash(
const Akonadi::Collection &collection );
151 Akonadi::Collection trashCollectionFromResource(
const Akonadi::Collection & col );
156 bool folderIsSentMailFolder(
const Akonadi::Collection & );
158 static bool folderIsInbox(
const Akonadi::Collection &,
bool withoutPop3InboxSetting =
false );
162 void emergencyExit(
const QString &reason );
165 void findCreateDefaultCollection( Akonadi::SpecialMailCollections::Type );
168 void createDefaultCollectionDone( KJob *job );
169 void slotDefaultCollectionsChanged();
172 void requestConfigSync();
173 void requestSystemTrayUpdate();
177 friend class KernelPrivate;
186 #define KernelIf MailCommon::Kernel::self()->kernelIf()
187 #define FilterIf MailCommon::Kernel::self()->filterIf()
188 #define SettingsIf MailCommon::Kernel::self()->settingsIf()
189 #define CommonKernel MailCommon::Kernel::self()
void registerKernelIf(IKernel *kernelIf)
Registers the interface dealing with main mail functionality.
IFilter * filterIf() const
bool kernelIsRegistered() const
void registerFilterIf(IFilter *filterIf)
Registers the interface dealing with mail settings.
ISettings * settingsIf() const
Deals with common mail application related operations.
Interface to access some settings.
#define MAILCOMMON_EXPORT
Filter related interface.
Generic interface for mail kernels.
IKernel * kernelIf() const
void registerSettingsIf(ISettings *settingsIf)
Registers the interface dealing with mail settings.