QEverCloud
6.1.0
Unofficial Evernote Cloud API for Qt
|
The class is for downloading thumbnails for notes and resources from Evernote servers. More...
#include <Thumbnail.h>
Public Types | |
enum | ImageType { ImageType::PNG, ImageType::JPEG, ImageType::GIF, ImageType::BMP } |
Public Member Functions | |
Thumbnail () | |
Default constructor. More... | |
Thumbnail (QString host, QString shardId, QString authenticationToken, int size=300, ImageType 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 imageType) |
QByteArray | download (Guid guid, const bool isPublic=false, const bool isResourceGuid=false, const qint64 timeoutMsec=30000) |
Downloads the thumbnail for a resource or a note. More... | |
AsyncResult * | downloadAsync (Guid guid, const bool isPublic=false, const bool isResourceGuid=false, const qint64 timeoutMsec=30000) |
std::pair< QNetworkRequest, QByteArray > | createPostRequest (qevercloud::Guid guid, bool isPublic=false, bool isResourceGuid=false) |
Prepares a POST request for a thumbnail download. More... | |
Friends | |
QEVERCLOUD_EXPORT QTextStream & | operator<< (QTextStream &strm, const ImageType imageType) |
QEVERCLOUD_EXPORT QDebug & | operator<< (QDebug &dbg, const ImageType imageType) |
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 default 300x300 PNG images are requested.
|
strong |
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 | 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 private 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 default 300 is used. |
imageType | Thumbnail image type. See ImageType. By default PNG is used. |
|
virtual |
std::pair<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, |
const bool | isPublic = false , |
||
const bool | isResourceGuid = false , |
||
const qint64 | timeoutMsec = 30000 |
||
) |
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. |
timeoutMsec | Timeout for download request in milliseconds |
AsyncResult* qevercloud::Thumbnail::downloadAsync | ( | Guid | guid, |
const bool | isPublic = false , |
||
const bool | isResourceGuid = false , |
||
const qint64 | timeoutMsec = 30000 |
||
) |
Asynchronous version of download function
Thumbnail& qevercloud::Thumbnail::setAuthenticationToken | ( | QString | authenticationToken | ) |
authenticationToken | For working private 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 |
imageType | Thumbnail image type. See ImageType. By default PNG is used. |
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 default 300 is used. |
|
friend |
|
friend |