author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 13 Oct 2010 14:11:15 +0300 | |
branch | RCL_3 |
changeset 80 | 726fba06891a |
parent 64 | 3533d4323edc |
permissions | -rw-r--r-- |
64 | 1 |
/* |
2 |
* Copyright (c) 2007-2008 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: Declaration of notification handler manager implementation |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
||
20 |
#ifndef C_FSNOTIFICATIONHANDLERMGRIMPL_H |
|
21 |
#define C_FSNOTIFICATIONHANDLERMGRIMPL_H |
|
22 |
||
23 |
#include <e32base.h> |
|
24 |
||
25 |
//<cmail> |
|
26 |
#include "cfsmailcommon.h" |
|
27 |
#include "mfsmaileventobserver.h" |
|
28 |
//</cmail> |
|
29 |
||
30 |
#include "fsnotificationhandlermgr.h" |
|
31 |
||
32 |
class CFSMailClient; |
|
33 |
class CFSNotificationHandlerBase; |
|
34 |
class CFsEmailGlobalDialogsAppUi; |
|
35 |
||
36 |
/** |
|
37 |
* Class for managing notification showing. |
|
38 |
* |
|
39 |
* Class that manages notification showing by managing the |
|
40 |
* notification handlers which do the actual notification showing. |
|
41 |
* Framework events are observed in this class and they are |
|
42 |
* then directed to the notification handlers. |
|
43 |
* |
|
44 |
* @code |
|
45 |
* ?good_class_usage_example(s) |
|
46 |
* @endcode |
|
47 |
* |
|
48 |
* @lib ?library |
|
49 |
* @since S60 ?S60_version *** for example, S60 v3.0 |
|
50 |
*/ |
|
51 |
class CFSNotificationHandlerMgr : |
|
52 |
public CActive, |
|
53 |
public MFSNotificationHandlerMgr, |
|
54 |
public MFSMailEventObserver |
|
55 |
{ |
|
56 |
public: |
|
80
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
57 |
|
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
58 |
enum TState |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
59 |
{ |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
60 |
EPrepareInitialization, |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
61 |
EInitializeMailIconHandler, |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
62 |
EInitializeLedHandler, |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
63 |
#ifndef __WINS__ |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
64 |
ESoundHandler, |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
65 |
#endif |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
66 |
EInitializeMtmHandler, |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
67 |
EInitializeOutofMemoryHandler, |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
68 |
EInitializeAuthenticationHandler, |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
69 |
EInitializeMessageQueryHandlerUid, |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
70 |
EWaitForPluginsReady, |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
71 |
EInitializeCMailCpsHandlerUid, |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
72 |
EFinish |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
73 |
}; |
64 | 74 |
|
75 |
//<cmail> aAppUi parameter no longer necessary |
|
76 |
static CFSNotificationHandlerMgr* NewL( CFsEmailGlobalDialogsAppUi* aAppUi = NULL ); |
|
77 |
static CFSNotificationHandlerMgr* NewLC( CFsEmailGlobalDialogsAppUi* aAppUi = NULL ); |
|
78 |
//</cmail> |
|
79 |
||
80 |
/** |
|
81 |
* Destructor. |
|
82 |
*/ |
|
83 |
virtual ~CFSNotificationHandlerMgr(); |
|
84 |
||
85 |
||
86 |
// from base class MFSMailEventObserver |
|
87 |
||
88 |
/** |
|
89 |
* @see MFSMailEventObserver::EventL |
|
90 |
*/ |
|
91 |
virtual void EventL( |
|
92 |
TFSMailEvent aEvent, |
|
93 |
TFSMailMsgId aMailbox, |
|
94 |
TAny* aParam1, |
|
95 |
TAny* aParam2, |
|
96 |
TAny* aParam3 ); |
|
97 |
||
98 |
// from base class MFSNotificationHandlerMgr |
|
99 |
||
100 |
/** |
|
101 |
* @see MFSNotificationHandlerMgr::MailClient |
|
102 |
*/ |
|
103 |
virtual CFSMailClient& MailClient() const; |
|
104 |
||
105 |
/** |
|
106 |
* @see MFSNotificationHandlerMgr::HSConnection |
|
107 |
*/ |
|
108 |
virtual CFSNotificationHandlerHSConnection* HSConnection() const; |
|
109 |
//<cmail> |
|
110 |
virtual void MessageQueryL( TDesC& aMailboxName, |
|
111 |
//</cmail> |
|
112 |
TRequestStatus& aStatus, |
|
113 |
const TDesC& aCustomMessageText, |
|
114 |
TFsEmailNotifierSystemMessageType aMessageType ); |
|
115 |
||
116 |
virtual TInt AuthenticateL( TDes& aPassword, |
|
117 |
TDesC& aMailboxName, |
|
118 |
TRequestStatus& aStatus ); |
|
119 |
||
120 |
/** |
|
121 |
* @see MFSNotificationHandlerMgr::GetFolderType |
|
122 |
*/ |
|
123 |
virtual TFSFolderType GetFolderTypeL( TFSMailMsgId& aMailbox, TFSMailMsgId* parentFolderId ); |
|
124 |
||
125 |
/** |
|
126 |
* @see MFSNotificationHandlerMgr::IncreaseDialogCount |
|
127 |
*/ |
|
128 |
void IncreaseDialogCount(); |
|
129 |
||
130 |
/** |
|
131 |
* @see MFSNotificationHandlerMgr::DecreaseDialogCount |
|
132 |
*/ |
|
133 |
void DecreaseDialogCount(); |
|
134 |
||
135 |
/** |
|
136 |
* @see MFSNotificationHandlerMgr::GetDialogCount |
|
137 |
*/ |
|
138 |
TInt GetDialogCount(); |
|
139 |
||
140 |
//<cmail> |
|
141 |
/** |
|
142 |
* @see MFSNotificationHandlerMgr::SendAppUiToBackground |
|
143 |
*/ |
|
144 |
void SendAppUiToBackground(); |
|
145 |
||
146 |
/** |
|
147 |
* @see MFSNotificationHandlerMgr::BringAppUiToForeground |
|
148 |
*/ |
|
149 |
void BringAppUiToForeground(); |
|
150 |
//</cmail> |
|
151 |
||
152 |
protected: |
|
153 |
// From CActive |
|
154 |
/** |
|
155 |
* Handles an active object's request completion event |
|
156 |
*/ |
|
157 |
void RunL(); |
|
158 |
||
159 |
/** |
|
160 |
* Implements cancellation of an outstanding request |
|
161 |
*/ |
|
162 |
void DoCancel(); |
|
163 |
||
164 |
private: |
|
165 |
||
166 |
//<cmail> |
|
167 |
CFSNotificationHandlerMgr(CFsEmailGlobalDialogsAppUi* aAppUi = NULL); |
|
168 |
//</cmail> |
|
169 |
||
170 |
void ConstructL(); |
|
171 |
||
172 |
||
173 |
/** |
|
174 |
* Start to observe framework events. |
|
175 |
* |
|
176 |
* @since S60 ?S60_version |
|
177 |
*/ |
|
178 |
void StartObservingL(); |
|
179 |
||
180 |
/** |
|
181 |
* Stop observing framework events. |
|
182 |
* |
|
183 |
* @since S60 ?S60_version |
|
184 |
*/ |
|
185 |
void StopObserving(); |
|
186 |
||
187 |
/** |
|
188 |
* Function to create desired type of notification |
|
189 |
* handler and append it into handler array. |
|
190 |
* |
|
191 |
* @since S60 ?S60_version |
|
192 |
*/ |
|
193 |
void CreateAndStoreHandlerL( TInt aImplementationUid ); |
|
194 |
||
195 |
void CleanTempFilesIfNeededL(); |
|
196 |
||
197 |
private: // data |
|
198 |
||
199 |
/** |
|
200 |
* Mail client to access email framework |
|
201 |
* Own. |
|
202 |
*/ |
|
203 |
CFSMailClient* iMailClient; |
|
204 |
||
205 |
||
206 |
/** |
|
207 |
* Handlers for different types of notifications. |
|
208 |
* Own. |
|
209 |
*/ |
|
210 |
RPointerArray<CFSNotificationHandlerBase> iHandlers; |
|
211 |
||
212 |
/** |
|
213 |
* Object representing connection to Home Screen specific data. |
|
214 |
* It is used to retrieve current status of Home Screen. |
|
215 |
* Own. |
|
216 |
*/ |
|
217 |
CFSNotificationHandlerHSConnection* iHSConnection; |
|
218 |
||
219 |
/** |
|
220 |
* AppUi class. |
|
221 |
* Not Owned. |
|
222 |
*/ |
|
223 |
//<cmail> |
|
224 |
//CFsEmailGlobalDialogsAppUi& iAppUi; |
|
225 |
CFsEmailGlobalDialogsAppUi* iAppUi; |
|
226 |
//</cmail> |
|
227 |
||
228 |
/** |
|
229 |
* Number of active dialogs. |
|
230 |
*/ |
|
231 |
TInt iDialogCount; |
|
232 |
||
233 |
// for caching of parent folder type |
|
234 |
TFSMailMsgId iPreviousMailbox; |
|
235 |
TFSMailMsgId iPreviousParentFolderId; |
|
236 |
TFSFolderType iPreviousParentFolderType; |
|
80
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
237 |
|
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
238 |
RTimer iTimer; |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
239 |
|
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
240 |
TState iState; |
64 | 241 |
}; |
242 |
||
243 |
#endif // C_FSNOTIFICATIONHANDLERMGRIMPL_H |