Sha256: 87ad449825b5358f635fbf56a348a41a75d8a65ea3ed693812dfea1448a65c9b

Contents?: true

Size: 907 Bytes

Versions: 3

Compression:

Stored size: 907 Bytes

Contents

#ifndef SUNSCRAPER_H
#define SUNSCRAPER_H

#include <QObject>
#include <QString>
#include <QMutex>
#include <QByteArray>

class QWebPage;
class QEventLoop;

class Sunscraper : public QObject
{
    Q_OBJECT

public:
    Sunscraper();

    void loadHtml(QString html);
    void loadUrl(QString url);

    void wait(unsigned timeout);

    QByteArray fetch();
    const char *fetchAsCString();

private slots:
    void finished(unsigned queryId, QString html);
    void timeout(unsigned queryId);

signals:
    void requestLoadHtml(unsigned queryId, QString html);
    void requestLoadUrl(unsigned queryId, QString html);
    void requestTimeout(unsigned queryId, unsigned timeout);
    void requestFinalize(unsigned queryId);

private:
    static unsigned m_nextQueryId;
    static QMutex m_staticMutex;

    QEventLoop *m_eventLoop;

    unsigned m_queryId;
    QByteArray m_html;
};

#endif // SUNSCRAPER_H

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sunscraper-1.1.0.beta3 ext/embed/sunscraper.h
sunscraper-1.1.0.beta2 ext/embed/sunscraper.h
sunscraper-1.1.0.beta1 ext/embed/sunscraper.h