ButeoSynchronizationFramework
SyncOnChange.h
1 #ifndef SYNCONCHANGE_H
2 #define SYNCONCHANGE_H
3 
4 #include <QObject>
5 #include <QHash>
6 #include <QStringList>
7 
8 namespace Buteo
9 {
10 
11 class SyncProfile;
12 class StorageChangeNotifier;
13 class PluginManager;
14 class SyncOnChangeScheduler;
15 
19 class SyncOnChange : public QObject
20 {
21  Q_OBJECT
22 
23 public:
26  SyncOnChange();
27 
30  ~SyncOnChange();
31 
46  bool enable(const QHash<QString,QList<SyncProfile*> >& aSOCStorageMap,
47  SyncOnChangeScheduler* aSOCScheduler,
48  PluginManager* aPluginManager, QStringList& aFailedStorages);
49 
56  void enable();
57 
61  void disable();
62 
65  void disableNext();
66 
72  void addProfile(const QString& aStorageName, SyncProfile* aProfile);
73 
74 public Q_SLOTS:
77  void sync(QString aStorageName);
78 
79 private:
83  void cleanup(const QString& aStorageName);
84 
89  QStringList getSOCStorageNames();
90 
91  StorageChangeNotifier* iStorageChangeNotifier;
92  QHash<QString,QList<SyncProfile*> > iSOCStorageMap;
93  SyncOnChangeScheduler* iSOCScheduler;
94 };
95 
96 }
97 
98 #endif
void enable()
Definition: SyncOnChange.cpp:59
Manages plugins.
Definition: PluginManager.h:91
Definition: SyncOnChangeScheduler.h:15
this class initiates a sync if there are changes in storage(s) it&#39;s asked to monitor ...
Definition: SyncOnChange.h:19
Notifies about changes in storages that it&#39;s asked to monitor.
Definition: StorageChangeNotifier.h:16
Definition: AccountsHelper.h:31
void disableNext()
Note the next change, and disable SOC if that happens.
Definition: SyncOnChange.cpp:82
~SyncOnChange()
destructor
Definition: SyncOnChange.cpp:16
void disable()
disable sync on change immediately, i.e stop listening to change notifiers
Definition: SyncOnChange.cpp:76
void addProfile(const QString &aStorageName, SyncProfile *aProfile)
adds a profile to the list of profiles interested in soc for a specific storage
Definition: SyncOnChange.cpp:134
void sync(QString aStorageName)
Definition: SyncOnChange.cpp:118
A top level synchronization profile.
Definition: SyncProfile.h:47
SyncOnChange()
constructor
Definition: SyncOnChange.cpp:9
Definition: SyncBackupAdaptor.h:40