Marble

BookmarkSyncManager.h
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2013 Utku Aydın <[email protected]>
4 //
5 
6 #ifndef BOOKMARKSYNCMANAGER_H
7 #define BOOKMARKSYNCMANAGER_H
8 
9 #include "MergeItem.h"
10 #include "marble_export.h"
11 
12 #include <QObject>
13 
14 namespace Marble {
15 
16 class CloudSyncManager;
17 class BookmarkManager;
18 
19 class MARBLE_EXPORT BookmarkSyncManager : public QObject
20 {
21  Q_OBJECT
22 
23  Q_PROPERTY( bool bookmarkSyncEnabled READ isBookmarkSyncEnabled WRITE setBookmarkSyncEnabled NOTIFY bookmarkSyncEnabledChanged )
24 
25 public:
26  explicit BookmarkSyncManager( CloudSyncManager *cloudSyncManager );
27  ~BookmarkSyncManager() override;
28 
29  /**
30  * Last time Marble synced everything up
31  */
32  QDateTime lastSync() const;
33 
34  /**
35  * Checks if the user enabled bookmark synchronization.
36  * @return true if bookmark synchronization enabled
37  */
38  bool isBookmarkSyncEnabled() const;
39 
40  /**
41  * Setter for enabling/disabling bookmark synchronization.
42  * @param enabled Status of bookmark synchronization
43  */
44  void setBookmarkSyncEnabled( bool enabled );
45 
46  void setBookmarkManager(BookmarkManager *manager);
47 
48 Q_SIGNALS:
49  void bookmarkSyncEnabledChanged(bool enabled);
50  void uploadProgress( qint64 sent, qint64 total );
51  void downloadProgress( qint64 received, qint64 total );
52  void mergeConflict( MergeItem *item );
53  void syncComplete();
54 
55 public Q_SLOTS:
56  /**
57  * Initiates running of synchronization "method chain".
58  */
59  void startBookmarkSync();
60 
61  /**
62  *
63  * @param item
64  */
65  void resolveConflict( MergeItem *item );
66 
67 private:
68  Q_PRIVATE_SLOT(d, void saveDownloadedToCache( const QByteArray &kml ) )
69  Q_PRIVATE_SLOT(d, void parseTimestamp() )
70  Q_PRIVATE_SLOT(d, void copyLocalToCache() )
71 
72  Q_PRIVATE_SLOT(d, void continueSynchronization() )
73  Q_PRIVATE_SLOT(d, void completeSynchronization() )
74  Q_PRIVATE_SLOT(d, void completeMerge() )
75  Q_PRIVATE_SLOT(d, void completeUpload() )
76 
77 private:
78  class Private;
79  Private *d;
80 };
81 
82 }
83 
84 #endif // BOOKMARKSYNCMANAGER_H
Binds a QML item to a specific geodetic location in screen coordinates.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Thu Sep 21 2023 04:12:25 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.