linker.h 570 Bytes
Newer Older
Camilo Higuita's avatar
Camilo Higuita committed
1 2 3 4
#ifndef LINKER_H
#define LINKER_H

#include <QObject>
5

6 7
//#include "qgumbodocument.h"
//#include "qgumbonode.h"
8
#include <QVariantMap>
9

Camilo Higuita's avatar
Camilo Higuita committed
10 11 12
typedef QVariantMap LINK;

class Linker : public QObject
Camilo Higuita's avatar
Camilo Higuita committed
13 14 15
{
    Q_OBJECT
public:
Camilo Higuita's avatar
Camilo Higuita committed
16
    explicit Linker(QObject *parent = nullptr);
17
    static QByteArray getUrl(const QString &url);
Camilo Higuita's avatar
Camilo Higuita committed
18 19 20 21

    Q_INVOKABLE void extract(const QString &url);

private:
22
    QStringList query(const QByteArray &array, const QString &tag, const QString &attribute = QString());
23

Camilo Higuita's avatar
Camilo Higuita committed
24
signals:
25
    void previewReady(QVariantMap link);
Camilo Higuita's avatar
Camilo Higuita committed
26 27

public slots:
Camilo Higuita's avatar
Camilo Higuita committed
28

Camilo Higuita's avatar
Camilo Higuita committed
29 30
};

Camilo Higuita's avatar
Camilo Higuita committed
31
#endif // LINKER_H