Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifdef MKCAL_TRACKER_SUPPORT
00024
00037 #ifndef MKCAL_TRACKERSTORAGE_H
00038 #define MKCAL_TRACKERSTORAGE_H
00039
00040 #include "extendedstorage.h"
00041
00042 #include <QtCore/QMetaType>
00043 #include <QtCore/QVector>
00044 #include <QtDBus/QtDBus>
00045
00046 Q_DECLARE_METATYPE( QVector<QStringList> )
00047
00048 namespace mKCal {
00049
00054 class MKCAL_EXPORT TrackerStorage : public ExtendedStorage
00055 {
00056 Q_OBJECT
00057
00058 public:
00065 explicit TrackerStorage( const ExtendedCalendar::Ptr &cal, bool synchronuousMode = true );
00066
00070 virtual ~TrackerStorage();
00071
00076 bool open();
00077
00082 bool load();
00083
00088 bool load( const QString &uid, const KDateTime &recurrenceId = KDateTime() );
00089
00094 bool load( const QDate &date );
00095
00100 bool load( const QDate &start, const QDate &end );
00101
00106 bool loadNotebookIncidences( const QString ¬ebookUid );
00107
00112 bool loadJournals();
00113
00120 int loadJournals( int limit, KDateTime *last );
00121
00126 bool loadPlainIncidences();
00127
00132 bool loadRecurringIncidences();
00133
00138 bool loadGeoIncidences();
00139
00144 bool loadGeoIncidences( float geoLatitude, float geoLongitude,
00145 float diffLatitude, float diffLongitude );
00146
00151 bool loadAttendeeIncidences();
00152
00157 int loadUncompletedTodos();
00158
00163 int loadCompletedTodos( bool hasDate, int limit, KDateTime *last );
00164
00169 int loadIncidences( bool hasDate, int limit, KDateTime *last );
00170
00175 int loadFutureIncidences( int limit, KDateTime *last );
00176
00181 int loadGeoIncidences( bool hasDate, int limit, KDateTime *last );
00182
00187 int loadUnreadInvitationIncidences();
00188
00193 int loadOldInvitationIncidences( int limit, KDateTime *last );
00194
00199 KCalCore::Person::List loadContacts();
00200
00205 int loadContactIncidences( const KCalCore::Person::Ptr &person, int limit, KDateTime *last );
00206
00211 bool save();
00212
00217 bool cancel();
00218
00223 bool close();
00224
00229 void calendarModified( bool modified, KCalCore::Calendar *calendar );
00230
00235 void calendarIncidenceCreated( const KCalCore::Incidence::Ptr &incidence );
00236
00241 void calendarIncidenceAdded( const KCalCore::Incidence::Ptr &incidence );
00242
00247 void calendarIncidenceChanged( const KCalCore::Incidence::Ptr &incidence );
00248
00253 void calendarIncidenceDeleted( const KCalCore::Incidence::Ptr &incidence );
00254
00259 bool insertedIncidences( KCalCore::Incidence::List *list, const KDateTime &after,
00260 const QString ¬ebook = QString() );
00261
00266 bool modifiedIncidences( KCalCore::Incidence::List *list, const KDateTime &after,
00267 const QString ¬ebook = QString() );
00268
00273 bool deletedIncidences( KCalCore::Incidence::List *list, const KDateTime &after,
00274 const QString ¬ebook = QString() );
00279 bool deletedIncidencesCreatedAfter( KCalCore::Incidence::List *list, const KDateTime &after,
00280 const QString ¬ebook = QString() );
00285 void calendarIncidenceAdditionCanceled( const KCalCore::Incidence::Ptr &incidence );
00286
00291 bool allIncidences( KCalCore::Incidence::List *list, const QString ¬ebook = QString() );
00292
00297 bool duplicateIncidences( KCalCore::Incidence::List *list,
00298 const KCalCore::Incidence::Ptr &incidence,
00299 const QString ¬ebook = QString() );
00300
00305 KDateTime incidenceDeletedDate( const KCalCore::Incidence::Ptr &incidence );
00306
00311 int eventCount();
00312
00317 int todoCount();
00318
00323 int journalCount();
00324
00329 bool notifyOpened( const KCalCore::Incidence::Ptr &incidence );
00330
00335 virtual void virtual_hook( int id, void *data );
00336
00337
00338
00344 void loaded( const KCalCore::Incidence::Ptr &incidence );
00345
00352 void loaded( bool error, QString message );
00353
00359 void saved( const KCalCore::Incidence::Ptr &incidence );
00360
00367 void saved( bool error, QString message );
00368
00369 public Q_SLOTS:
00370 void SubjectsAdded( QStringList const &subjects );
00371 void SubjectsRemoved( QStringList const &subjects );
00372 void SubjectsChanged( QStringList const &subjects );
00373
00374 protected:
00375 bool loadNotebooks();
00376 bool reloadNotebooks();
00377 bool modifyNotebook( const Notebook::Ptr &nb, DBOperation dbop, bool signal = true );
00378
00379 private:
00380
00381 Q_DISABLE_COPY( TrackerStorage )
00382 class Private;
00383 Private *const d;
00384
00385 };
00386
00387 }
00388
00389 #endif
00390
00391 #endif