Subversion Repositories svn1-original

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
299 david 1
/*============================================================================ 
2
*           Copyright (C) 2013 Embedded Solutions
3
**============================================================================
4
**
5
**  Project/Product : 
6
**  Filename        : qmhttppath.h
7
**  Author(s)       : DDP
8
**
9
**  Description     : Class to load an HTML file from a URL
10
**                    This version will save it as a data blob internally
11
**                    Commented out code will write it to a file
12
**
13
**  Information     :
14
**   Compiler       : ANSI C++
15
**   Target         : 
16
**
17
***==========================================================================*/
18
 
297 david 19
#ifndef HTTPWINDOW_H
20
#define HTTPWINDOW_H
21
 
22
#include <QDialog>
23
#include <QNetworkAccessManager>
24
#include <QUrl>
25
 
26
QT_BEGIN_NAMESPACE
27
class QDialogButtonBox;
28
class QFile;
29
class QLabel;
30
class QLineEdit;
31
class QProgressDialog;
32
class QPushButton;
33
class QSslError;
34
class QAuthenticator;
35
class QNetworkReply;
36
 
37
 
38
QT_END_NAMESPACE
39
 
40
class Qmhttppath : public QDialog
41
{
42
    Q_OBJECT
43
 
44
public:
45
    Qmhttppath(QWidget *parent = 0);
46
 
47
    void startRequest(QUrl url);
48
 
49
    QByteArray allData;
50
    QLineEdit *urlLineEdit;
51
 
52
private slots:
53
    void downloadFile();
54
    void cancelDownload();
55
    void httpFinished();
56
    void httpReadyRead();
57
    void updateDataReadProgress(qint64 bytesRead, qint64 totalBytes);
58
    void enableDownloadButton();
59
    void slotAuthenticationRequired(QNetworkReply*,QAuthenticator *);
60
#ifndef QT_NO_OPENSSL
61
    void sslErrors(QNetworkReply*,const QList<QSslError> &errors);
62
#endif
63
 
64
private:
65
    QLabel *statusLabel;
66
    QLabel *urlLabel;
67
 
68
    QProgressDialog *progressDialog;
69
    QPushButton *downloadButton;
70
    QPushButton *quitButton;
71
    QDialogButtonBox *buttonBox;
72
 
73
    QUrl url;
74
    QNetworkAccessManager qnam;
75
    QNetworkReply *reply;
76
    //QFile *file;
77
    int httpGetId;
78
    bool httpRequestAborted;
79
};
80
 
81
#endif