QEverCloud  3.0.0
Unofficial Evernote Cloud API for Qt
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
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 public:
48  struct ImageType {
49  enum type {PNG, JPEG, GIF, BMP};
50  };
51 
58  Thumbnail();
59 
74  Thumbnail(QString host, QString shardId, QString authenticationToken,
75  int size = 300, ImageType::type imageType = ImageType::PNG);
76 
77  virtual ~Thumbnail();
78 
83  Thumbnail & setHost(QString host);
84 
89  Thumbnail & setShardId(QString shardId);
90 
96  Thumbnail & setAuthenticationToken(QString authenticationToken);
97 
102  Thumbnail & setSize(int size);
103 
108  Thumbnail & setImageType(ImageType::type imageType);
109 
122  QByteArray download(Guid guid, bool isPublic = false, bool isResourceGuid = false);
123 
125  AsyncResult * downloadAsync(Guid guid, bool isPublic = false, bool isResourceGuid = false);
126 
138  QPair<QNetworkRequest, QByteArray> createPostRequest(qevercloud::Guid guid,
139  bool isPublic = false,
140  bool isResourceGuid = false);
141 
142 private:
143  ThumbnailPrivate * const d_ptr;
144  Q_DECLARE_PRIVATE(Thumbnail)
145 };
146 
147 } // namespace qevercloud
148 
149 #endif // QEVERCLOUD_THUMBNAIL_H
QString Guid
Definition: types.h:231
The class is for downloading thumbnails for notes and resources from Evernote servers.
Definition: thumbnail.h:41
#define QEVERCLOUD_EXPORT
Definition: export.h:23
type
Definition: thumbnail.h:49
Definition: AsyncResult.h:18
Definition: thumbnail.h:48
Returned by asynchonous versions of functions.
Definition: AsyncResult.h:43