Marble

BookmarkSyncManager.h
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2013 Utku Aydın <utkuaydin34@gmail.com>
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
14namespace Marble
15{
16
17class CloudSyncManager;
18class BookmarkManager;
19
20class MARBLE_EXPORT BookmarkSyncManager : public QObject
21{
22 Q_OBJECT
23
24 Q_PROPERTY(bool bookmarkSyncEnabled READ isBookmarkSyncEnabled WRITE setBookmarkSyncEnabled NOTIFY bookmarkSyncEnabledChanged)
25
26public:
27 explicit BookmarkSyncManager(CloudSyncManager *cloudSyncManager);
28 ~BookmarkSyncManager() override;
29
30 /**
31 * Last time Marble synced everything up
32 */
33 QDateTime lastSync() const;
34
35 /**
36 * Checks if the user enabled bookmark synchronization.
37 * @return true if bookmark synchronization enabled
38 */
39 bool isBookmarkSyncEnabled() const;
40
41 /**
42 * Setter for enabling/disabling bookmark synchronization.
43 * @param enabled Status of bookmark synchronization
44 */
45 void setBookmarkSyncEnabled(bool enabled);
46
47 void setBookmarkManager(BookmarkManager *manager);
48
49Q_SIGNALS:
50 void bookmarkSyncEnabledChanged(bool enabled);
51 void uploadProgress(qint64 sent, qint64 total);
52 void downloadProgress(qint64 received, qint64 total);
53 void mergeConflict(MergeItem *item);
54 void syncComplete();
55
56public Q_SLOTS:
57 /**
58 * Initiates running of synchronization "method chain".
59 */
60 void startBookmarkSync();
61
62 /**
63 *
64 * @param item
65 */
66 void resolveConflict(MergeItem *item);
67
68private:
69 Q_PRIVATE_SLOT(d, void saveDownloadedToCache(const QByteArray &kml))
70 Q_PRIVATE_SLOT(d, void parseTimestamp())
71 Q_PRIVATE_SLOT(d, void copyLocalToCache())
72
73 Q_PRIVATE_SLOT(d, void continueSynchronization())
74 Q_PRIVATE_SLOT(d, void completeSynchronization())
75 Q_PRIVATE_SLOT(d, void completeMerge())
76 Q_PRIVATE_SLOT(d, void completeUpload())
77
78private:
79 class Private;
80 Private *const d;
81};
82
83}
84
85#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-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:37:02 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.