|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Message notifier main class. |
|
15 * Handles calling notifications and inidcations. |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef MSGNOTIFIER_H |
|
20 #define MSGNOTIFIER_H |
|
21 |
|
22 // SYSTEM INCLUDES |
|
23 #include <QObject> |
|
24 #include <QString> |
|
25 #include <QQueue> |
|
26 |
|
27 // CLASS DECLARATION |
|
28 class MsgNotifierPrivate; |
|
29 class MsgSimNumDetector; |
|
30 |
|
31 /** |
|
32 * Stores the data required for notification. |
|
33 * Its used to pass information from |
|
34 * private class to qt - class. |
|
35 */ |
|
36 class NotificationData |
|
37 { |
|
38 public: |
|
39 /** |
|
40 * constrcutor |
|
41 */ |
|
42 NotificationData(): |
|
43 mConversationId(-1),mMsgType(-1) |
|
44 {}; |
|
45 /** |
|
46 * Conversation id |
|
47 */ |
|
48 int mConversationId; |
|
49 |
|
50 /** |
|
51 * Message type |
|
52 */ |
|
53 int mMsgType; |
|
54 |
|
55 /** |
|
56 * Description |
|
57 */ |
|
58 QString mDescription; |
|
59 |
|
60 /** |
|
61 * First name |
|
62 */ |
|
63 QString mFirstName; |
|
64 |
|
65 /** |
|
66 * Last name |
|
67 */ |
|
68 QString mLastName; |
|
69 |
|
70 /** |
|
71 * Contact Number |
|
72 */ |
|
73 QString mContactNum; |
|
74 |
|
75 }; |
|
76 |
|
77 |
|
78 class MsgNotifier : public QObject |
|
79 { |
|
80 Q_OBJECT |
|
81 |
|
82 public: |
|
83 /** |
|
84 * Constructor |
|
85 */ |
|
86 MsgNotifier(QObject* parent = 0); |
|
87 |
|
88 /** |
|
89 * Destructor |
|
90 */ |
|
91 ~MsgNotifier(); |
|
92 |
|
93 public: |
|
94 /** |
|
95 * displayNewMessageNotification |
|
96 * Calls the notificaiton display frame work |
|
97 * for displaying the new message notification. |
|
98 */ |
|
99 void displayNewMessageNotification(NotificationData& data); |
|
100 |
|
101 |
|
102 /** |
|
103 * updateIndications |
|
104 * Activate/Deactivate message indications based on unread message count. |
|
105 * if unreadCount is zero then deactivate else activate. |
|
106 * @param unreadCount unread count. |
|
107 */ |
|
108 void updateIndications(int unreadCount); |
|
109 |
|
110 private: |
|
111 |
|
112 /** |
|
113 * Object of private implementation. |
|
114 * Owned. |
|
115 */ |
|
116 MsgNotifierPrivate* d_ptr; |
|
117 |
|
118 /** |
|
119 * Sim settings handler |
|
120 */ |
|
121 MsgSimNumDetector* mSimHandler; |
|
122 }; |
|
123 |
|
124 #endif // MSGNOTIFIER_H |
|
125 |
|
126 //EOF |