Classes | |
struct | SyncDownloadingInfo |
Public Types | |
typedef Networking::Response< const Common::Array< StorageFile > & > | FileArrayResponse |
typedef Networking::Response< const StorageInfo & > | StorageInfoResponse |
typedef Networking::Response< bool > | BoolResponse |
typedef Networking::Response< const StorageFile & > | UploadResponse |
typedef Networking::Response< const Common::Array< StorageFile > & > | ListDirectoryResponse |
typedef Common::BaseCallback< const FileArrayResponse & > * | FileArrayCallback |
typedef Common::BaseCallback< const StorageInfoResponse & > * | StorageInfoCallback |
typedef Common::BaseCallback< const BoolResponse & > * | BoolCallback |
typedef Common::BaseCallback< const UploadResponse & > * | UploadCallback |
typedef Common::BaseCallback< const ListDirectoryResponse & > * | ListDirectoryCallback |
Protected Member Functions | |
virtual Networking::ErrorCallback | getErrorPrintingCallback () |
virtual void | printErrorResponse (const Networking::ErrorResponse &error) |
virtual Networking::Request * | addRequest (Networking::Request *request) |
virtual void | requestFinishedCallback (Networking::Request *invalidRequestPointer) |
virtual void | savesSyncDefaultCallback (const BoolResponse &response) |
virtual void | savesSyncDefaultErrorCallback (const Networking::ErrorResponse &error) |
virtual void | directoryDownloadedCallback (const FileArrayResponse &response) |
virtual void | directoryDownloadedErrorCallback (const Networking::ErrorResponse &error) |
Protected Attributes | |
uint32 | _runningRequestsCount |
Common::Mutex | _runningRequestsMutex |
SavesSyncRequest * | _savesSyncRequest |
bool | _syncRestartRequestsed |
FolderDownloadRequest * | _downloadFolderRequest |
bool | _isEnabled |
|
protectedvirtual |
Returns default error callback (printErrorResponse).
|
protectedvirtual |
Prints ErrorResponse contents with debug().
|
protectedvirtual |
Adds request to the ConnMan, but also increases _runningRequestsCount. This method should be used by Storage implementations instead of direct ConnMan.addRequest() call.
|
protectedvirtual |
Decreases _runningRequestCount. It's called from ConnMan automatically. Passed pointer is dangling, but one can use the address to determine some special Requests (which addresses were remembered somewhere).
|
pure virtual |
Storage methods, which are used by CloudManager to save storage in configuration file. Save storage data using ConfMan.
keyPrefix | all saved keys must start with this prefix. |
Implemented in Cloud::GoogleDrive::GoogleDriveStorage, Cloud::Box::BoxStorage, Cloud::OneDrive::OneDriveStorage, and Cloud::Dropbox::DropboxStorage.
|
pure virtual |
Return unique storage name.
Implemented in Cloud::GoogleDrive::GoogleDriveStorage, Cloud::Box::BoxStorage, Cloud::OneDrive::OneDriveStorage, and Cloud::Dropbox::DropboxStorage.
bool Cloud::Storage::isEnabled | ( | ) | const |
Return whether Storage has been manually enabled by user.
void Cloud::Storage::enable | ( | ) |
Set _isEnabled to true.
|
pure virtual |
Public Cloud API comes down there.
All Cloud API methods return Networking::Request *, which might be used to control request. All methods also accept a callback, which is called, when request is complete.Returns ListDirectoryResponse with list of files.
Implemented in Cloud::OneDrive::OneDriveStorage, Cloud::Dropbox::DropboxStorage, and Cloud::Id::IdStorage.
|
pure virtual |
Returns StorageFile with info about uploaded file.
Implemented in Cloud::GoogleDrive::GoogleDriveStorage, Cloud::Box::BoxStorage, Cloud::OneDrive::OneDriveStorage, and Cloud::Dropbox::DropboxStorage.
|
virtual |
Returns whether Storage supports upload(ReadStream).
Reimplemented in Cloud::Box::BoxStorage.
|
virtual |
Returns pointer to Networking::NetworkReadStream.
Reimplemented in Cloud::Id::IdStorage.
|
virtual |
Calls the callback when finished.
Reimplemented in Cloud::Id::IdStorage.
|
virtual |
Returns Common::Array<StorageFile> with list of files, which were not downloaded.
|
virtual |
Calls the callback when finished.
|
pure virtual |
Calls the callback when finished.
Implemented in Cloud::OneDrive::OneDriveStorage, Cloud::Dropbox::DropboxStorage, and Cloud::Id::IdStorage.
|
pure virtual |
Returns the StorageInfo struct via <callback>. Calls the <errorCallback> if failed to get information.
Implemented in Cloud::GoogleDrive::GoogleDriveStorage, Cloud::Box::BoxStorage, Cloud::OneDrive::OneDriveStorage, and Cloud::Dropbox::DropboxStorage.
|
pure virtual |
Returns storage's saves directory path with the trailing slash.
Implemented in Cloud::GoogleDrive::GoogleDriveStorage, Cloud::Box::BoxStorage, Cloud::OneDrive::OneDriveStorage, and Cloud::Dropbox::DropboxStorage.
|
virtual |
Returns whether there are any requests running.
|
virtual |
Returns whether there is a SavesSyncRequest running.
|
virtual |
Returns a number in [0, 1] range which represents current sync downloading progress (1 = complete).
|
virtual |
Fills a struct with numbers about current sync downloading progress.
|
virtual |
Returns a number in [0, 1] range which represents current sync progress (1 = complete).
|
virtual |
Returns an array of saves names which are not yet synced (thus cannot be used).
|
virtual |
Cancels running sync.
|
protectedvirtual |
Finishes the sync. Shows an OSD message.
|
protectedvirtual |
Finishes the sync. Shows an OSD message.
|
virtual |
Starts a folder download.
|
virtual |
Cancels running download.
|
virtual |
Sets FolderDownloadRequest's target to given CommandReceiver.
|
virtual |
Returns whether there is a FolderDownloadRequest running.
|
virtual |
Returns a number in [0, 1] range which represents current download progress (1 = complete).
|
virtual |
Returns a number of bytes that is downloaded in current download progress.
|
virtual |
Returns a total number of bytes to be downloaded in current download progress.
|
virtual |
Returns download speed of current download progress.
|
virtual |
Returns remote directory path.
|
virtual |
Returns local directory path.
|
protectedvirtual |
Finishes the download. Shows an OSD message.
|
protectedvirtual |
Finishes the download. Shows an OSD message.
|
protected |
Keeps track of running requests.
|
protected |
SavesSyncRequest-related
|
protected |
FolderDownloadRequest-related
|
protected |
Whether user manually enabled the Storage.