|
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: |
|
57 |
|
58 //<cmail> aAppUi parameter no longer necessary |
|
59 static CFSNotificationHandlerMgr* NewL( CFsEmailGlobalDialogsAppUi* aAppUi = NULL ); |
|
60 static CFSNotificationHandlerMgr* NewLC( CFsEmailGlobalDialogsAppUi* aAppUi = NULL ); |
|
61 //</cmail> |
|
62 |
|
63 /** |
|
64 * Destructor. |
|
65 */ |
|
66 virtual ~CFSNotificationHandlerMgr(); |
|
67 |
|
68 |
|
69 // from base class MFSMailEventObserver |
|
70 |
|
71 /** |
|
72 * @see MFSMailEventObserver::EventL |
|
73 */ |
|
74 virtual void EventL( |
|
75 TFSMailEvent aEvent, |
|
76 TFSMailMsgId aMailbox, |
|
77 TAny* aParam1, |
|
78 TAny* aParam2, |
|
79 TAny* aParam3 ); |
|
80 |
|
81 // from base class MFSNotificationHandlerMgr |
|
82 |
|
83 /** |
|
84 * @see MFSNotificationHandlerMgr::MailClient |
|
85 */ |
|
86 virtual CFSMailClient& MailClient() const; |
|
87 |
|
88 /** |
|
89 * @see MFSNotificationHandlerMgr::HSConnection |
|
90 */ |
|
91 virtual CFSNotificationHandlerHSConnection* HSConnection() const; |
|
92 //<cmail> |
|
93 virtual void MessageQueryL( TDesC& aMailboxName, |
|
94 //</cmail> |
|
95 TRequestStatus& aStatus, |
|
96 const TDesC& aCustomMessageText, |
|
97 TFsEmailNotifierSystemMessageType aMessageType ); |
|
98 |
|
99 virtual TInt AuthenticateL( TDes& aPassword, |
|
100 TDesC& aMailboxName, |
|
101 TRequestStatus& aStatus ); |
|
102 //</cmail> |
|
103 |
|
104 /** |
|
105 * @see MFSNotificationHandlerMgr::IncreaseDialogCount |
|
106 */ |
|
107 void IncreaseDialogCount(); |
|
108 |
|
109 /** |
|
110 * @see MFSNotificationHandlerMgr::DecreaseDialogCount |
|
111 */ |
|
112 void DecreaseDialogCount(); |
|
113 |
|
114 /** |
|
115 * @see MFSNotificationHandlerMgr::GetDialogCount |
|
116 */ |
|
117 TInt GetDialogCount(); |
|
118 |
|
119 //<cmail> |
|
120 /** |
|
121 * @see MFSNotificationHandlerMgr::SendAppUiToBackground |
|
122 */ |
|
123 void SendAppUiToBackground(); |
|
124 |
|
125 /** |
|
126 * @see MFSNotificationHandlerMgr::BringAppUiToForeground |
|
127 */ |
|
128 void BringAppUiToForeground(); |
|
129 //</cmail> |
|
130 |
|
131 protected: |
|
132 // From CActive |
|
133 /** |
|
134 * Handles an active object's request completion event |
|
135 */ |
|
136 void RunL(); |
|
137 |
|
138 /** |
|
139 * Implements cancellation of an outstanding request |
|
140 */ |
|
141 void DoCancel(); |
|
142 |
|
143 private: |
|
144 |
|
145 //<cmail> |
|
146 CFSNotificationHandlerMgr(CFsEmailGlobalDialogsAppUi* aAppUi = NULL); |
|
147 //</cmail> |
|
148 |
|
149 void ConstructL(); |
|
150 |
|
151 |
|
152 /** |
|
153 * Start to observe framework events. |
|
154 * |
|
155 * @since S60 ?S60_version |
|
156 */ |
|
157 void StartObservingL(); |
|
158 |
|
159 /** |
|
160 * Stop observing framework events. |
|
161 * |
|
162 * @since S60 ?S60_version |
|
163 */ |
|
164 void StopObserving(); |
|
165 |
|
166 /** |
|
167 * Function to create desired type of notification |
|
168 * handler and append it into handler array. |
|
169 * |
|
170 * @since S60 ?S60_version |
|
171 */ |
|
172 void CreateAndStoreHandlerL( TInt aImplementationUid ); |
|
173 |
|
174 void CleanTempFilesIfNeededL(); |
|
175 |
|
176 private: // data |
|
177 |
|
178 /** |
|
179 * Mail client to access email framework |
|
180 * Own. |
|
181 */ |
|
182 CFSMailClient* iMailClient; |
|
183 |
|
184 |
|
185 /** |
|
186 * Handlers for different types of notifications. |
|
187 * Own. |
|
188 */ |
|
189 RPointerArray<CFSNotificationHandlerBase> iHandlers; |
|
190 |
|
191 /** |
|
192 * Object representing connection to Home Screen specific data. |
|
193 * It is used to retrieve current status of Home Screen. |
|
194 * Own. |
|
195 */ |
|
196 CFSNotificationHandlerHSConnection* iHSConnection; |
|
197 |
|
198 /** |
|
199 * AppUi class. |
|
200 * Not Owned. |
|
201 */ |
|
202 //<cmail> |
|
203 //CFsEmailGlobalDialogsAppUi& iAppUi; |
|
204 CFsEmailGlobalDialogsAppUi* iAppUi; |
|
205 //</cmail> |
|
206 |
|
207 /** |
|
208 * Number of active dialogs. |
|
209 */ |
|
210 TInt iDialogCount; |
|
211 |
|
212 }; |
|
213 |
|
214 #endif // C_FSNOTIFICATIONHANDLERMGRIMPL_H |