|
void | init () |
|
void | save () |
|
void | replaceStorage (Storage *storage, uint32 index) |
|
void | removeStorage (Storage *storage) |
|
Cloud::Storage * | getCurrentStorage () const |
|
uint32 | getStorageIndex () const |
|
Common::StringArray | listStorages () const |
|
bool | switchStorage (uint32 index) |
|
Common::String | getStorageUsername (uint32 index) |
|
uint64 | getStorageUsedSpace (uint32 index) |
|
Common::String | getStorageLastSync (uint32 index) |
|
void | setStorageUsername (uint32 index, const Common::String &name) |
|
void | setStorageUsedSpace (uint32 index, uint64 used) |
|
void | setStorageLastSync (uint32 index, const Common::String &date) |
|
void | connectStorage (uint32 index, const Common::String &code, Networking::ErrorCallback cb=nullptr) |
|
void | connectStorage (uint32 index, Networking::JsonResponse codeFlowJson, Networking::ErrorCallback cb=nullptr) |
|
bool | connectStorage (Networking::JsonResponse codeFlowJson, Networking::ErrorCallback cb=nullptr) |
|
void | disconnectStorage (uint32 index) |
|
Networking::Request * | listDirectory (const Common::String &path, Storage::ListDirectoryCallback callback, Networking::ErrorCallback errorCallback, bool recursive=false) |
|
Networking::Request * | downloadFolder (const Common::String &remotePath, const Common::Path &localPath, Storage::FileArrayCallback callback, Networking::ErrorCallback errorCallback, bool recursive=false) |
|
Networking::Request * | info (Storage::StorageInfoCallback callback, Networking::ErrorCallback errorCallback) |
|
Common::String | savesDirectoryPath () |
|
bool | canSyncFilename (const Common::String &filename) const |
|
bool | isStorageEnabled () const |
|
void | enableStorage () |
|
SavesSyncRequest * | syncSaves (Cloud::Storage::BoolCallback callback=nullptr, Networking::ErrorCallback errorCallback=nullptr) |
|
bool | isWorking () const |
|
bool | isSyncing () const |
|
double | getSyncDownloadingProgress () const |
|
void | getSyncDownloadingInfo (Storage::SyncDownloadingInfo &info) const |
|
double | getSyncProgress () const |
|
Common::Array< Common::String > | getSyncingFiles () const |
|
void | cancelSync () const |
|
void | showCloudDisabledIcon () |
|
bool | startDownload (const Common::String &remotePath, const Common::Path &localPath) const |
|
void | cancelDownload () const |
|
void | setDownloadTarget (GUI::CommandReceiver *target) const |
|
bool | isDownloading () const |
|
double | getDownloadingProgress () const |
|
uint64 | getDownloadBytesNumber () const |
|
uint64 | getDownloadTotalBytesNumber () const |
|
uint64 | getDownloadSpeed () const |
|
Common::String | getDownloadRemoteDirectory () const |
|
Common::Path | getDownloadLocalDirectory () const |
|
virtual bool | allowMapping () const |
|
|
static bool | hasInstance () |
|
static CloudManager & | instance () |
|
static void | destroy () |
|
typedef CloudManager | SingletonBaseType |
|
static CloudManager * | _singleton |
|
◆ init()
void Cloud::CloudManager::init |
( |
| ) |
|
Loads all information from configs and creates current Storage instance.
- Note
- It's called once on startup in scummvm_main().
◆ save()
void Cloud::CloudManager::save |
( |
| ) |
|
Saves all information into configuration file.
◆ replaceStorage()
void Cloud::CloudManager::replaceStorage |
( |
Storage * |
storage, |
|
|
uint32 |
index |
|
) |
| |
Replace active Storage.
- Note
- this method automatically saves the changes with ConfMan.
- Parameters
-
storage | Cloud::Storage to replace active storage with. |
index | one of Cloud::StorageID enum values to indicate what storage type is replaced. |
◆ removeStorage()
void Cloud::CloudManager::removeStorage |
( |
Storage * |
storage | ) |
|
Adds storage in the list of storages to remove later.
◆ getCurrentStorage()
Returns active Storage, which could be used to interact with cloud storage.
- Returns
- active Cloud::Storage or null, if there is no active Storage.
◆ getStorageIndex()
uint32 Cloud::CloudManager::getStorageIndex |
( |
| ) |
const |
◆ listStorages()
Return Storages names as list.
- Returns
- a list of Storages names.
◆ switchStorage()
bool Cloud::CloudManager::switchStorage |
( |
uint32 |
index | ) |
|
Changes the storage to the one with given index.
- Parameters
-
◆ getStorageUsername()
Common::String Cloud::CloudManager::getStorageUsername |
( |
uint32 |
index | ) |
|
Return username used by Storage.
- Parameters
-
- Returns
- username or "" if index is invalid (no such Storage).
◆ getStorageUsedSpace()
uint64 Cloud::CloudManager::getStorageUsedSpace |
( |
uint32 |
index | ) |
|
Return space used by Storage.
- Parameters
-
- Returns
- used space in bytes or 0 if index is invalid (no such Storage).
◆ getStorageLastSync()
Common::String Cloud::CloudManager::getStorageLastSync |
( |
uint32 |
index | ) |
|
Return Storage's last sync date.
- Parameters
-
- Returns
- last sync date or "" if index is invalid (no such Storage). It also returns "" if there never was any sync or if storage is syncing right now.
◆ setStorageUsername()
void Cloud::CloudManager::setStorageUsername |
( |
uint32 |
index, |
|
|
const Common::String & |
name |
|
) |
| |
Set Storage's username. Automatically saves changes to the config.
- Parameters
-
index | Storage's index. |
name | username to set |
◆ setStorageUsedSpace()
void Cloud::CloudManager::setStorageUsedSpace |
( |
uint32 |
index, |
|
|
uint64 |
used |
|
) |
| |
Set Storage's used space field. Automatically saves changes to the config.
- Parameters
-
index | Storage's index. |
used | value to set |
◆ setStorageLastSync()
void Cloud::CloudManager::setStorageLastSync |
( |
uint32 |
index, |
|
|
const Common::String & |
date |
|
) |
| |
Set Storage's last sync date. Automatically saves changes to the config.
- Parameters
-
index | Storage's index. |
date | date to set |
◆ connectStorage() [1/3]
Replace Storage which has given index with a storage created with given code.
- Parameters
-
index | Storage's index |
code | OAuth2 code received from user |
cb | callback to notify of success or error |
◆ connectStorage() [2/3]
Replace Storage which has given index with a storage created with given JSON response.
- Parameters
-
index | Storage's index |
codeFlowJson | OAuth2 code flow JSON response (acquired from cloud.scummvm.org) |
cb | callback to notify of success or error |
◆ connectStorage() [3/3]
From given JSON response, extract Storage index and replace Storage that has this index with a storage created with given JSON.
- Parameters
-
codeFlowJson | OAuth2 code flow JSON response (acquired from cloud.scummvm.org) |
cb | callback to notify of success or error |
- Returns
- whether Storage index was found and is correct
◆ disconnectStorage()
void Cloud::CloudManager::disconnectStorage |
( |
uint32 |
index | ) |
|
Remove Storage with a given index from config.
- Parameters
-
◆ listDirectory()
Returns ListDirectoryResponse with list of files.
◆ downloadFolder()
Returns Common::Array<StorageFile> with list of files, which were not downloaded.
◆ info()
◆ savesDirectoryPath()
Returns storage's saves directory path with the trailing slash.
◆ canSyncFilename()
bool Cloud::CloudManager::canSyncFilename |
( |
const Common::String & |
filename | ) |
const |
Returns whether given filename could be uploaded to or downloaded from storage.
◆ isStorageEnabled()
bool Cloud::CloudManager::isStorageEnabled |
( |
| ) |
const |
Returns whether current Storage is manually enabled by user (or false, if there is no active Storage).
◆ enableStorage()
void Cloud::CloudManager::enableStorage |
( |
| ) |
|
◆ syncSaves()
Starts saves syncing process in currently active storage if there is any.
◆ isWorking()
bool Cloud::CloudManager::isWorking |
( |
| ) |
const |
Returns whether there are any requests running.
◆ isSyncing()
bool Cloud::CloudManager::isSyncing |
( |
| ) |
const |
◆ getSyncDownloadingProgress()
double Cloud::CloudManager::getSyncDownloadingProgress |
( |
| ) |
const |
Returns a number in [0, 1] range which represents current sync downloading progress (1 = complete).
◆ getSyncDownloadingInfo()
Fills a struct with numbers about current sync downloading progress.
◆ getSyncProgress()
double Cloud::CloudManager::getSyncProgress |
( |
| ) |
const |
Returns a number in [0, 1] range which represents current sync progress (1 = complete).
◆ getSyncingFiles()
Returns an array of saves names which are not yet synced (thus cannot be used).
◆ cancelSync()
void Cloud::CloudManager::cancelSync |
( |
| ) |
const |
◆ showCloudDisabledIcon()
void Cloud::CloudManager::showCloudDisabledIcon |
( |
| ) |
|
Shows a "cloud disabled" icon for three seconds.
◆ startDownload()
Starts a folder download.
◆ cancelDownload()
void Cloud::CloudManager::cancelDownload |
( |
| ) |
const |
Cancels running download.
◆ setDownloadTarget()
◆ isDownloading()
bool Cloud::CloudManager::isDownloading |
( |
| ) |
const |
◆ getDownloadingProgress()
double Cloud::CloudManager::getDownloadingProgress |
( |
| ) |
const |
Returns a number in [0, 1] range which represents current download progress (1 = complete).
◆ getDownloadBytesNumber()
uint64 Cloud::CloudManager::getDownloadBytesNumber |
( |
| ) |
const |
Returns a number of bytes that is downloaded in current download progress.
◆ getDownloadTotalBytesNumber()
uint64 Cloud::CloudManager::getDownloadTotalBytesNumber |
( |
| ) |
const |
Returns a total number of bytes to be downloaded in current download progress.
◆ getDownloadSpeed()
uint64 Cloud::CloudManager::getDownloadSpeed |
( |
| ) |
const |
Returns download speed of current download progress.
◆ getDownloadRemoteDirectory()
Common::String Cloud::CloudManager::getDownloadRemoteDirectory |
( |
| ) |
const |
Returns remote directory path.
◆ getDownloadLocalDirectory()
Common::Path Cloud::CloudManager::getDownloadLocalDirectory |
( |
| ) |
const |
Returns local directory path.
The documentation for this class was generated from the following file: