• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

mailcommon

  • sources
  • kde-4.14
  • kdepim
  • mailcommon
  • kernel
mailkernel.h
Go to the documentation of this file.
1 /*
2  Copyright (c) 2010 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com
3  Copyright (c) 2010 Andras Mantia <andras@kdab.com>
4 
5  This program is free software; you can redistribute it and/or modify it
6  under the terms of the GNU General Public License, version 2, as
7  published by the Free Software Foundation.
8 
9  This program is distributed in the hope that it will be useful, but
10  WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License along
15  with this program; if not, write to the Free Software Foundation, Inc.,
16  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18 
19 #ifndef MAILCOMMON_MAILKERNEL_H
20 #define MAILCOMMON_MAILKERNEL_H
21 
22 #include "mailcommon_export.h"
23 #include "interfaces/mailinterfaces.h"
24 
25 #include <Akonadi/Collection>
26 #include <Akonadi/KMime/SpecialMailCollections>
27 
28 #include <KSharedConfig>
29 
30 #include <QObject>
31 namespace PimCommon {
32 class ImapResourceCapabilitiesManager;
33 }
34 namespace MailCommon {
35 
44 class MAILCOMMON_EXPORT Kernel : public QObject
45 {
46  Q_OBJECT
47 public:
48 
49  virtual ~Kernel();
50 
51  static Kernel *self();
52 
58  void registerKernelIf( IKernel *kernelIf )
59  {
60  mKernelIf = kernelIf;
61  }
62 
63  bool kernelIsRegistered() const
64  {
65  return mKernelIf != 0;
66  }
67 
68  IKernel *kernelIf() const
69  {
70  Q_ASSERT( mKernelIf );
71  return mKernelIf;
72  }
73 
79  void registerSettingsIf( ISettings *settingsIf )
80  {
81  mSettingsIf = settingsIf;
82  }
83 
84  ISettings *settingsIf() const
85  {
86  Q_ASSERT( mSettingsIf );
87  return mSettingsIf;
88  }
89 
95  void registerFilterIf( IFilter *filterIf )
96  {
97  mFilterIf = filterIf;
98  }
99 
100  IFilter *filterIf() const
101  {
102  Q_ASSERT( mFilterIf );
103  return mFilterIf;
104  }
105 
112  Akonadi::Collection collectionFromId( const Akonadi::Collection::Id &id ) const;
113 
114  Akonadi::Collection inboxCollectionFolder();
115  Akonadi::Collection outboxCollectionFolder();
116  Akonadi::Collection sentCollectionFolder();
117  Akonadi::Collection trashCollectionFolder();
118  Akonadi::Collection draftsCollectionFolder();
119  Akonadi::Collection templatesCollectionFolder();
120 
121  bool isSystemFolderCollection( const Akonadi::Collection &col );
122 
126  bool isMainFolderCollection( const Akonadi::Collection &col );
127 
131  bool folderIsDraftOrOutbox( const Akonadi::Collection &collection );
132 
133  bool folderIsDrafts( const Akonadi::Collection & );
134 
135  bool folderIsTemplates( const Akonadi::Collection &collection );
136 
144  bool folderIsTrash( const Akonadi::Collection &collection );
145 
153  Akonadi::Collection trashCollectionFromResource( const Akonadi::Collection & col );
154 
158  bool folderIsSentMailFolder( const Akonadi::Collection & );
159 
160  static bool folderIsInbox( const Akonadi::Collection &, bool withoutPop3InboxSetting = false );
161 
162  void initFolders();
163 
164  void emergencyExit( const QString &reason );
165 
166  PimCommon::ImapResourceCapabilitiesManager *imapResourceManager() const;
167 
168 private:
169  void findCreateDefaultCollection( Akonadi::SpecialMailCollections::Type );
170 
171 private Q_SLOTS:
172  void createDefaultCollectionDone( KJob *job );
173  void slotDefaultCollectionsChanged();
174 
175 Q_SIGNALS:
176  void requestConfigSync();
177  void requestSystemTrayUpdate();
178 
179 private:
180  Kernel( QObject *parent = 0 );
181  friend class KernelPrivate;
182 
183  IKernel *mKernelIf;
184  IFilter *mFilterIf;
185  ISettings *mSettingsIf;
186  PimCommon::ImapResourceCapabilitiesManager *mImapResourceManager;
187 };
188 
189 }
190 
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()
195 
196 #endif
MailCommon::Kernel::registerKernelIf
void registerKernelIf(IKernel *kernelIf)
Registers the interface dealing with main mail functionality.
Definition: mailkernel.h:58
mailinterfaces.h
MailCommon::Kernel::filterIf
IFilter * filterIf() const
Definition: mailkernel.h:100
MailCommon::Kernel::kernelIsRegistered
bool kernelIsRegistered() const
Definition: mailkernel.h:63
QObject
mailcommon_export.h
MailCommon::Kernel::registerFilterIf
void registerFilterIf(IFilter *filterIf)
Registers the interface dealing with mail settings.
Definition: mailkernel.h:95
MailCommon::Kernel::settingsIf
ISettings * settingsIf() const
Definition: mailkernel.h:84
QString
MailCommon::Kernel
Deals with common mail application related operations.
Definition: mailkernel.h:44
MailCommon::ISettings
Interface to access some settings.
Definition: mailinterfaces.h:84
MAILCOMMON_EXPORT
#define MAILCOMMON_EXPORT
Definition: mailcommon_export.h:35
MailCommon::IFilter
Filter related interface.
Definition: mailinterfaces.h:73
MailCommon::IKernel
Generic interface for mail kernels.
Definition: mailinterfaces.h:45
MailCommon::Kernel::kernelIf
IKernel * kernelIf() const
Definition: mailkernel.h:68
MailCommon::Kernel::registerSettingsIf
void registerSettingsIf(ISettings *settingsIf)
Registers the interface dealing with mail settings.
Definition: mailkernel.h:79
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:31:40 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

mailcommon

Skip menu "mailcommon"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer
  • pimprint

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal