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

KDE's Doxygen guidelines are available online.