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
00033 #ifndef MKCAL_DIRECTORYSTORAGE_H
00034 #define MKCAL_DIRECTORYSTORAGE_H
00035
00036 #ifdef MKCAL_DIRECTORY_SUPPORT
00037
00038 #include "mkcal_export.h"
00039 #include "extendedstorage.h"
00040
00041 #include <calformat.h>
00042
00043 namespace mKCal {
00044
00049 class MKCAL_EXPORT DirectoryStorage : public ExtendedStorage
00050 {
00051 Q_OBJECT
00052
00053 public:
00068 explicit DirectoryStorage( const ExtendedCalendar::Ptr &calendar,
00069 const QString &directory = QString(),
00070 KCalCore::CalFormat *format = 0,
00071 bool validateNotebooks = false );
00072
00076 virtual ~DirectoryStorage();
00077
00082 QString directory() const;
00083
00091 void setFormat( KCalCore::CalFormat *format );
00092
00097 KCalCore::CalFormat *format() const;
00098
00106 static bool snapshot( const QString &from, const QString &to );
00107
00112 bool open();
00113
00118 bool load();
00119
00124 bool load( const QString &uid, const KDateTime &recurrenceId );
00125
00130 bool load( const QDate &date );
00131
00136 bool load( const QDate &start, const QDate &end );
00137
00145 bool load( const QString ¬ebook );
00146
00151 bool loadNotebookIncidences( const QString ¬ebookUid );
00152
00157 bool loadJournals();
00158
00163 int loadJournals( int limit, KDateTime *last );
00164
00169 bool loadPlainIncidences();
00170
00175 bool loadRecurringIncidences();
00176
00181 bool loadGeoIncidences();
00182
00187 bool loadGeoIncidences( float geoLatitude, float geoLongitude,
00188 float diffLatitude, float diffLongitude );
00189
00194 bool loadAttendeeIncidences();
00195
00200 int loadUncompletedTodos();
00201
00206 int loadCompletedTodos( bool hasDate, int limit, KDateTime *last );
00207
00212 int loadIncidences( bool hasDate, int limit, KDateTime *last );
00213
00218 int loadFutureIncidences( int limit, KDateTime *last );
00219
00224 int loadGeoIncidences( bool hasDate, int limit, KDateTime *last );
00225
00230 int loadUnreadInvitationIncidences();
00231
00236 int loadOldInvitationIncidences( int limit, KDateTime *last );
00237
00242 KCalCore::Person::List loadContacts();
00243
00248 int loadContactIncidences( const KCalCore::Person::Ptr &person, int limit, KDateTime *last );
00249
00254 bool save();
00255
00263 bool save( const QString ¬ebook );
00264
00269 bool cancel();
00270
00275 bool close();
00276
00277
00278
00283 void calendarModified( bool modified, KCalCore::Calendar *calendar );
00284
00289 void calendarIncidenceCreated( const KCalCore::Incidence::Ptr &incidence );
00290
00295 void calendarIncidenceAdded( const KCalCore::Incidence::Ptr &incidence );
00296
00301 void calendarIncidenceChanged( const KCalCore::Incidence::Ptr &incidence );
00302
00307 void calendarIncidenceDeleted( const KCalCore::Incidence::Ptr &incidence );
00308
00313 void calendarIncidenceAdditionCanceled( const KCalCore::Incidence::Ptr &incidence );
00314
00315
00316
00321 bool insertedIncidences( KCalCore::Incidence::List *list, const KDateTime &after,
00322 const QString ¬ebook = QString() );
00323
00328 bool modifiedIncidences( KCalCore::Incidence::List *list, const KDateTime &after,
00329 const QString ¬ebook = QString() );
00330
00335 bool deletedIncidences( KCalCore::Incidence::List *list, const KDateTime &after,
00336 const QString ¬ebook = QString() );
00337
00342 bool deletedIncidencesCreatedAfter( KCalCore::Incidence::List *list, const KDateTime &after,
00343 const QString ¬ebook = QString() );
00348 bool allIncidences( KCalCore::Incidence::List *list, const QString ¬ebook = QString() );
00349
00354 bool duplicateIncidences( KCalCore::Incidence::List *list,
00355 const KCalCore::Incidence::Ptr &incidence,
00356 const QString ¬ebook = QString() );
00357
00362 KDateTime incidenceDeletedDate( const KCalCore::Incidence::Ptr &incidence );
00363
00368 int eventCount();
00369
00374 int todoCount();
00375
00380 int journalCount();
00381
00386 bool notifyOpened( const KCalCore::Incidence::Ptr &incidence );
00387
00392 virtual void virtual_hook( int id, void *data );
00393
00394 protected:
00395 bool loadNotebooks();
00396 bool reloadNotebooks();
00397 bool modifyNotebook( const Notebook::Ptr &nb, DBOperation dbop, bool signal = true );
00398
00399 private:
00400
00401 Q_DISABLE_COPY( DirectoryStorage )
00402 class Private;
00403 Private *const d;
00404
00405
00406 public Q_SLOTS:
00407 void fileChanged ( const QString & path );
00408 void directoryChanged ( const QString & path );
00409
00410 };
00411
00412 }
00413
00414 #endif
00415
00416 #endif