libquentier  0.5.0
The library for rich desktop clients of Evernote service
SyncStatePersistenceManager.h
1 /*
2  * Copyright 2018-2019 Dmitry Ivanov
3  *
4  * This file is part of libquentier
5  *
6  * libquentier is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation, version 3 of the License.
9  *
10  * libquentier is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with libquentier. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef LIB_QUENTIER_PRIVATE_SYNCHRONIZATION_SYNC_STATE_PERSISTENCE_MANAGER_H
20 #define LIB_QUENTIER_PRIVATE_SYNCHRONIZATION_SYNC_STATE_PERSISTENCE_MANAGER_H
21 
22 #include <quentier/utility/Macros.h>
23 #include <quentier/utility/Linkage.h>
24 #include <quentier/types/Account.h>
25 
26 #include <qt5qevercloud/QEverCloud.h>
27 
28 #include <QObject>
29 #include <QHash>
30 #include <QString>
31 
32 
33 namespace quentier {
34 
35 class QUENTIER_EXPORT SyncStatePersistenceManager: public QObject
36 {
37  Q_OBJECT
38 public:
39  explicit SyncStatePersistenceManager(QObject * parent = nullptr);
40 
41  void getPersistentSyncState(
42  const Account & account, qint32 & userOwnDataUpdateCount,
43  qevercloud::Timestamp & userOwnDataSyncTime,
44  QHash<QString,qint32> & linkedNotebookUpdateCountsByLinkedNotebookGuid,
45  QHash<QString,qevercloud::Timestamp> & linkedNotebookSyncTimesByLinkedNotebookGuid);
46 
47  void persistSyncState(
48  const Account & account, const qint32 userOwnDataUpdateCount,
49  const qevercloud::Timestamp userOwnDataSyncTime,
50  const QHash<QString,qint32> & linkedNotebookUpdateCountsByLinkedNotebookGuid,
51  const QHash<QString,qevercloud::Timestamp> & linkedNotebookSyncTimesByLinkedNotebookGuid);
52 
53 Q_SIGNALS:
54  void notifyPersistentSyncStateUpdated(
55  Account account, qint32 userOwnDataUpdateCount,
56  qevercloud::Timestamp userOwnDataSyncTime,
57  QHash<QString,qint32> linkedNotebookUpdateCountsByLinkedNotebookGuid,
58  QHash<QString,qevercloud::Timestamp> linkedNotebookSyncTimesByLinkedNotebookGuid);
59 
60 private:
61  Q_DISABLE_COPY(SyncStatePersistenceManager);
62 };
63 
64 } // namespace quentier
65 
66 #endif // LIB_QUENTIER_PRIVATE_SYNCHRONIZATION_SYNC_STATE_PERSISTENCE_MANAGER_H
Definition: SyncStatePersistenceManager.h:35
Definition: DecryptedTextManager.h:26
The Account class encapsulates some details about the account: its name, whether it is local or synch...
Definition: Account.h:39