ScummVM API documentation
onedrivestorage.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_ONEDRIVE_ONEDRIVESTORAGE_H
23#define BACKENDS_CLOUD_ONEDRIVE_ONEDRIVESTORAGE_H
24
25#include "backends/cloud/basestorage.h"
26#include "backends/networking/http/httpjsonrequest.h"
27
28namespace Cloud {
29namespace OneDrive {
30
33 OneDriveStorage(const Common::String &token, const Common::String &refreshToken, bool enabled);
34
36 void infoInnerCallback(StorageInfoCallback outerCallback, const Networking::JsonResponse &json);
37
38 void fileInfoCallback(Networking::NetworkReadStreamCallback outerCallback, const Networking::JsonResponse &response);
39
40protected:
45
49 uint32 storageIndex() override;
50
51 bool needsRefreshToken() override;
52
53 bool canReuseRefreshToken() override;
54
55public:
58
61
62 ~OneDriveStorage() override;
63
75 void saveConfig(const Common::String &keyPrefix) override;
76
81 Common::String name() const override;
82
86 Networking::Request *listDirectory(const Common::String &path, ListDirectoryCallback callback, Networking::ErrorCallback errorCallback, bool recursive = false) override;
87
90
93
96
99
102
108
112 static void removeFromConfig(const Common::String &keyPrefix);
113
114 Common::String accessToken() const { return _token; }
115};
116
117} // End of namespace OneDrive
118} // End of namespace Cloud
119
120#endif
Definition: basestorage.h:30
Common::String _token
Definition: basestorage.h:33
Definition: onedrivestorage.h:31
Common::String name() const override
Common::String savesDirectoryPath() override
Networking::Request * createDirectory(const Common::String &path, BoolCallback callback, Networking::ErrorCallback errorCallback) override
static void removeFromConfig(const Common::String &keyPrefix)
OneDriveStorage(const Common::String &code, Networking::ErrorCallback cb)
static OneDriveStorage * loadFromConfig(const Common::String &keyPrefix)
Networking::Request * listDirectory(const Common::String &path, ListDirectoryCallback callback, Networking::ErrorCallback errorCallback, bool recursive=false) override
void saveConfig(const Common::String &keyPrefix) override
bool canReuseRefreshToken() override
Networking::Request * info(StorageInfoCallback callback, Networking::ErrorCallback errorCallback) override
OneDriveStorage(const Networking::JsonResponse &codeFlowJson, Networking::ErrorCallback cb)
Common::String cloudProvider() 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
Definition: stream.h:745
Definition: str.h:59
Definition: request.h:119
Definition: request.h:47