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 {
33 Q_PROPERTY(QString summary READ getSummary WRITE setSummary NOTIFY summaryChanged)
34 Q_PROPERTY(QString body READ getBody WRITE setBody NOTIFY bodyChanged)
35 Q_PROPERTY(int nid READ getID WRITE setID NOTIFY idChanged)
36 Q_PROPERTY(int value READ getValue WRITE setValue NOTIFY valueChanged)
37 Q_PROPERTY(QString icon READ getIcon WRITE setIcon NOTIFY iconChanged)
38 Q_PROPERTY(QString secondaryIcon READ getSecondaryIcon WRITE setSecondaryIcon NOTIFY secondaryIconChanged)
39 Q_PROPERTY(Type type READ getType WRITE setType NOTIFY typeChanged)
40 Q_PROPERTY(QStringList rawActions READ rawActions WRITE setActions)
41 Q_PROPERTY(ActionModel* actions READ getActions NOTIFY actionsChanged)
42 Q_PROPERTY(QVariantMap hints READ getHints WRITE setHints NOTIFY hintsChanged)
43 Q_PROPERTY(bool fullscreen READ fullscreen WRITE setFullscreen NOTIFY fullscreenChanged) // only in mock
46 QScopedPointer<MockNotificationPrivate> p;
49 enum Urgency { Low, Normal, Critical };
51 enum Type { PlaceHolder, Confirmation, Ephemeral, Interactive, SnapDecision };
55 void summaryChanged(const QString &summary);
56 void bodyChanged(const QString &body);
57 void idChanged(const int id);
58 void valueChanged(int value);
59 void iconChanged(const QString &icon);
60 void secondaryIconChanged(const QString &secondaryIcon);
61 void typeChanged(Type type);
62 void actionsChanged(const QStringList &actions);
63 void hintsChanged(const QVariantMap& hints);
65 void dataChanged(int nid);
66 void completed(int nid);
67 void actionInvoked(const QString &action);
69 void fullscreenChanged(bool fullscreen);
72 MockNotification(QObject *parent=nullptr);
73 virtual ~MockNotification();
75 QString getSummary() const;
76 void setSummary(const QString &summary);
77 QString getBody() const;
78 void setBody(const QString &body);
80 void setID(const int id);
82 void setValue(int value);
83 QString getIcon() const;
84 void setIcon(const QString &icon);
85 QString getSecondaryIcon() const;
86 void setSecondaryIcon(const QString &secondaryIcon);
88 void setType(Type type);
89 ActionModel* getActions() const;
90 QStringList rawActions() const;
91 void setActions(const QStringList &actions);
92 QVariantMap getHints() const;
93 void setHints(const QVariantMap& hints);
94 bool fullscreen() const;
95 void setFullscreen(bool fullscreen);
97 Q_INVOKABLE void invokeAction(const QString &action);
98 Q_INVOKABLE void close();
101#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