use system palete colors
[makneto-zunavac1.git] / src / ui-mobile / notification-item.h
blob42fd3b7d267f40235a35ec44fc32509695288681
1 /*
2 * Copyright (C) 2011 Lukáš Karas <lukas.karas@centrum.cz>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the
16 * Free Software Foundation, Inc.,
17 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 #include <QObject>
21 #include <QVariant>
22 #include <QTimer>
24 #include "../libnotify-qt/Notification.h"
25 #include "../backend/session.h"
27 #ifndef NOTIFICATIONITEM_H
28 #define NOTIFICATIONITEM_H
30 class NotificationItem : public QObject {
32 Q_OBJECT
33 Q_DISABLE_COPY(NotificationItem)
34 Q_ENUMS(NotificationType)
36 public:
37 enum NotificationType {
38 ChatType,
39 AudioCallType,
40 VideoCallType,
41 CallErrorType,
42 SendMessageErrorType
45 NotificationItem(int id, MaknetoBackend::Session *session, NotificationType type, QString msg = QString());
46 virtual ~NotificationItem();
48 int getId();
49 QVariant data(int role);
50 QString getTitle();
51 NotificationType getType();
52 MaknetoBackend::Session *getSession();
54 Q_SIGNALS:
55 void acceptNotification(int id);
56 void declineNotification(int id);
57 void notificationExpired(int id);
59 public
60 Q_SLOTS:
61 void onNotificationAction(const QString &);
62 void onNotificationClosed(quint32);
63 void onExpire();
64 void onCallEnded(const QString &);
66 private:
67 int id;
68 NotificationType type;
69 QString message;
70 MaknetoBackend::Session *_session;
71 Notification *_notification;
72 QTimer *_expireTimer;
75 #endif /* NOTIFICATIONITEM_H */