• Skip to content
  • Skip to link menu
KDE 4.4 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

Plasma

akonadiengine.h

Go to the documentation of this file.
00001 /*
00002     Copyright (c) 2007 Volker Krause <vkrause@kde.org>
00003     Copyright (c) 2009 Sebastian Kügler <sebas@kde.org>
00004 
00005     This library is free software; you can redistribute it and/or modify it
00006     under the terms of the GNU Library General Public License as published by
00007     the Free Software Foundation; either version 2 of the License, or (at your
00008     option) any later version.
00009 
00010     This library is distributed in the hope that it will be useful, but WITHOUT
00011     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00012     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00013     License for more details.
00014 
00015     You should have received a copy of the GNU Library General Public License
00016     along with this library; see the file COPYING.LIB.  If not, write to the
00017     Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00018     02110-1301, USA.
00019 */
00020 
00021 
00022 #ifndef AKONADIENGINE_H
00023 #define AKONADIENGINE_H
00024 
00025 #include <plasma/dataengine.h>
00026 
00027 #include <Akonadi/Item>
00028 #include <Akonadi/Monitor>
00029 
00030 #include <kmime/kmime_message.h>
00031 #include <kabc/addressee.h>
00032 
00033 #include <boost/shared_ptr.hpp>
00034 typedef boost::shared_ptr<KMime::Message> MessagePtr;
00035 
00036 class KJob;
00037 
00038 class AkonadiEngine : public Plasma::DataEngine
00039 {
00040     Q_OBJECT
00041 
00042     public:
00043         AkonadiEngine( QObject* parent, const QVariantList& args );
00044         ~AkonadiEngine();
00045         QStringList sources() const;
00046 
00047     protected:
00048         bool sourceRequestEvent(const QString &name);
00049 
00050     private slots:
00051 
00052         void stopMonitor(const QString &name);
00053 
00054         void fetchEmailCollectionDone(KJob* job); // done retrieving whole collection
00055         void fetchContactCollectionDone(KJob* job); // done retrieving a whole contact collection
00056         void fetchMicroBlogDone(KJob* job);
00057 
00058         void emailItemsReceived(const Akonadi::Item::List &items);
00059 
00060         void fetchEmailCollectionsDone(KJob* job); // got list of collections
00061         void fetchContactCollectionsDone(KJob* job);
00062         void fetchMicroBlogCollectionsDone(KJob* job);
00063 
00064         void emailItemAdded(const Akonadi::Item &item, const QString &collection = QString());
00065         void contactItemAdded(const Akonadi::Item & item);
00066         void microBlogItemAdded(const Akonadi::Item &item);
00067 
00068     private:
00069         void initEmailMonitor();
00070         void initContactMonitor();
00071         void initMicroBlogMonitor();
00072         // useful for debugging
00073         void printMessage(MessagePtr msg);
00074         void printContact(const QString &source, const KABC::Addressee &a);
00075 
00076         Akonadi::Monitor* m_emailMonitor;
00077         Akonadi::Monitor* m_contactMonitor;
00078         Akonadi::Monitor* m_microBlogMonitor;
00079 
00080         QHash<KJob*, QString> m_jobCollections;
00081 };
00082 
00083 K_EXPORT_PLASMA_DATAENGINE(akonadi, AkonadiEngine)
00084 
00085 #endif

Plasma

Skip menu "Plasma"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

API Reference

Skip menu "API Reference"
  • KWin
  •   KWin Libraries
  • Libraries
  •   libkworkspace
  •   libsolidcontrol
  •   libtaskmanager
  • Plasma
  •     Animators
  •     Applets
  •     Engines
  • Solid Modules
  • System Settings
  •   SystemSettingsView
Generated for API Reference by doxygen 1.5.9-20090814
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal