This repository has been archived by the owner on Sep 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
/
ImageShackResponse.hpp
129 lines (111 loc) · 4.02 KB
/
ImageShackResponse.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
/*********************************************************************
* Thumbnail me 3.0
*
* Thumbnail me is a user interface for Movie thumbnailer.
* Generate thumbnails from any movie is now easier !
*
* @package Thumbnail me 3.0
* @author Christ Azika-Eros <christ@azika-eros.org>
* @copyright Quentin Rousseau (c) 2010 2009, Quentin Rousseau
* @license Creative Commons GNU GPL
* http://creativecommons.org/licenses/GPL/2.0/
* @link http://thumbnailme.sourceforge.net/
* @version 3.0
*
* @filesource ImageShackResponse.hpp
* @role The header of the ImageShackResponse class.
* This class handle ImageShack upload response
*
*********************************************************************/
#ifndef HEADER_IMAGESHACKRESPONSE
#define HEADER_IMAGESHACKRESPONSE
#include <QByteArray>
#include <QDebug>
#include <QDomDocument>
#include <QDomElement>
#include <QHash>
#include <QHashIterator>
#include <QNetworkReply>
#include <QString>
#include <QWidget>
#include "ImageShackObject.hpp"
/**
* ImageShackUploader class
*
* @author Christ Azika-Eros <christ@azika-eros.org>
**/
class ImageShackResponse : public QObject
{
Q_OBJECT
public : // variables, enums
/**
* Enumeration specifing the type of uploads :
* IMAGE or VIDEO
**/
enum UploadType{IMAGE,VIDEO};
public : // public method
/**
* Constructor with parameters
*
* @param ImageShackObject * fileUploaded - the file uploaded
* @param ImageShackResponse - imageShack response
**/
ImageShackResponse(ImageShackObject * fileUploaded ,
QHash<QString, QString> imageShackResponse);
~ImageShackResponse();
/**
* @brief Return a QHash containing ImageShack replies
* (imageLink..)
*
* @param const QByteArray * response the reply after
* the upload
* @return a QHash<QString, QString> containing ImageShack
* answer
**/
static QHash<QString, QString> makeResponseUsable(QByteArray response);
/**
* @brief Return a QHash containing ImageShack replies
* (imageUrl...)
*
* @param const QNetworkReply * response the reply after
* the upload
* @param UploadType uploadType the type of the upload
* @return a QHash<QString, QString> containing ImageShack
**/
static QHash<QString, QString> makeResponseUsable(QNetworkReply * response);
private : // Private objects or variables
/**
* ImageShackObject * fileUploaded - the file uploaded
**/
ImageShackObject * fileUploaded;
/**
* QHash<QString, QString> imageShackResponse - imageShack response
**/
QHash<QString, QString> imageShackResponse;
public : // Setters and Getters
/**
* the getter of the attribut fileUploaded
*
* @return ImageShackObject * the file uploaded
*/
ImageShackObject * getFileUploaded();
/**
* the getter of the attribut ImageShackResponse
*
* @return QHash<QString, QString> the imageShack response
*/
QHash<QString, QString> getImageShackResponse();
/**
* the setter of the attribut fileUploaded
*
* @param ImageShackObject * fileUploaded - the file uploaded
*/
void setFileUploaded(ImageShackObject * fileUploaded);
/**
* the setter of the attribut ImageShackResponse
*
* @param QHash<QString,QString> imageShackResponse - imageShackResponse response
*/
void setImageShackResponse(QHash<QString, QString> imageShackResponse);
};
#endif