~phablet-team/messaging-framework/prepare_for_release

« back to all changes in this revision

Viewing changes to include/messaging/qt/tp/interfaces/types.h

  • Committer: Tarmac
  • Author(s): Roberto Mier Escandon
  • Date: 2016-08-12 22:54:44 UTC
  • mfrom: (50.1.7 define-roles-interface)
  • Revision ID: tarmac-20160812225444-t28w5izwcywjbzjw
Defines BaseChannelRolesInterface, needed to set different roles for the group members.
This interface can be plugged to channels
Here is the final specification:

org.freedesktop.Telepathy.Channel.Interface.Roles

Methods:
UpdateRoles             (a{uu}:ContactRoles)    -> nothing

Signals:
RolesChanged (a{uu}:Added, a{uu}:Removed)

Properties:
Roles           a{uu} (Handle_Roles_Map)        Read only
CanUpdateRoles  b                               Read only

Types:
Channel_Roles           Flags   u
Handle_Roles_Map        Mapping a{uu}

.

Approved by Tiago Salem Herrmann, system-apps-ci-bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright © 2016 Canonical Ltd.
 
3
 *
 
4
 * This program is free software: you can redistribute it and/or modify it
 
5
 * under the terms of the GNU Lesser General Public License version 3,
 
6
 * as 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
 
 
17
#ifndef MESSAGING_QT_TP_INTERFACES_TYPES_H
 
18
#define MESSAGING_QT_TP_INTERFACES_TYPES_H
 
19
 
 
20
#include <messaging/visibility.h>
 
21
 
 
22
#include <QMap>
 
23
 
 
24
namespace messaging
 
25
{
 
26
namespace qt
 
27
{
 
28
namespace tp
 
29
{
 
30
namespace interfaces
 
31
{
 
32
 
 
33
/**
 
34
 * \struct HandleRolesMap
 
35
 * \ingroup mapping
 
36
 * \headerfile TelepathyQt/types.h <TelepathyQt/Types>
 
37
 *
 
38
 * Convertible with
 
39
 * QMap<uint, uint>, but needed to have a discrete type in the Qt type system.
 
40
 *
 
41
 * A map from channel-specific handles to their owners.
 
42
 */
 
43
struct MESSAGING_FW_PUBLIC HandleRolesMap : public QMap<uint, uint>
 
44
{
 
45
    inline HandleRolesMap() : QMap<uint, uint>() {}
 
46
    inline HandleRolesMap(const QMap<uint, uint>& a) : QMap<uint, uint>(a) {}
 
47
 
 
48
    inline HandleRolesMap& operator=(const QMap<uint, uint>& a)
 
49
    {
 
50
        *(static_cast<QMap<uint, uint>*>(this)) = a;
 
51
        return *this;
 
52
    }
 
53
};
 
54
 
 
55
}
 
56
}
 
57
}
 
58
}
 
59
 
 
60
Q_DECLARE_METATYPE(messaging::qt::tp::interfaces::HandleRolesMap)
 
61
 
 
62
#endif // MESSAGING_QT_TP_INTERFACES_TYPES_H
 
63