QEverCloud  4.0.0
Unofficial Evernote Cloud API for Qt
thumbnail.h
Go to the documentation of this file.
1 
9 #ifndef QEVERCLOUD_THUMBNAIL_H
10 #define QEVERCLOUD_THUMBNAIL_H
11 
12 #include "export.h"
13 #include "AsyncResult.h"
14 #include "generated/types.h"
15 #include <QByteArray>
16 #include <QString>
17 #include <QNetworkAccessManager>
18 
19 namespace qevercloud {
20 
22 class ThumbnailPrivate;
42 {
43 public:
49  struct ImageType {
50  enum type {PNG, JPEG, GIF, BMP};
51  };
52 
59  Thumbnail();
60 
75  Thumbnail(QString host, QString shardId, QString authenticationToken,
76  int size = 300, ImageType::type imageType = ImageType::PNG);
77 
78  virtual ~Thumbnail();
79 
84  Thumbnail & setHost(QString host);
85 
90  Thumbnail & setShardId(QString shardId);
91 
97  Thumbnail & setAuthenticationToken(QString authenticationToken);
98 
103  Thumbnail & setSize(int size);
104 
109  Thumbnail & setImageType(ImageType::type imageType);
110 
123  QByteArray download(Guid guid, bool isPublic = false, bool isResourceGuid = false);
124 
126  AsyncResult * downloadAsync(Guid guid, bool isPublic = false, bool isResourceGuid = false);
127 
139  QPair<QNetworkRequest, QByteArray> createPostRequest(qevercloud::Guid guid,
140  bool isPublic = false,
141  bool isResourceGuid = false);
142 
143 private:
144  ThumbnailPrivate * const d_ptr;
145  Q_DECLARE_PRIVATE(Thumbnail)
146 };
147 
148 } // namespace qevercloud
149 
150 #endif // QEVERCLOUD_THUMBNAIL_H
QString Guid
Definition: types.h:440
The class is for downloading thumbnails for notes and resources from Evernote servers.
Definition: thumbnail.h:41
#define QEVERCLOUD_EXPORT
Definition: export.h:19
type
Definition: thumbnail.h:50
Definition: AsyncResult.h:18
Definition: thumbnail.h:49
Returned by asynchonous versions of functions.
Definition: AsyncResult.h:43