~macslow/unity/phablet-bootstrap-notifications

« back to all changes in this revision

Viewing changes to plugins/NotificationsBackend/notification.h

  • Committer: Mirco Müller
  • Date: 2013-03-20 14:53:07 UTC
  • Revision ID: mirco.mueller@canonical.com-20130320145307-3a3ub1ydhsg5m1gp
Fixing compile-errors...

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
// along with this program.  If not, see <http://www.gnu.org/licenses/>.
15
15
//
16
16
 
17
 
#ifndef NOSD_NOTIFICATION_H_
18
 
#define NOSD_NOTIFICATION_H_
 
17
#ifndef NOTIFICATION_H_
 
18
#define NOTIFICATION_H_
19
19
 
20
20
#include <QString>
21
21
#include <QStringList>
22
22
#include <QImage>
23
23
#include <QQmlProperty>
24
24
 
 
25
#include "action.h"
 
26
 
25
27
namespace unity
26
28
{
27
29
        namespace notifications
28
30
        {
29
 
                enum class Urgency
 
31
                enum Urgency
30
32
                {
31
33
                        low,
32
34
                        normal,
33
35
                        critical
34
36
                };
35
37
 
36
 
                enum class Type
 
38
                enum Type
37
39
                {
38
40
                        confirmation,
39
41
                        ephemeral,
42
44
                        none
43
45
                };
44
46
 
45
 
                enum class Hint // there's no "append" hint - it should be handled in NotificationSource
 
47
                enum Hint // there's no "append" hint - it should be handled in NotificationSource
46
48
                {
47
49
                        button_tint = 1 << 0,
48
50
                        synchronous = 1 << 1,
49
51
                        icon_only = 1 << 2
50
52
                };
51
53
 
 
54
                class Action;
 
55
 
52
56
                class Notification : public QObject
53
57
                {
54
58
                        Q_OBJECT
89
93
                                virtual const QImage& icon() const;
90
94
                                virtual const QImage& secondaryIcon() const;
91
95
                                virtual const QVector<QSharedPointer<Action>>& actions() const;
92
 
                                virtual const QQmlProperty<Action>& actionsQmlList() const;
 
96
                                virtual const QQmlListProperty<Action>& actionsQmlList() const;
93
97
                                virtual Hints hints() const;
94
98
 
95
99
                                virtual void setType(Type type);
99
103
                                virtual void setValue(const int value);
100
104
                                virtual void setIcon(const QImage& icon);
101
105
                                virtual void setSecondaryIcon(const QImage& secondaryIcon);
102
 
                                virtual void setActions(const QVector<QSharedPointer<Actions>>& actions);
 
106
                                virtual void setActions(const QVector<QSharedPointer<Action>>& actions);
103
107
                                virtual void setHints(Hints hints);
104
108
 
105
109
                                Q_SLOT virtual void onHovered(bool hovered); // stop/start timeout timer
136
140
                };
137
141
 
138
142
                Q_DECLARE_OPERATORS_FOR_FLAGS(Notification::Hints)
139
 
                Q_FLAGS(Notification::Hints)
 
143
                Q_FLAGS(Notification::Hints);
140
144
        }
141
145
}
142
146
 
143
 
#endif // NOSD_NOTIFICATION_H_
 
147
#endif // NOTIFICATION_H_