QEverCloud
6.1.0
Unofficial Evernote Cloud API for Qt
|
the InkNoteImageDownloader class is for downloading the images of ink notes which can be created with the official Evernote client on Windows (only with it, at least at the time of this writing). More...
#include <InkNoteImageDownloader.h>
Public Member Functions | |
InkNoteImageDownloader () | |
Default constructor. More... | |
InkNoteImageDownloader (QString host, QString shardId, QString authenticationToken, int width, int height) | |
Constructs InkNoteImageDownloader. More... | |
virtual | ~InkNoteImageDownloader () |
InkNoteImageDownloader & | setHost (QString host) |
InkNoteImageDownloader & | setShardId (QString shardId) |
InkNoteImageDownloader & | setAuthenticationToken (QString authenticationToken) |
InkNoteImageDownloader & | setWidth (int width) |
InkNoteImageDownloader & | setHeight (int height) |
QByteArray | download (Guid guid, const bool isPublic=false, const qint64 timeoutMsec=30000) |
Downloads the image for the ink note. More... | |
the InkNoteImageDownloader class is for downloading the images of ink notes which can be created with the official Evernote client on Windows (only with it, at least at the time of this writing).
On all other platforms the most one can get instead of the actual ink note is its non-editable image. This class retrieves just these, exclusively in PNG format.
NOTE: almost the entirety of this class' content represents an ad-hoc solution to a completely undocumented feature of Evernote service. A very small glimpse of information was once available on Evernote forums but it's deleted now... I collected an even smaller glimpse of information in this SO question: https://stackoverflow.com/q/39179012/1217285. For all practical purposes it is the only piece of information on this feature in existence now.
qevercloud::InkNoteImageDownloader::InkNoteImageDownloader | ( | ) |
Default constructor.
host, shardId, authenticationToken, width, height have to be specified before calling download or createPostRequest
qevercloud::InkNoteImageDownloader::InkNoteImageDownloader | ( | QString | host, |
QString | shardId, | ||
QString | authenticationToken, | ||
int | width, | ||
int | height | ||
) |
Constructs InkNoteImageDownloader.
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 ink notes you must supply a valid authentication token. For public resources the value specified is not used. |
width | Width of the ink note's resource |
height | Height of the ink note's resource |
|
virtual |
QByteArray qevercloud::InkNoteImageDownloader::download | ( | Guid | guid, |
const bool | isPublic = false , |
||
const qint64 | timeoutMsec = 30000 |
||
) |
Downloads the image for the ink note.
Unlike other pieces of QEverCloud API, downloading of ink note images is currently synchronous only. The reason for that is that AsyncResult is bounded to a single QNetworkRequest object but downloading of the ink note image might take multiple requests for several ink note image's vertical stripes which are then merged together to form a single image. Downloading the entire ink note's image via a single request works sometimes but sometimes Evernote replies to such request with messed up data which cannot be loaded into a QImage. The reason for that behaviour is unknown at the moment, and, given the state of official documentation
guid | The guid of the ink note's resource |
isPublic | Specify true for public ink notes. In this case authentication token is not sent to with the request as it should be according to the docs. |
timeoutMsec | Timeout for download request in milliseconds |
InkNoteImageDownloader& qevercloud::InkNoteImageDownloader::setAuthenticationToken | ( | QString | authenticationToken | ) |
authenticationToken | For working private ink notes you must supply a valid authentication token. For public resources the value specified is not used. |
InkNoteImageDownloader& qevercloud::InkNoteImageDownloader::setHeight | ( | int | height | ) |
height | Height of the ink note's resource |
InkNoteImageDownloader& qevercloud::InkNoteImageDownloader::setHost | ( | QString | host | ) |
host | www.evernote.com or sandbox.evernote.com |
InkNoteImageDownloader& qevercloud::InkNoteImageDownloader::setShardId | ( | QString | shardId | ) |
shardId | You can get the value from UserStore service or as a result of an authentication. |
InkNoteImageDownloader& qevercloud::InkNoteImageDownloader::setWidth | ( | int | width | ) |
width | Width of the ink note's resource |