-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWebContents.h
50 lines (35 loc) · 1.25 KB
/
WebContents.h
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
#pragma once
#include <QObject>
#include <QString>
#include <QtNetwork/QNetworkAccessManager>
#include "TargetVersion.h"
/**
* @brief Get infos from web sites.
* @details This class gets infos from web sites like a version number or download
* link and provides these infos for consumers.
* @author Andeas Schrell
*/
class WebContents : public QObject {
Q_OBJECT
public:
/** Create a new instance. */
WebContents();
/** Fetch infos asynchronously.
* This method fetches infos from the given url and informs the caller when the infos are ready.
* @param url URL to load.
*/
void fetch(QString url);
public slots:
/** Slot called then URL was loaded.
* This slot is called from the QNetworkAccessManager when the page was loaded.
*/
void replyFinished(QNetworkReply*);
signals:
/** Signal which is emitted when the result string is available.
* Connect to this signal to get the resulting string from the web call.
* @param str resulting QString.
*/
void stringAvailable(QString str);
private:
QNetworkAccessManager* m_manager; /**< our Network Access manager */
};