~unity-api-team/unity-notifications/trunk

« back to all changes in this revision

Viewing changes to include/DBusTypes.h

  • Committer: CI Train Bot
  • Author(s): Pete Woods
  • Date: 2015-06-23 15:50:11 UTC
  • mfrom: (224.1.8 add-dbus-tests)
  • Revision ID: ci-train-bot@canonical.com-20150623155011-bnt9ubw5elnay015
Add end to end DBus tests and use XML introspection data
Approved by: Charles Kerr

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2015 Canonical, Ltd.
 
3
 *
 
4
 * This program is free software: you can redistribute it and/or modify it
 
5
 * under the terms of the GNU General Public License version 3, as published
 
6
 * by the Free Software Foundation.
 
7
 *
 
8
 * This library is distributed in the hope that it will be useful, but WITHOUT
 
9
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 
10
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 
11
 * details.
 
12
 *
 
13
 * You should have received a copy of the GNU General Public License
 
14
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
15
 */
 
16
 
 
17
#ifndef DBUSTYPES_HPP_
 
18
#define DBUSTYPES_HPP_
 
19
 
 
20
#include <QDebug>
 
21
#include <QDBusArgument>
 
22
#include <QString>
 
23
#include <QVariantMap>
 
24
 
 
25
struct NotificationData
 
26
{
 
27
    QString appName;
 
28
    quint32 id;
 
29
    QString appIcon;
 
30
    QString summary;
 
31
    QString body;
 
32
    QList<QString> actions;
 
33
    QVariantMap hints;
 
34
    qint32 expireTimeout;
 
35
 
 
36
    NotificationData& setAppName(const QString& appName_);
 
37
 
 
38
    NotificationData& setId(quint32 id_);
 
39
 
 
40
    NotificationData& setAppIcon(const QString& appIcon_);
 
41
 
 
42
    NotificationData& setSummary(const QString& summary_);
 
43
 
 
44
    NotificationData& setBody(const QString& body_);
 
45
 
 
46
    NotificationData& setActions(const QList<QString>& actions_);
 
47
 
 
48
    NotificationData& setHints(const QVariantMap& hints_);
 
49
 
 
50
    NotificationData& setExpireTimeout(quint32 expireTimeout_);
 
51
 
 
52
    NotificationData& operator=(const NotificationData& other);
 
53
 
 
54
    bool operator==(const NotificationData& other) const;
 
55
};
 
56
 
 
57
typedef QList<NotificationData> NotificationDataList;
 
58
 
 
59
QDBusArgument &operator<<(QDBusArgument &, const NotificationData &);
 
60
const QDBusArgument &operator>>(const QDBusArgument &, NotificationData &);
 
61
 
 
62
namespace DBusTypes {
 
63
    void registerNotificationMetaTypes();
 
64
}
 
65
 
 
66
Q_DECLARE_METATYPE(NotificationData)
 
67
Q_DECLARE_METATYPE(NotificationDataList)
 
68
 
 
69
#endif