LeechCraft  0.6.70-15082-g543737046d
Modular cross-platform feature rich live environment.
IWebFileStorage Class Referenceabstract

Interface for plugins supporting storing files on the web. More...

#include "iwebfilestorage.h"

Public Member Functions

virtual ~IWebFileStorage ()
 
virtual QStringList GetServiceVariants () const =0
 Returns the list of services supported by this plugin. More...
 
virtual void UploadFile (const QString &filename, const QString &service=QString())=0
 Uploads the given filename to the given service. More...
 

Protected Member Functions

virtual void fileUploaded (const QString &filename, const QUrl &fileUrl)=0
 Emitted when the given filename finishes uploading. More...
 

Detailed Description

Interface for plugins supporting storing files on the web.

Cloud storages like Google Drive and the likes also count.

A single plugin can support multiple services, and each service can be represented via multiple accounts. Each account or each accountless service (like a dumb filebin) is called a service variant. The list of all service variants is returned via GetServiceVariants() method.

Good IWebFileStorage plugins also implement IDataFilter, exposing filtering entities containing URLs to local files.

See also
IDataFilter

Definition at line 31 of file iwebfilestorage.h.

Constructor & Destructor Documentation

◆ ~IWebFileStorage()

virtual IWebFileStorage::~IWebFileStorage ( )
inlinevirtual

Definition at line 34 of file iwebfilestorage.h.

Member Function Documentation

◆ fileUploaded()

virtual void IWebFileStorage::fileUploaded ( const QString &  filename,
const QUrl &  fileUrl 
)
protectedpure virtual

Emitted when the given filename finishes uploading.

This signal should be emitted when the given filename finishes uploading. The filename should be exactly the one passed previously to the corresponding UploadFile() call that initiated the file upload process.

The URL under which the file is generally available is passed via the fileUrl parameter.

Note
This method is expected to be a signal.
Parameters
[out]filenameThe filename that has been just uploaded.
[out]fileUrlThe URL of under which filename is available.
See also
UploadFile()

◆ GetServiceVariants()

virtual QStringList IWebFileStorage::GetServiceVariants ( ) const
pure virtual

Returns the list of services supported by this plugin.

Returns
The list of service variants.

◆ UploadFile()

virtual void IWebFileStorage::UploadFile ( const QString &  filename,
const QString &  service = QString() 
)
pure virtual

Uploads the given filename to the given service.

This function should initiate uploading the given filename to the given service and returns immediatelly. When the file finishes uploading, the fileUploaded() signal should be emitted.

The service is a string returned from GetServiceVariants() method. It can also be an empty string, in which case either a default service variant should be chosen, or a service choosing dialog should appear.

Parameters
[in]filenameThe file to upload.
[in]serviceThe service variant to use, which may be an empty string
See also
fileUploaded()
GetServiceVariants()

The documentation for this class was generated from the following file: