QEverCloud
4.0.0
Unofficial Evernote Cloud API for Qt
|
the 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, bool isPublic=false) |
Downloads the image for the ink note. More... | |
the 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 can be found e.g. here but it is practically all one can find.
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, |
bool | isPublic = false |
||
) |
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 - missing - it is likely to stay so. if someone has an idea how to make it more reliable, please let me know.
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 shoud be according to the docs. |
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 |