~macslow/unity/phablet-bootstrap-notification-structure

« back to all changes in this revision

Viewing changes to plugins/Notifications/action.h

  • Committer: Mirco Müller
  • Date: 2013-03-22 10:28:20 UTC
  • Revision ID: mirco.mueller@ubuntu.com-20130322102820-n5dmhx3f4rlg1p6p
Fix a bunch of MR-issues

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
// Authored by: Mirco Müller <mirco.mueller@canonical.com>
17
17
//
18
18
 
19
 
#ifndef ACTION_H_
20
 
#define ACTION_H_
 
19
#ifndef PLUGINS_NOTIFICATIONS_ACTION_H
 
20
#define PLUGINS_NOTIFICATIONS_ACTION_H
21
21
 
22
22
#include <QObject>
23
23
#include <QSharedPointer>
27
27
 
28
28
namespace unity
29
29
{
30
 
        namespace notifications
31
 
        {
32
 
                class Notification;
33
 
 
34
 
                class Action : public QObject
35
 
                {
36
 
                        Q_OBJECT
37
 
 
38
 
                        public:
39
 
                                Q_PROPERTY(QString id READ id NOTIFY idChanged);
40
 
                                Q_PROPERTY(QString label READ label NOTIFY labelChanged);
41
 
 
42
 
                                Action(QObject* = 0) : d(new Private())
43
 
                                {}
44
 
                                virtual ~Action() {};
45
 
 
46
 
                                Action(const Action& rhs) = delete;
47
 
                                Action& operator=(const Action& rhs) = delete;
48
 
 
49
 
                                virtual QString id() const;
50
 
                                virtual QString label() const;
51
 
 
52
 
                                virtual void setId(Type type);
53
 
                                virtual void setLabel(Type type);
54
 
 
55
 
                                Q_SIGNAL void idChanged(const QString&);
56
 
                                Q_SIGNAL void labelChanged(const QString&);
57
 
 
58
 
                                Q_INVOKABLE virtual void invoke() = 0;
59
 
                                Q_INVOKABLE virtual QString label() = 0; 
60
 
            
61
 
                        protected:
62
 
 
63
 
                        private:
64
 
                                struct Private
65
 
                                {
66
 
                                        QString id;
67
 
                                        QString label;
68
 
                                }* d;
69
 
 
70
 
                };
71
 
        }
72
 
}
73
 
 
74
 
#endif // ACTION_H_
 
30
namespace notifications
 
31
{
 
32
class Notification;
 
33
 
 
34
class Action : public QObject
 
35
{
 
36
        Q_OBJECT
 
37
 
 
38
        public:
 
39
                Q_PROPERTY(QString id READ id NOTIFY idChanged);
 
40
                Q_PROPERTY(QString label READ label NOTIFY labelChanged);
 
41
 
 
42
                Action(QObject* = 0) {}
 
43
                virtual ~Action();
 
44
 
 
45
                Action(const Action& rhs) = delete;
 
46
                Action& operator=(const Action& rhs) = delete;
 
47
 
 
48
                virtual QString id() const;
 
49
                virtual QString label() const;
 
50
 
 
51
                virtual void setId(Type type);
 
52
                virtual void setLabel(Type type);
 
53
 
 
54
                Q_SIGNAL void idChanged(const QString&);
 
55
                Q_SIGNAL void labelChanged(const QString&);
 
56
 
 
57
                Q_INVOKABLE virtual void invoke() = 0;
 
58
                Q_INVOKABLE virtual QString label() = 0;
 
59
};
 
60
} // namespace notifications
 
61
} // namespace unity
 
62
 
 
63
#endif // PLUGINS_NOTIFICATIONS_ACTION_H