|
qTbot 0.2.123.6f57966
qTbot is base back end library for your c++ Qt projects.
|
The TelegramSendFile class is the base class for uploading files to the server. More...
#include <telegramsendfile.h>


Public Member Functions | |
| TelegramSendFile (const QString &request, const QString &fileName, const QString &fileType, const QByteArray &data, const TelegramArgs &args, const QHash< QString, QSharedPointer< QJsonObject > > &extraObjects={}) | |
| TelegramSendFile prepares the send file request from a byte array. | |
| TelegramSendFile (const QString &request, const QFileInfo &file, const TelegramArgs &args, const QHash< QString, QSharedPointer< QJsonObject > > &extraObjects={}) | |
| TelegramSendFile prepares the send file request from a file. | |
| RequestMethod | method () const override |
| method Returns the method of the request. The file upload requests always use the Upload method. | |
| Public Member Functions inherited from qTbot::TelegramSingleRquest | |
| TelegramSingleRquest (const QString &request, const QMap< QString, QVariant > &args) | |
| TelegramSingleRquest This is the main constructor of the single requests. | |
| TelegramSingleRquest (const QString &request) | |
| TelegramSingleRquest This is the main constructor of the single requests. | |
| QString | baseAddress () const override |
| baseAddress This method returns the base domain of the remote server. | |
| RequestMethod | method () const override |
| method returns the method of the request. | |
| Public Member Functions inherited from qTbot::iRequest | |
| iRequest () | |
| iRequest default constructor. | |
| virtual QString | makeUpload () const |
| makeUpload This method prepares the data to upload. | |
| const QString & | request () const |
| request Returns the current request command. | |
| void | setRequest (const QString &newRequest) |
| setRequest sets a custom request command | |
| const QMap< QString, QVariant > & | args () const |
| args This method returns the the current list of arguments | |
| void | addArg (const QString &key, const QVariant &val) |
| addArg This method pushes a new argument to the arguments list | |
| void | setArgs (const QMap< QString, QVariant > &newArgs) |
| setArgs For some requests the list of arguments is possible to build only after the constructor. | |
| QString | argsToUrl () const |
| argsToUrl This method converts the arguments to a URL string. | |
| QSharedPointer< QHttpMultiPart > | argsToMultipartFormData () const |
| argsToMultipartFormData This method generates multipart/form-data request data. | |
| RequestPriority | priority () const |
| priority This is the priority of executing this request on the client. | |
| void | setPriority (RequestPriority newPriority) |
| setPriority This method sets a new priority for the request. | |
Protected Member Functions | |
| virtual QString | type () const |
| type Returns the file type. By default it is REQUEST_UPLOAD_FILE_KEY. | |
Additional Inherited Members | |
| Public Types inherited from qTbot::iRequest | |
| enum | RequestMethod { Get , Post , Upload } |
| RequestMethod This is the list of supported request types. More... | |
| enum | RequestPriority { NoPriority = 0 , LowPriority = 1 , NormalPriority = 2 , HighPriority = 3 , UngeredPriority = 4 , MaxPriorityValue = 0xff } |
| The RequestPriority enum This is the list of request execution priorities on the client side. More... | |
The TelegramSendFile class is the base class for uploading files to the server.
Definition at line 23 of file telegramsendfile.h.
| qTbot::TelegramSendFile::TelegramSendFile | ( | const QString & | request, |
| const QString & | fileName, | ||
| const QString & | fileType, | ||
| const QByteArray & | data, | ||
| const TelegramArgs & | args, | ||
| const QHash< QString, QSharedPointer< QJsonObject > > & | extraObjects = {} ) |
TelegramSendFile prepares the send file request from a byte array.
| request | This is the request name (command) of the telegram api. |
| fileName | This is the displayed name of the file. |
| fileType | This is the type of the file (for example photo or document). |
| data | This is the file source data. |
| args | This is the general arguments of the request (include the target chat id). |
| extraObjects | This is the additional objects of the telegram message (json). |
Definition at line 14 of file telegramsendfile.cpp.


| qTbot::TelegramSendFile::TelegramSendFile | ( | const QString & | request, |
| const QFileInfo & | file, | ||
| const TelegramArgs & | args, | ||
| const QHash< QString, QSharedPointer< QJsonObject > > & | extraObjects = {} ) |
TelegramSendFile prepares the send file request from a file.
| request | This is the request name (command) of the telegram api. |
| file | This is the file that will be uploaded. |
| args | This is the general arguments of the request (include the target chat id). |
| extraObjects | This is the additional objects of the telegram message (json). |
Definition at line 32 of file telegramsendfile.cpp.

|
overridevirtual |
method Returns the method of the request. The file upload requests always use the Upload method.
Implements qTbot::iRequest.
Definition at line 60 of file telegramsendfile.cpp.
|
protectedvirtual |
type Returns the file type. By default it is REQUEST_UPLOAD_FILE_KEY.
Definition at line 64 of file telegramsendfile.cpp.