File: ViewController.h

package info (click to toggle)
threadweaver 5.116.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,312 kB
  • sloc: cpp: 7,345; python: 33; sh: 13; makefile: 5
file content (38 lines) | stat: -rw-r--r-- 857 bytes parent folder | download | duplicates (4)
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
#ifndef VIEWCONTROLLER_H
#define VIEWCONTROLLER_H

#include <QByteArray>
#include <QObject>
#include <QUrl>

class MainWidget;
class QDomDocument;

class ViewController : public QObject
{
    Q_OBJECT
public:
    explicit ViewController(MainWidget *mainwidget);
    ~ViewController() override;

Q_SIGNALS:
    void setImage(QImage image);
    void setCaption(QString text);
    void setStatus(QString text);

private:
    void loadPlaceholderFromResource();
    void loadPostFromTumblr();
    void loadImageFromTumblr();

    QByteArray download(const QUrl &url);
    void error(const QString &message);
    void showResourceImage(const char *file);
    QString attributeTextFor(const QDomDocument &doc, const char *tag, const char *attribute);

    QUrl m_imageUrl;
    const QString m_apiPostUrl;
    QString m_fullPostUrl;
};

#endif // VIEWCONTROLLER_H