2
* Copyright (C) 2015 Canonical, Ltd.
5
* Gustavo Pichorim Boiko <gustavo.boiko@canonical.com>
7
* This file is part of history-service.
9
* history-service is free software; you can redistribute it and/or modify
10
* it under the terms of the GNU General Public License as published by
11
* the Free Software Foundation; version 3.
13
* history-service is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU General Public License for more details.
18
* You should have received a copy of the GNU General Public License
19
* along with this program. If not, see <http://www.gnu.org/licenses/>.
22
#ifndef HISTORY_PARTICIPANT_H
23
#define HISTORY_PARTICIPANT_H
25
#include <QDBusArgument>
27
#include <QSharedPointer>
29
#include <QVariantList>
30
#include <QVariantMap>
35
class ParticipantPrivate;
39
Q_DECLARE_PRIVATE(Participant)
41
explicit Participant();
42
Participant(const QString &accountId,
43
const QString &identifier,
44
const QString &contactId = QString::null,
45
const QString &alias = QString::null,
46
const QString &avatar = QString::null,
47
const QVariantMap &detailProperties = QVariantMap());
48
Participant(const Participant &other);
49
Participant& operator=(const Participant &other);
50
virtual ~Participant();
52
QString accountId() const;
53
QString identifier() const;
54
QString contactId() const;
55
QString alias() const;
56
QString avatar() const;
57
QVariantMap detailProperties() const;
60
bool operator==(const Participant &other) const;
61
bool operator<(const Participant &other) const;
63
virtual QVariantMap properties() const;
65
static Participant fromProperties(const QVariantMap &properties);
68
QSharedPointer<ParticipantPrivate> d_ptr;
71
// define the participants list with toVariantList() and fromVariantList() helpers
72
class Participants : public QList<Participant>
75
QStringList identifiers() const;
76
static Participants fromVariant(const QVariant &variant);
77
static Participants fromVariantList(const QVariantList &list);
78
QVariantList toVariantList() const;
82
const QDBusArgument &operator>>(const QDBusArgument &argument, Participants &participants);
86
#endif // HISTORY_PARTICIPANT_H