QEverCloud
3.0.0
Unofficial Evernote Cloud API for Qt
|
The class is for downloading thumbnails for notes and resources from Evernote servers. More...
#include <thumbnail.h>
Classes | |
struct | ImageType |
Public Member Functions | |
Thumbnail () | |
Default constructor. More... | |
Thumbnail (QString host, QString shardId, QString authenticationToken, int size=300, ImageType::type imageType=ImageType::PNG) | |
Constructs Thumbnail. More... | |
virtual | ~Thumbnail () |
Thumbnail & | setHost (QString host) |
Thumbnail & | setShardId (QString shardId) |
Thumbnail & | setAuthenticationToken (QString authenticationToken) |
Thumbnail & | setSize (int size) |
Thumbnail & | setImageType (ImageType::type imageType) |
QByteArray | download (Guid guid, bool isPublic=false, bool isResourceGuid=false) |
Downloads the thumbnail for a resource or a note. More... | |
AsyncResult * | downloadAsync (Guid guid, bool isPublic=false, bool isResourceGuid=false) |
QPair< QNetworkRequest, QByteArray > | createPostRequest (qevercloud::Guid guid, bool isPublic=false, bool isResourceGuid=false) |
Prepares a POST request for a thumbnail download. More... | |
The class is for downloading thumbnails for notes and resources from Evernote servers.
These thumbnails are not available with general EDAM Thrift interface as explained in the documentation.
Usage:
By defualt 300x300 PNG images are requested.
qevercloud::Thumbnail::Thumbnail | ( | ) |
Default constructor.
host, shardId, authenticationToken have to be specified before calling download or createPostRequest
qevercloud::Thumbnail::Thumbnail | ( | QString | host, |
QString | shardId, | ||
QString | authenticationToken, | ||
int | size = 300 , |
||
ImageType::type | imageType = ImageType::PNG |
||
) |
Constructs Thumbnail.
host | www.evernote.com or sandbox.evernote.com |
shardId | You can get the value from UserStore service or as a result of an authentication. |
authenticationToken | For working privite notes/resources you must supply a valid authentication token. For public resources the value specified is not used. |
size | The size of the thumbnail. Evernote supports values from from 1 to 300. By defualt 300 is used. |
imageType | Thumbnail image type. See ImageType. By default PNG is used. |
|
virtual |
QPair<QNetworkRequest, QByteArray> qevercloud::Thumbnail::createPostRequest | ( | qevercloud::Guid | guid, |
bool | isPublic = false , |
||
bool | isResourceGuid = false |
||
) |
Prepares a POST request for a thumbnail download.
guid | The note or resource guid |
isPublic | Specify true for public notes/resources. In this case authentication token is not sent to with the request as it shoud be according to the docs. |
isResourceGuid | true if guid denotes a resource and false if it denotes a note. |
QByteArray qevercloud::Thumbnail::download | ( | Guid | guid, |
bool | isPublic = false , |
||
bool | isResourceGuid = false |
||
) |
Downloads the thumbnail for a resource or a note.
guid | The note or resource guid |
isPublic | Specify true for public notes/resources. In this case authentication token is not sent to with the request as it shoud be according to the docs. |
isResourceGuid | true if guid denotes a resource and false if it denotes a note. |
AsyncResult* qevercloud::Thumbnail::downloadAsync | ( | Guid | guid, |
bool | isPublic = false , |
||
bool | isResourceGuid = false |
||
) |
Asynchronous version of download function
Thumbnail& qevercloud::Thumbnail::setAuthenticationToken | ( | QString | authenticationToken | ) |
authenticationToken | For working privite notes/resources you must supply a valid authentication token. For public resources the value specified is not used. |
Thumbnail& qevercloud::Thumbnail::setHost | ( | QString | host | ) |
host | www.evernote.com or sandbox.evernote.com |
Thumbnail& qevercloud::Thumbnail::setImageType | ( | ImageType::type | imageType | ) |
Thumbnail& qevercloud::Thumbnail::setShardId | ( | QString | shardId | ) |
shardId | You can get the value from UserStore service or as a result of an authentication. |
Thumbnail& qevercloud::Thumbnail::setSize | ( | int | size | ) |
size | The size of the thumbnail. Evernote supports values from from 1 to 300. By defualt 300 is used. |