-
Notifications
You must be signed in to change notification settings - Fork 1
/
crawler.h
executable file
·48 lines (39 loc) · 894 Bytes
/
crawler.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
#ifndef CRAWLER_H
#define CRAWLER_H
#include "customqnam.h"
#include <QtCore/QTimer>
#include <QtCore/QUrl>
#include <QtNetwork/QNetworkReply>
#include <QtWebKit/QWebPage>
#include <QtWebKit/QWebFrame>
class Crawler : public QObject
{
Q_OBJECT
public:
explicit Crawler(QObject* parent = 0);
~Crawler();
void start();
void stop();
void setOnLoadCommand(QString);
void setUrlToLoad(QUrl);
void setTargetPattern(QString);
void setTimeout(int);
bool ready();
public slots:
void onTimeout();
void onDetectedResource(QUrl);
signals:
void detectedResource(QUrl);
void couldNotDetectResource();
private:
QWebPage* m_page;
QWebFrame* m_frame;
CustomQNAM* m_manager;
bool m_shouldTriggerCommand;
QString m_command;
QUrl m_url;
bool m_resourceFound;
QTimer m_timer;
int m_timeout;
};
#endif // CRAWLER_H