19 #ifndef MAILCOMMON_MAILKERNEL_H
20 #define MAILCOMMON_MAILKERNEL_H
25 #include <Akonadi/Collection>
26 #include <Akonadi/KMime/SpecialMailCollections>
28 #include <KSharedConfig>
32 class ImapResourceCapabilitiesManager;
34 namespace MailCommon {
65 return mKernelIf != 0;
70 Q_ASSERT( mKernelIf );
81 mSettingsIf = settingsIf;
86 Q_ASSERT( mSettingsIf );
102 Q_ASSERT( mFilterIf );
112 Akonadi::Collection collectionFromId(
const Akonadi::Collection::Id &
id )
const;
114 Akonadi::Collection inboxCollectionFolder();
115 Akonadi::Collection outboxCollectionFolder();
116 Akonadi::Collection sentCollectionFolder();
117 Akonadi::Collection trashCollectionFolder();
118 Akonadi::Collection draftsCollectionFolder();
119 Akonadi::Collection templatesCollectionFolder();
121 bool isSystemFolderCollection(
const Akonadi::Collection &col );
126 bool isMainFolderCollection(
const Akonadi::Collection &col );
131 bool folderIsDraftOrOutbox(
const Akonadi::Collection &collection );
133 bool folderIsDrafts(
const Akonadi::Collection & );
135 bool folderIsTemplates(
const Akonadi::Collection &collection );
144 bool folderIsTrash(
const Akonadi::Collection &collection );
153 Akonadi::Collection trashCollectionFromResource(
const Akonadi::Collection & col );
158 bool folderIsSentMailFolder(
const Akonadi::Collection & );
160 static bool folderIsInbox(
const Akonadi::Collection &,
bool withoutPop3InboxSetting =
false );
164 void emergencyExit(
const QString &reason );
166 PimCommon::ImapResourceCapabilitiesManager *imapResourceManager()
const;
169 void findCreateDefaultCollection( Akonadi::SpecialMailCollections::Type );
172 void createDefaultCollectionDone( KJob *job );
173 void slotDefaultCollectionsChanged();
176 void requestConfigSync();
177 void requestSystemTrayUpdate();
181 friend class KernelPrivate;
186 PimCommon::ImapResourceCapabilitiesManager *mImapResourceManager;
191 #define KernelIf MailCommon::Kernel::self()->kernelIf()
192 #define FilterIf MailCommon::Kernel::self()->filterIf()
193 #define SettingsIf MailCommon::Kernel::self()->settingsIf()
194 #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.