• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • Sitemap
  • Contact Us
 

akonadi

resourcescheduler.h

00001 /*
00002     Copyright (c) 2007 Volker Krause <vkrause@kde.org>
00003 
00004     This library is free software; you can redistribute it and/or modify it
00005     under the terms of the GNU Library General Public License as published by
00006     the Free Software Foundation; either version 2 of the License, or (at your
00007     option) any later version.
00008 
00009     This library is distributed in the hope that it will be useful, but WITHOUT
00010     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00011     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00012     License for more details.
00013 
00014     You should have received a copy of the GNU Library General Public License
00015     along with this library; see the file COPYING.LIB.  If not, write to the
00016     Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00017     02110-1301, USA.
00018 */
00019 
00020 #ifndef AKONADI_RESOURCESCHEDULER_H
00021 #define AKONADI_RESOURCESCHEDULER_H
00022 
00023 #include <akonadi/collection.h>
00024 #include <akonadi/item.h>
00025 
00026 #include <QtCore/QObject>
00027 #include <QtCore/QStringList>
00028 #include <QtDBus/QDBusMessage>
00029 
00030 namespace Akonadi {
00031 
00039 class ResourceScheduler : public QObject
00040 {
00041   Q_OBJECT
00042 
00043   public:
00044     enum TaskType {
00045       Invalid,
00046       SyncAll,
00047       SyncCollectionTree,
00048       SyncCollection,
00049       FetchItem,
00050       ChangeReplay
00051     };
00052 
00053     class Task {
00054       public:
00055         Task() : type( Invalid ) {}
00056         TaskType type;
00057         Collection collection;
00058         Item item;
00059         QSet<QByteArray> itemParts;
00060         QDBusMessage dbusMsg;
00061 
00062         bool operator==( const Task &other ) const
00063         {
00064           return type == other.type
00065               && collection == other.collection
00066               && item == other.item
00067               && itemParts == other.itemParts;
00068         }
00069     };
00070 
00071     ResourceScheduler( QObject *parent = 0 );
00072 
00076     void scheduleFullSync();
00077 
00081     void scheduleCollectionTreeSync();
00082 
00087     void scheduleSync( const Collection &col );
00088 
00095     void scheduleItemFetch( const Item &item, const QSet<QByteArray> &parts, const QDBusMessage &msg );
00096 
00100     void taskDone();
00101 
00105     bool isEmpty();
00106 
00110     Task currentTask() const;
00111 
00115     void setOnline( bool state );
00116 
00117   public Q_SLOTS:
00121     void scheduleChangeReplay();
00122 
00123   Q_SIGNALS:
00124     void executeFullSync();
00125     void executeCollectionSync( const Akonadi::Collection &col );
00126     void executeCollectionTreeSync();
00127     void executeItemFetch( const Akonadi::Item &item, const QSet<QByteArray> &parts );
00128     void executeChangeReplay();
00129 
00130   private slots:
00131     void scheduleNext();
00132     void executeNext();
00133 
00134   private:
00135     QList<Task> mTaskList;
00136     Task mCurrentTask;
00137     bool mOnline;
00138 };
00139 
00140 }
00141 
00142 #endif

akonadi

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

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • akonadi
  • kabc
  • kblog
  • kcal
  • kimap
  • kioslave
  •   imap4
  •   mbox
  • kldap
  • kmime
  • kpimidentities
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.5.7.1
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