QTfrontend/databrowser.h
author unc0rr
Sun, 04 Sep 2011 21:39:50 +0400
changeset 5772 c09c50efe8b5
parent 5755 a079b4dea081
child 5780 528dd4a14861
permissions -rw-r--r--
Replace iterators with simple declarative foreach (not tested if it works)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5755
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
     1
#ifndef DATABROWSER_H
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
     2
#define DATABROWSER_H
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
     3
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
     4
#include <QTextBrowser>
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
     5
#include <QSet>
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
     6
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
     7
class QNetworkAccessManager;
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
     8
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
     9
class DataBrowser : public QTextBrowser
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
    10
{
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
    11
    Q_OBJECT
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
    12
public:
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
    13
    explicit DataBrowser(QWidget *parent = 0);
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
    14
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
    15
signals:
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
    16
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
    17
public slots:
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
    18
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
    19
private:
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
    20
    QNetworkAccessManager *manager;
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
    21
    QHash<QUrl, QByteArray> resources;
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
    22
    QSet<QUrl> requestedResources;
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
    23
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
    24
    QVariant loadResource(int type, const QUrl & name);
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
    25
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
    26
private slots:
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
    27
    void resourceDownloaded();
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
    28
};
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
    29
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
    30
#endif // DATABROWSER_H