17
17
#ifndef COM_UBUNTU_CONTENTPEER_H_
18
18
#define COM_UBUNTU_CONTENTPEER_H_
20
#include "contenthandler.h"
21
#include "contenttransfer.h"
22
#include "contenttype.h"
23
#include <com/ubuntu/content/hub.h>
20
24
#include <com/ubuntu/content/peer.h>
25
30
class ContentPeer : public QObject
28
33
Q_PROPERTY(QString name READ name NOTIFY nameChanged)
29
Q_PROPERTY(QString appId READ appId NOTIFY appIdChanged)
34
Q_PROPERTY(QString appId READ appId WRITE setAppId NOTIFY appIdChanged)
35
Q_PROPERTY(ContentHandler::Handler handler READ handler WRITE setHandler NOTIFY handlerChanged)
36
Q_PROPERTY(ContentType::Type contentType READ contentType WRITE setContentType NOTIFY contentTypeChanged)
37
Q_PROPERTY(ContentTransfer::SelectionType selectionType READ selectionType WRITE setSelectionType NOTIFY selectionTypeChanged)
38
Q_PROPERTY(QImage icon READ icon)
39
Q_PROPERTY(bool isDefaultPeer READ isDefaultPeer)
32
42
ContentPeer(QObject *parent = nullptr);
43
ContentPeer(ContentType::Type type, QObject *parent);
45
Q_INVOKABLE ContentTransfer* request();
46
Q_INVOKABLE ContentTransfer* request(ContentStore *store);
35
49
const QString &appId() const;
50
void setAppId(const QString&);
37
53
const com::ubuntu::content::Peer &peer() const;
38
void setPeer(const com::ubuntu::content::Peer &peer);
54
void setPeer(const com::ubuntu::content::Peer &peer, bool explicitPeer = true);
56
ContentHandler::Handler handler();
57
void setHandler(ContentHandler::Handler handler);
59
ContentType::Type contentType();
60
void setContentType(ContentType::Type contentType);
62
ContentTransfer::SelectionType selectionType();
63
void setSelectionType(ContentTransfer::SelectionType selectionType);
41
68
void nameChanged();
42
69
void appIdChanged();
70
void handlerChanged();
71
void contentTypeChanged();
72
void selectionTypeChanged();
77
com::ubuntu::content::Hub *m_hub;
45
78
com::ubuntu::content::Peer m_peer;
79
ContentHandler::Handler m_handler;
80
ContentType::Type m_contentType;
81
ContentTransfer::SelectionType m_selectionType;
48
86
#endif // COM_UBUNTU_CONTENTPEER_H_