|
1 /* |
|
2 * Copyright (c) 2004 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: Defines class CNcnNotifier. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CNCNNOTIFIER_H |
|
21 #define CNCNNOTIFIER_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include "MNcnNotifier.h" |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class MNcnUI; |
|
29 class CNcnModelBase; |
|
30 |
|
31 // CLASS DECLARATION |
|
32 |
|
33 /** |
|
34 * Ncn Notifier implementation. |
|
35 */ |
|
36 class CNcnNotifier : public CBase, public MNcnNotifier |
|
37 { |
|
38 private: // Constructors and destructor |
|
39 |
|
40 /** |
|
41 * Constructor. |
|
42 * @param aNcnUI Ncn UI reference. |
|
43 */ |
|
44 CNcnNotifier( |
|
45 MNcnUI& aNcnUI, |
|
46 CNcnModelBase& iModel ); |
|
47 |
|
48 /** |
|
49 * 2nd. phase constructor. |
|
50 */ |
|
51 void ConstructL(); |
|
52 |
|
53 public: // Constructors and destructor |
|
54 |
|
55 /** |
|
56 * Destructor. |
|
57 */ |
|
58 virtual ~CNcnNotifier(); |
|
59 |
|
60 /** |
|
61 * Static factory method. |
|
62 * @param aNcnUI Ncn UI reference. |
|
63 */ |
|
64 static CNcnNotifier* NewL( |
|
65 MNcnUI& aNcnUI, |
|
66 CNcnModelBase& iModel ); |
|
67 |
|
68 public: // From MNcnNotifier |
|
69 |
|
70 void SetNotification( |
|
71 TNcnNotificationType aNotificationType, |
|
72 TUint aAmount, |
|
73 TBool aIcon = ETrue, |
|
74 TBool aTone = ETrue, |
|
75 TBool aNote = ETrue ); |
|
76 |
|
77 TUint NotificationAmount( TNcnNotificationType aNotificationType ); |
|
78 |
|
79 |
|
80 private: // New method |
|
81 |
|
82 /** |
|
83 * Handles notification change for specific notification type. |
|
84 * @param aNotifcationType The notification type. |
|
85 * @param aPreviousAmount Amount in previous notification. |
|
86 * @param aCurrentAmount Current notification amount. |
|
87 * @param aIcon Notifies with icon |
|
88 * @param aTone Notifies with tone |
|
89 * @param aNote Notifies with note |
|
90 */ |
|
91 void HandleNotificationChange( |
|
92 TNcnNotificationType aNotificationType, |
|
93 TUint aPreviousAmount, |
|
94 TUint aCurrentAmount, |
|
95 TBool aIcon, |
|
96 TBool aTone, |
|
97 TBool aNote ); |
|
98 |
|
99 /** |
|
100 * Handles class0 message notification change. |
|
101 * @param aPreviousAmount Amount in previous notification. |
|
102 * @param aCurrentAmount Current notification amount. |
|
103 */ |
|
104 void HandleClass0MessageNotificationChange( |
|
105 TUint aPreviousAmount, |
|
106 TUint aCurrentAmount ); |
|
107 |
|
108 /** |
|
109 * Handles message notification change. |
|
110 * @param aPreviousAmount Amount in previous notification. |
|
111 * @param aCurrentAmount Current notification amount. |
|
112 */ |
|
113 void HandleMessageNotificationChange( |
|
114 TUint aPreviousAmount, |
|
115 TUint aCurrentAmount ); |
|
116 |
|
117 /** |
|
118 * Handles voice mail notification change. |
|
119 * @param aPreviousAmount Amount in previous notification. |
|
120 * @param aCurrentAmount Current notification amount. |
|
121 */ |
|
122 void HandleVoiceMailNotificationChange( |
|
123 TUint aPreviousAmount, |
|
124 TUint aCurrentAmount ); |
|
125 |
|
126 /** |
|
127 * Handles email notification change. |
|
128 * @param aPreviousAmount Amount in previous notification. |
|
129 * @param aCurrentAmount Current notification amount. |
|
130 */ |
|
131 void HandleEMailNotificationChange( |
|
132 TUint aPreviousAmount, |
|
133 TUint aCurrentAmount, |
|
134 TBool aIcon, |
|
135 TBool aTone ); |
|
136 |
|
137 /** |
|
138 * Handles audio message notification change. |
|
139 * @param aPreviousAmount Amount in previous notification. |
|
140 * @param aCurrentAmount Current notification amount. |
|
141 */ |
|
142 void HandleAudioMessageNotificationChange( |
|
143 TUint aPreviousAmount, |
|
144 TUint aCurrentAmount ); |
|
145 |
|
146 /** |
|
147 * Updates the email icon based based on amount of |
|
148 * waiting email messages. |
|
149 * @param aAmount Amount of waiting email messages. |
|
150 */ |
|
151 void UpdateEmailIcon( TInt aAmount ); |
|
152 |
|
153 /** |
|
154 * Updates the message icon based on amount of |
|
155 * new messages. |
|
156 * @param aAmount Amount of new messages. |
|
157 */ |
|
158 void UpdateMessageIcon( TInt aAmount ); |
|
159 |
|
160 /** |
|
161 * Checks if the soft notification should be displayed or not. |
|
162 * @param aNotificationType Type of the notification |
|
163 * @return EFalse if soft notification should not be displayed, |
|
164 * default value is ETrue |
|
165 */ |
|
166 TBool CheckSNStatusL( const TNcnNotificationType& aNotificationType ) const; |
|
167 |
|
168 /** |
|
169 * Checks if the Display Lights should be Set or not. |
|
170 * @param aNotificationType Type of the notification |
|
171 * @return EFalse if soft notification should not be displayed, |
|
172 * default value is ETrue |
|
173 */ |
|
174 TBool CheckDLStatus( const TNcnNotificationType& aNotificationType ) const; |
|
175 |
|
176 private: // Data |
|
177 |
|
178 // ncn UI reference |
|
179 MNcnUI& iNcnUI; |
|
180 |
|
181 // ncn model reference |
|
182 CNcnModelBase& iModel; |
|
183 |
|
184 // notification amounts |
|
185 TUint iNotificationAmounts[ ENcnNoNotification ]; |
|
186 //Display Light Configuration |
|
187 TInt iDisplayLightstate; |
|
188 |
|
189 }; |
|
190 |
|
191 #endif // CNCNNOTIFIER_H |
|
192 |
|
193 // End of File |