Debian Codegraph @

tests/online-accounts-ui/mock/notification-mock.h

raw symbols SCIP
1 /*
2 * Copyright (C) 2014 Canonical Ltd.
3 *
4 * Contact: Alberto Mardegan <[email protected]>
5 *
6 * This file is part of lomiri-online-accounts-ui
7 *
8 * This program is free software: you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License version 3, as published
10 * by the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranties of
14 * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21 #ifndef MOCK_NOTIFICATiON_H
22 #define MOCK_NOTIFICATiON_H
23
24 #include "notification.h"
25
26 #include <QByteArray>
27 #include <QList>
28 #include <QPair>
29 #include <QString>
30
31 using namespace OnlineAccountsUi;
32
33 namespace OnlineAccountsUi {
34
35 typedef QPair<QString,QString> ActionPair;
36
37 class NotificationPrivate: public QObject
38 {
39 Q_OBJECT
40 Q_DECLARE_PUBLIC(Notification)
41
42 public:
43 NotificationPrivate(const QString &summary,
44 const QString &body,
45 Notification *notification);
46 ~NotificationPrivate();
47 static NotificationPrivate *mocked(Notification *n) { return n->d_ptr; }
48
49 static QList<Notification *> allNotifications;
50
51 void invokeAction(const QString &action);
52
53 Q_SIGNALS:
54 void showCalled();
55
56 public:
57 QString m_summary;
58 QString m_body;
59 QList<ActionPair> m_actions;
60 bool m_isSnapDecision;
61 mutable Notification *q_ptr;
62 };
63
64 } // namespace
65
66 #endif // MOCK_NOTIFICATiON_H