• Skip to content
  • Skip to link menu
KDE 4.2 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/agentbase.h>
00024 #include <akonadi/collection.h>
00025 #include <akonadi/item.h>
00026 
00027 #include <QtCore/QObject>
00028 #include <QtCore/QStringList>
00029 #include <QtDBus/QDBusMessage>
00030 
00031 namespace Akonadi {
00032 
00033 //@cond PRIVATE
00034 
00042 class ResourceScheduler : public QObject
00043 {
00044   Q_OBJECT
00045 
00046   public:
00047     enum TaskType {
00048       Invalid,
00049       SyncAll,
00050       SyncCollectionTree,
00051       SyncCollection,
00052       FetchItem,
00053       ChangeReplay,
00054       DeleteResourceCollection
00055     };
00056 
00057     class Task {
00058       public:
00059         Task() : type( Invalid ) {}
00060         TaskType type;
00061         Collection collection;
00062         Item item;
00063         QSet<QByteArray> itemParts;
00064         QDBusMessage dbusMsg;
00065 
00066         bool operator==( const Task &other ) const
00067         {
00068           return type == other.type
00069               && collection == other.collection
00070               && item == other.item
00071               && itemParts == other.itemParts;
00072         }
00073     };
00074 
00075     ResourceScheduler( QObject *parent = 0 );
00076 
00080     void scheduleFullSync();
00081 
00085     void scheduleCollectionTreeSync();
00086 
00091     void scheduleSync( const Collection &col );
00092 
00099     void scheduleItemFetch( const Item &item, const QSet<QByteArray> &parts, const QDBusMessage &msg );
00100 
00105     void scheduleResourceCollectionDeletion();
00106 
00110     void taskDone();
00111 
00115     bool isEmpty();
00116 
00120     Task currentTask() const;
00121 
00125     void setOnline( bool state );
00126 
00127   public Q_SLOTS:
00131     void scheduleChangeReplay();
00132 
00133   Q_SIGNALS:
00134     void executeFullSync();
00135     void executeCollectionSync( const Akonadi::Collection &col );
00136     void executeCollectionTreeSync();
00137     void executeItemFetch( const Akonadi::Item &item, const QSet<QByteArray> &parts );
00138     void executeResourceCollectionDeletion();
00139     void executeChangeReplay();
00140     void status( int status, const QString &message = QString() );
00141 
00142   private slots:
00143     void scheduleNext();
00144     void executeNext();
00145 
00146   private:
00147     QList<Task> mTaskList;
00148     Task mCurrentTask;
00149     bool mOnline;
00150 };
00151 
00152 //@endcond
00153 
00154 }
00155 
00156 #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
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.5.7
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