ScummVM API documentation
dropboxstorage.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifndef BACKENDS_CLOUD_DROPBOX_STORAGE_H
23#define BACKENDS_CLOUD_DROPBOX_STORAGE_H
24
25#include "backends/cloud/basestorage.h"
26#include "common/callback.h"
27#include "backends/networking/http/httpjsonrequest.h"
28
29namespace Cloud {
30namespace Dropbox {
31
34 DropboxStorage(const Common::String &token, const Common::String &refreshToken, bool enabled);
35
36protected:
41
45 uint32 storageIndex() override;
46
47 bool needsRefreshToken() override;
48
49 bool canReuseRefreshToken() override;
50
51public:
54
57
58 ~DropboxStorage() override;
59
71 void saveConfig(const Common::String &keyPrefix) override;
72
77 Common::String name() const override;
78
82 Networking::Request *listDirectory(const Common::String &path, ListDirectoryCallback callback, Networking::ErrorCallback errorCallback, bool recursive = false) override;
83
86
89
92
95
98
104
108 static void removeFromConfig(const Common::String &keyPrefix);
109
110 Common::String accessToken() const { return _token; }
111};
112
113} // End of namespace Dropbox
114} // End of namespace Cloud
115
116#endif
Definition: basestorage.h:30
Common::String _token
Definition: basestorage.h:33
Definition: dropboxstorage.h:32
Common::String cloudProvider() override
bool canReuseRefreshToken() override
static void removeFromConfig(const Common::String &keyPrefix)
Networking::Request * info(StorageInfoCallback callback, Networking::ErrorCallback errorCallback) override
DropboxStorage(const Networking::JsonResponse &codeFlowJson, Networking::ErrorCallback cb)
uint32 storageIndex() override
Networking::Request * upload(const Common::String &path, Common::SeekableReadStream *contents, UploadCallback callback, Networking::ErrorCallback errorCallback) override
Networking::Request * streamFileById(const Common::String &path, Networking::NetworkReadStreamCallback callback, Networking::ErrorCallback errorCallback) override
Networking::Request * createDirectory(const Common::String &path, BoolCallback callback, Networking::ErrorCallback errorCallback) override
void saveConfig(const Common::String &keyPrefix) override
static DropboxStorage * loadFromConfig(const Common::String &keyPrefix)
Common::String savesDirectoryPath() override
DropboxStorage(const Common::String &code, Networking::ErrorCallback cb)
Common::String name() const override
bool needsRefreshToken() override
Networking::Request * listDirectory(const Common::String &path, ListDirectoryCallback callback, Networking::ErrorCallback errorCallback, bool recursive=false) override
Definition: stream.h:745
Definition: str.h:59
Definition: request.h:119
Definition: request.h:47