2 * Copyright 2015 Canonical Ltd.
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 as published by
6 * the Free Software Foundation; version 3.
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.
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/>.
17 * Mirco Mueller <mirco.mueller@canonical.com>
20#ifndef MOCK_NOTIFICATION_H
21#define MOCK_NOTIFICATION_H
23#include "MockActionModel.h"
27#include <QScopedPointer>
29struct MockNotificationPrivate;
31class MockNotification : public QObject {
34 Q_PROPERTY(QString summary READ getSummary WRITE setSummary NOTIFY summaryChanged)
35 Q_PROPERTY(QString body READ getBody WRITE setBody NOTIFY bodyChanged)
36 Q_PROPERTY(int nid READ getID WRITE setID NOTIFY idChanged)
37 Q_PROPERTY(int value READ getValue WRITE setValue NOTIFY valueChanged)
38 Q_PROPERTY(QString icon READ getIcon WRITE setIcon NOTIFY iconChanged)
39 Q_PROPERTY(QString secondaryIcon READ getSecondaryIcon WRITE setSecondaryIcon NOTIFY secondaryIconChanged)
40 Q_PROPERTY(Type type READ getType WRITE setType NOTIFY typeChanged)
41 Q_PROPERTY(QStringList rawActions READ rawActions WRITE setActions)
42 Q_PROPERTY(ActionModel* actions READ getActions NOTIFY actionsChanged)
43 Q_PROPERTY(QVariantMap hints READ getHints WRITE setHints NOTIFY hintsChanged)
46 QScopedPointer<MockNotificationPrivate> p;
49 enum Urgency { Low, Normal, Critical };
50 enum Type { PlaceHolder, Confirmation, Ephemeral, Interactive, SnapDecision };
53 void summaryChanged(const QString &summary);
54 void bodyChanged(const QString &body);
55 void idChanged(const int id);
56 void valueChanged(int value);
57 void iconChanged(const QString &icon);
58 void secondaryIconChanged(const QString &secondaryIcon);
59 void typeChanged(Type type);
60 void actionsChanged(const QStringList &actions);
61 void hintsChanged(const QVariantMap& hints);
63 void dataChanged(int nid);
64 void completed(int nid);
65 void actionInvoked(const QString &action);
68 MockNotification(QObject *parent=nullptr);
69 virtual ~MockNotification();
71 QString getSummary() const;
72 void setSummary(const QString &summary);
73 QString getBody() const;
74 void setBody(const QString &body);
76 void setID(const int id);
78 void setValue(int value);
79 QString getIcon() const;
80 void setIcon(const QString &icon);
81 QString getSecondaryIcon() const;
82 void setSecondaryIcon(const QString &secondaryIcon);
84 void setType(Type type);
85 ActionModel* getActions() const;
86 QStringList rawActions() const;
87 void setActions(const QStringList &actions);
88 QVariantMap getHints() const;
89 void setHints(const QVariantMap& hints);
91 Q_INVOKABLE void invokeAction(const QString &action);
92 Q_INVOKABLE void close();
95#endif // MOCK_NOTIFICATION_H
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list