aboutsummaryrefslogtreecommitdiff
path: root/common/cloudmanager.h
AgeCommit message (Collapse)Author
2016-08-24Fix comment formattingPeter Bozsó
2016-08-24CLOUD: Add OneDrive Storage stubAlexander Tkachev
Knows how to OAuth already. This commit also adds CloudManager::addStorage(), so OneDriveStorage can add newly created Storage and CloudManager can save it in the configuration file.
2016-08-24CLOUD: Add Storage saving mechanismAlexander Tkachev
In this commit CloudManager starts supporting multiple Storage. Now, in its init() it loads all the Storages and determines the current one. It now also has save() method. In that method all Storages are saved with their new saveConfig() method. CloudManager::save() not called from anywhere, though. The only one Storage that could be added is DropboxStorage in case you have no cloud-related config keys or you have no storages connected.
2016-08-24CLOUD: Add Callback typedefsAlexander Tkachev
And do some minor cleanup work.
2016-08-24CLOUD: Polish CallbacksAlexander Tkachev
Cleaned up all example code and old callbacks. New Callback classes are introduced in "common/callback.h" and documented.
2016-08-24CLOUD: Add complex callbacksAlexander Tkachev
Originally, I intended to add Storage API, StorageFile and StorageInfo stubs. When I tried to implement a simple info() call, I ended up fixing Request to contain some pointer field and all callbacks to have Request* parameter. And, now I have to place callback pointer into Request. which calls another callback. And, eventually, these "simple" callbacks would again require another pointer (to some caller class).
2016-08-24CLOUD: Add Dropbox into CloudManager's configsAlexander Tkachev
This commit adds: * ConfMan's new "cloud" domain; * CloudManager's init() method, where it loads keys from "cloud" configs domain; * CurlJsonRequest's addHeader() and addPostField() methods; * temporary Storage's printInfo() method; * DropboxStorage's implementation of printInfo(), which is using access token and user id; * DropboxStorage's loadFromConfig() static method to load access token and user id from configs and create a Storage instance with those; * temporary DropboxStorage's authThroughConsole() static method, which guides user through auth process from the console. So, in CloudManager's init() implementation ScummVM checks that there is "current_storage_type" key in "cloud" domain of configs, and loads corresponding storage if there is such key. If there is no such key, ScummVM offers user to auth with Dropbox. That's done through console, and thus it's temporary (it also requires restarting ScummVM twice and manually editing config.ini file).
2016-08-24CLOUD: Add Cloud::Manager and Cloud::StorageAlexander Tkachev
This commit introduces Common::CloudManager, which can be accessed from OSystem. The backend for this manager is Cloud::Manager (defined in backends/cloud/manager.h). It should load all users storages from configs and provide access to current Storage instance. For now it just creates a new one. Cloud::Storage (backends/cloud/storage.h) provides an API to interact with cloud storage, for example, create new directory or sync files. Right now it's not ready and has only two dummy methods: listDirectory() and syncSaves(). There is Cloud::Dropbox::DropboxStorage backend (backends/cloud/dropbox/dropboxstorage.h) for Cloud::Storage. Right now it implements both listDirectory() and syncSaves() with starting timer task and handling it by printing out some JSON examples.