Content Hub
1.0.0
A session-wide content-exchange service
peer.h
Go to the documentation of this file.
1
/*
2
* Copyright © 2013 Canonical Ltd.
3
*
4
* This program is free software: you can redistribute it and/or modify
5
* it under the terms of the GNU Lesser General Public License version 3 as
6
* published by the Free Software Foundation.
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU Lesser General Public License for more details.
12
*
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
15
*
16
* Authored by: Thomas Voß <thomas.voss@canonical.com>
17
*/
18
#ifndef COM_LOMIRI_CONTENT_PEER_H_
19
#define COM_LOMIRI_CONTENT_PEER_H_
20
21
#include <QtDBus>
22
#include <QObject>
23
#include <QSharedPointer>
24
25
namespace
com
26
{
27
namespace
lomiri
28
{
29
namespace
content
30
{
31
class
Peer
:
public
QObject
32
{
33
Q_OBJECT
34
Q_PROPERTY(QString
id
READ
id
)
35
Q_PROPERTY(QString
name
READ
name
WRITE
setName
)
36
Q_PROPERTY(QString
iconName
READ
iconName
WRITE
setIconName
)
37
Q_PROPERTY(
bool
isDefaultPeer
READ
isDefaultPeer
)
38
39
public:
40
static const
Peer
&
unknown
();
41
Peer
(const QString&
id
= QString(),
bool
isDefaultPeer
= false,
QObject
* parent =
nullptr
);
42
Peer
(const QString&, const QString&, QByteArray&, const QString&,
bool
,
QObject
* parent =
nullptr
);
43
Peer
(const
Peer
& rhs);
44
virtual ~
Peer
();
45
46
Peer
& operator=(const
Peer
& rhs);
47
bool
operator==(const
Peer
& rhs) const;
48
49
Q_INVOKABLE virtual const QString&
id
() const;
50
Q_INVOKABLE virtual QString
name
() const;
51
Q_INVOKABLE
void
setName
(const QString&);
52
Q_INVOKABLE virtual QByteArray
iconData
() const;
53
Q_INVOKABLE
void
setIconData
(const QByteArray&);
54
Q_INVOKABLE virtual QString
iconName
() const;
55
Q_INVOKABLE
void
setIconName
(const QString&);
56
Q_INVOKABLE virtual
bool
isDefaultPeer
() const;
57
58
private:
59
struct Private;
60
QSharedPointer<Private> d;
61
};
62
}
63
}
64
}
65
66
Q_DECL_EXPORT
67
QDBusArgument &operator<<(QDBusArgument &argument,
68
const
com
::lomiri::content::
Peer
&peer);
69
70
Q_DECL_EXPORT
71
const QDBusArgument &operator>>(const QDBusArgument &argument,
72
com
::lomiri::content::
Peer
&peer);
73
74
Q_DECLARE_METATYPE(
com
::lomiri::content::
Peer
)
75
76
#endif // COM_LOMIRI_CONTENT_PEER_H_
QObject
com::lomiri::content::Peer::unknown
static const Peer & unknown()
com::lomiri::content::Peer
Definition:
peer.h:31
com::lomiri::content::Peer::setIconName
Q_INVOKABLE void setIconName(const QString &)
com::lomiri::content::Peer::setIconData
Q_INVOKABLE void setIconData(const QByteArray &)
com::lomiri::content::Peer::isDefaultPeer
bool isDefaultPeer
Definition:
peer.h:37
com::lomiri::content::Peer::iconName
QString iconName
Definition:
peer.h:36
com
Definition:
hub.h:31
com::lomiri::content::Peer::iconData
virtual Q_INVOKABLE QByteArray iconData() const
com::lomiri::content::Peer::name
QString name
Definition:
peer.h:35
com::lomiri::content::Peer::setName
Q_INVOKABLE void setName(const QString &)
include
com
lomiri
content
peer.h
Generated on Fri Jul 7 2023 11:53:37 for Content Hub by
1.8.17