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

mailcommon

  • sources
  • kde-4.12
  • 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 
32 namespace MailCommon {
33 
42 class MAILCOMMON_EXPORT Kernel : public QObject
43 {
44  Q_OBJECT
45  public:
46 
47  virtual ~Kernel();
48 
49  static Kernel *self();
50 
56  void registerKernelIf( IKernel *kernelIf )
57  {
58  mKernelIf = kernelIf;
59  }
60 
61  bool kernelIsRegistered() const
62  {
63  return mKernelIf != 0;
64  }
65 
66  IKernel *kernelIf() const
67  {
68  Q_ASSERT( mKernelIf );
69  return mKernelIf;
70  }
71 
77  void registerSettingsIf( ISettings *settingsIf )
78  {
79  mSettingsIf = settingsIf;
80  }
81 
82  ISettings *settingsIf() const
83  {
84  Q_ASSERT( mSettingsIf );
85  return mSettingsIf;
86  }
87 
93  void registerFilterIf( IFilter *filterIf )
94  {
95  mFilterIf = filterIf;
96  }
97 
98  IFilter *filterIf() const
99  {
100  Q_ASSERT( mFilterIf );
101  return mFilterIf;
102  }
103 
110  Akonadi::Collection collectionFromId( const Akonadi::Collection::Id &id ) const;
111 
112  Akonadi::Collection inboxCollectionFolder();
113  Akonadi::Collection outboxCollectionFolder();
114  Akonadi::Collection sentCollectionFolder();
115  Akonadi::Collection trashCollectionFolder();
116  Akonadi::Collection draftsCollectionFolder();
117  Akonadi::Collection templatesCollectionFolder();
118 
119  bool isSystemFolderCollection( const Akonadi::Collection &col );
120 
124  bool isMainFolderCollection( const Akonadi::Collection &col );
125 
129  bool folderIsDraftOrOutbox( const Akonadi::Collection &collection );
130 
131  bool folderIsDrafts( const Akonadi::Collection & );
132 
133  bool folderIsTemplates( const Akonadi::Collection &collection );
134 
142  bool folderIsTrash( const Akonadi::Collection &collection );
143 
151  Akonadi::Collection trashCollectionFromResource( const Akonadi::Collection & col );
152 
156  bool folderIsSentMailFolder( const Akonadi::Collection & );
157 
158  static bool folderIsInbox( const Akonadi::Collection &, bool withoutPop3InboxSetting = false );
159 
160  void initFolders();
161 
162  void emergencyExit( const QString &reason );
163 
164  private:
165  void findCreateDefaultCollection( Akonadi::SpecialMailCollections::Type );
166 
167  private Q_SLOTS:
168  void createDefaultCollectionDone( KJob *job );
169  void slotDefaultCollectionsChanged();
170 
171  Q_SIGNALS:
172  void requestConfigSync();
173  void requestSystemTrayUpdate();
174 
175  private:
176  Kernel( QObject *parent = 0 );
177  friend class KernelPrivate;
178 
179  IKernel *mKernelIf;
180  IFilter *mFilterIf;
181  ISettings *mSettingsIf;
182 };
183 
184 }
185 
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()
190 
191 #endif
MailCommon::Kernel::registerKernelIf
void registerKernelIf(IKernel *kernelIf)
Registers the interface dealing with main mail functionality.
Definition: mailkernel.h:56
mailinterfaces.h
MailCommon::Kernel::filterIf
IFilter * filterIf() const
Definition: mailkernel.h:98
QObject
MailCommon::Kernel::kernelIsRegistered
bool kernelIsRegistered() const
Definition: mailkernel.h:61
mailcommon_export.h
MailCommon::Kernel::registerFilterIf
void registerFilterIf(IFilter *filterIf)
Registers the interface dealing with mail settings.
Definition: mailkernel.h:93
MailCommon::Kernel::settingsIf
ISettings * settingsIf() const
Definition: mailkernel.h:82
MailCommon::Kernel
Deals with common mail application related operations.
Definition: mailkernel.h:42
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:66
MailCommon::Kernel::registerSettingsIf
void registerSettingsIf(ISettings *settingsIf)
Registers the interface dealing with mail settings.
Definition: mailkernel.h:77
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:55:15 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

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