Marble

OwncloudSyncBackend.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 OWNCLOUDSYNCBACKEND_H
7#define OWNCLOUDSYNCBACKEND_H
8
9#include <QList>
10#include <QNetworkReply>
11#include <QObject>
12
13class QUrl;
14class QDir;
15
16namespace Marble
17{
18
19class CloudSyncManager;
20class RouteItem;
21
22class OwncloudSyncBackend : public QObject
23{
25
26public:
27 explicit OwncloudSyncBackend(CloudSyncManager *cloudSyncManager);
28 ~OwncloudSyncBackend() override;
29
30 /**
31 * Generates an endpoint URL by appending endpoint name to API URL
32 * @param endpoint Endpoint name which will be appended to API URL
33 * @return QUrl which can be used for interactions with API
34 */
35 QUrl endpointUrl(const QString &endpoint) const;
36
37 /**
38 * Generates an endpoint URL by appending endpoint name and parameter to API URL
39 * @param endpoint Endpoint name which will be appended to API URL
40 * @param parameter Parameter which will be appended to API URL right after endpoint
41 * @return QUrl which can be used for interactions with API
42 */
43 QUrl endpointUrl(const QString &endpoint, const QString &parameter) const;
44
45 /**
46 * Removes route with given timestamp from cache
47 * @param cacheDir Local synchronization cache directory
48 * @param timestamp Timestamp of the route which will be deleted
49 */
50 void removeFromCache(const QDir &cacheDir, const QString &timestamp);
51
52 void uploadRoute(const QString &timestamp);
53 void downloadRouteList();
54 void downloadRoute(const QString &timestamp);
55 void deleteRoute(const QString &timestamp);
56 QPixmap createPreview(const QString &timestamp) const;
57 QString routeName(const QString &timestamp) const;
58
59public Q_SLOTS:
60 void cancelUpload();
61
62private Q_SLOTS:
63 void checkAuthReply();
64 void checkAuthError(QNetworkReply::NetworkError error);
65 void prepareRouteList();
66 void saveDownloadedRoute();
67 void validateSettings();
68
70 void routeListDownloaded(const QList<RouteItem> &routeList);
71 void routeDownloaded();
72 void routeDeleted();
73 void routeUploadProgress(qint64 sent, qint64 total);
74 void routeDownloadProgress(qint64 received, qint64 total);
75 void routeListDownloadProgress(qint64 received, qint64 total);
76 void removedFromCache(const QString &timestamp);
77
78private:
79 class Private;
80 Private *const d;
81};
82
83}
84
85#endif // OWNCLOUDSYNCBACKEND_H
Binds a QML item to a specific geodetic location in screen coordinates.
Q_OBJECTQ_OBJECT
Q_SIGNALSQ_SIGNALS
Q_SLOTSQ_SLOTS
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:15:45 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.