~ubuntu-branches/ubuntu/trusty/content-hub/trusty-proposed

« back to all changes in this revision

Viewing changes to import/Ubuntu/Content/contentpeer.h

  • Committer: Package Import Robot
  • Author(s): Ubuntu daily release, Ken VanDine, Ubuntu daily release
  • Date: 2014-03-21 00:46:57 UTC
  • mfrom: (1.1.19)
  • Revision ID: package-import@ubuntu.com-20140321004657-5w0p7mj1qn9lrrj3
Tags: 0.0+14.04.20140321-0ubuntu1
[ Ken VanDine ]
* Adds support for multiple handler types: source, destination and
  share. Enforce single transfer per peer, if a second transfer
  request is made from a peer that already has an unfinished transfer,
  cancel the previous one. This is needed as long as apps are required
  to be single instance.
* If the transfer isn't persistent, attempt to hardlink instead of
  copying. If the link fails, fallback to a copy.
* If the default source is set to anything other than a click appId
  triplet, fallback to the legacy APP_ID. Changed default source for
  contacts to the legacy APP_ID for address-book-app

[ Ubuntu daily release ]
* New rebuild forced

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
#ifndef COM_UBUNTU_CONTENTPEER_H_
18
18
#define COM_UBUNTU_CONTENTPEER_H_
19
19
 
 
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>
21
25
 
22
26
#include <QObject>
23
27
#include <QString>
 
28
#include <QImage>
24
29
 
25
30
class ContentPeer : public QObject
26
31
{
27
32
    Q_OBJECT
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)
30
40
 
31
41
public:
32
42
    ContentPeer(QObject *parent = nullptr);
 
43
    ContentPeer(ContentType::Type type, QObject *parent);
 
44
 
 
45
    Q_INVOKABLE ContentTransfer* request();
 
46
    Q_INVOKABLE ContentTransfer* request(ContentStore *store);
33
47
 
34
48
    QString name();
35
49
    const QString &appId() const;
 
50
    void setAppId(const QString&);
 
51
    QImage &icon();
36
52
 
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);
 
55
 
 
56
    ContentHandler::Handler handler();
 
57
    void setHandler(ContentHandler::Handler handler);
 
58
 
 
59
    ContentType::Type contentType();
 
60
    void setContentType(ContentType::Type contentType);
 
61
 
 
62
    ContentTransfer::SelectionType selectionType();
 
63
    void setSelectionType(ContentTransfer::SelectionType selectionType);
 
64
 
 
65
    bool isDefaultPeer();
39
66
 
40
67
Q_SIGNALS:
41
68
    void nameChanged();
42
69
    void appIdChanged();
 
70
    void handlerChanged();
 
71
    void contentTypeChanged();
 
72
    void selectionTypeChanged();
43
73
 
44
74
private:
 
75
    void init();
 
76
 
 
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;
 
82
    bool m_explicit_peer;
 
83
    QImage m_icon;
46
84
};
47
85
 
48
86
#endif // COM_UBUNTU_CONTENTPEER_H_