aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/objects/class_http.h
blob: 0059281efebae896871875c4d6ec984e6ab93b92 (about) (plain) (blame)
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
#ifndef _CLASS_HTTP_H_
#define _CLASS_HTTP_H_
//=============================================================================
//
//   File : class_http.h
//   Creation date : Fry Sep 5 18:13:45 2008 GMT by Carbone Alesssandro
//
//   This file is part of the KVirc irc client distribution
//   Copyright (C) 2008 Alessandro Carbone (elfonol at gmail dot com)
//
//   This program is FREE software. You can redistribute it and/or
//   modify it under the terms of the GNU General Public License
//   as published by the Free Software Foundation; either version 2
//   of the License, or (at your opinion) any later version.
//
//   This program is distributed in the HOPE that it will be USEFUL,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//   See the GNU General Public License for more details.
//
//   You should have received a copy of the GNU General Public License
//   along with this program. If not, write to the Free Software Foundation,
//   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
//=============================================================================




//===============================================================
#include "object_macros.h"
#include <QHttp>
#include <QFile>
#include <QHash>
#include <QSslError>

class KviKvsObject_http : public KviKvsObject
{
	Q_OBJECT
public:
	KVSO_DECLARE_OBJECT(KviKvsObject_http)
protected:
	QHttp *m_pHttp;
	QHash<int, QFile*> getDict;
	bool m_bAbort;
	bool m_bEnableForceRedirect;
protected:
	bool functionSetHost(KviKvsObjectFunctionCall *c);
	bool functionGet(KviKvsObjectFunctionCall *c);
	bool functionSetUser(KviKvsObjectFunctionCall *c);
	bool functionSetProxy(KviKvsObjectFunctionCall *c);
	bool functionRequestFinishedEvent(KviKvsObjectFunctionCall *c);
	bool functionRequestStartedEvent(KviKvsObjectFunctionCall *c);
	bool functionDataReadProgressEvent(KviKvsObjectFunctionCall *c);
	bool functionDataSendProgressEvent(KviKvsObjectFunctionCall *c);
	bool functionResponseHeaderReceivedEvent(KviKvsObjectFunctionCall *c);
	bool functionAbort(KviKvsObjectFunctionCall *c);
	bool functionDoneEvent(KviKvsObjectFunctionCall *c);
	bool functionStateChangedEvent(KviKvsObjectFunctionCall *c);
	bool functionReadAll(KviKvsObjectFunctionCall *c);
	bool functionReadyReadEvent(KviKvsObjectFunctionCall *c);
	bool functionErrorString(KviKvsObjectFunctionCall *c);
	bool functionPost(KviKvsObjectFunctionCall *c);
	bool functionFollowRedirect(KviKvsObjectFunctionCall *c);
	bool functionCurrentId(KviKvsObjectFunctionCall *c);
	void redirect(QString &file,const QHttpResponseHeader &r);

	#ifndef QT_NO_OPENSSL
	bool functionIgnoreSslErrors(KviKvsObjectFunctionCall *c);
	bool functionSslErrorsEvent(KviKvsObjectFunctionCall *c);
	#endif

protected slots:
	void slotRequestFinished ( int id, bool error );
	void slotDone (bool error );
	void slotRequestStarted ( int id );
	void slotDataSendProgress ( int done, int total );
	void slotDataReadProgress ( int done, int total );
	#ifndef QT_NO_OPENSSL
	void slotSslErrors(QList<QSslError>);
	#endif
	void slotResponseHeaderReceived(const QHttpResponseHeader &r);
	void slotReadyRead(const QHttpResponseHeader &r);
	void slotStateChanged ( int state);



};
#endif //_CLASS_HTTP_H_