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:
|
|
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 |
|
|
103 |
/**
|
|
104 |
* @see MFSNotificationHandlerMgr::GetFolderType
|
|
105 |
*/
|
|
106 |
virtual TFSFolderType GetFolderTypeL( TFSMailMsgId& aMailbox, TFSMailMsgId* parentFolderId );
|
|
107 |
|
|
108 |
/**
|
|
109 |
* @see MFSNotificationHandlerMgr::IncreaseDialogCount
|
|
110 |
*/
|
|
111 |
void IncreaseDialogCount();
|
|
112 |
|
|
113 |
/**
|
|
114 |
* @see MFSNotificationHandlerMgr::DecreaseDialogCount
|
|
115 |
*/
|
|
116 |
void DecreaseDialogCount();
|
|
117 |
|
|
118 |
/**
|
|
119 |
* @see MFSNotificationHandlerMgr::GetDialogCount
|
|
120 |
*/
|
|
121 |
TInt GetDialogCount();
|
|
122 |
|
|
123 |
//<cmail>
|
|
124 |
/**
|
|
125 |
* @see MFSNotificationHandlerMgr::SendAppUiToBackground
|
|
126 |
*/
|
|
127 |
void SendAppUiToBackground();
|
|
128 |
|
|
129 |
/**
|
|
130 |
* @see MFSNotificationHandlerMgr::BringAppUiToForeground
|
|
131 |
*/
|
|
132 |
void BringAppUiToForeground();
|
|
133 |
//</cmail>
|
|
134 |
|
|
135 |
protected:
|
|
136 |
// From CActive
|
|
137 |
/**
|
|
138 |
* Handles an active object's request completion event
|
|
139 |
*/
|
|
140 |
void RunL();
|
|
141 |
|
|
142 |
/**
|
|
143 |
* Implements cancellation of an outstanding request
|
|
144 |
*/
|
|
145 |
void DoCancel();
|
|
146 |
|
|
147 |
private:
|
|
148 |
|
|
149 |
//<cmail>
|
|
150 |
CFSNotificationHandlerMgr(CFsEmailGlobalDialogsAppUi* aAppUi = NULL);
|
|
151 |
//</cmail>
|
|
152 |
|
|
153 |
void ConstructL();
|
|
154 |
|
|
155 |
|
|
156 |
/**
|
|
157 |
* Start to observe framework events.
|
|
158 |
*
|
|
159 |
* @since S60 ?S60_version
|
|
160 |
*/
|
|
161 |
void StartObservingL();
|
|
162 |
|
|
163 |
/**
|
|
164 |
* Stop observing framework events.
|
|
165 |
*
|
|
166 |
* @since S60 ?S60_version
|
|
167 |
*/
|
|
168 |
void StopObserving();
|
|
169 |
|
|
170 |
/**
|
|
171 |
* Function to create desired type of notification
|
|
172 |
* handler and append it into handler array.
|
|
173 |
*
|
|
174 |
* @since S60 ?S60_version
|
|
175 |
*/
|
|
176 |
void CreateAndStoreHandlerL( TInt aImplementationUid );
|
|
177 |
|
|
178 |
void CleanTempFilesIfNeededL();
|
|
179 |
|
|
180 |
private: // data
|
|
181 |
|
|
182 |
/**
|
|
183 |
* Mail client to access email framework
|
|
184 |
* Own.
|
|
185 |
*/
|
|
186 |
CFSMailClient* iMailClient;
|
|
187 |
|
|
188 |
|
|
189 |
/**
|
|
190 |
* Handlers for different types of notifications.
|
|
191 |
* Own.
|
|
192 |
*/
|
|
193 |
RPointerArray<CFSNotificationHandlerBase> iHandlers;
|
|
194 |
|
|
195 |
/**
|
|
196 |
* Object representing connection to Home Screen specific data.
|
|
197 |
* It is used to retrieve current status of Home Screen.
|
|
198 |
* Own.
|
|
199 |
*/
|
|
200 |
CFSNotificationHandlerHSConnection* iHSConnection;
|
|
201 |
|
|
202 |
/**
|
|
203 |
* AppUi class.
|
|
204 |
* Not Owned.
|
|
205 |
*/
|
|
206 |
//<cmail>
|
|
207 |
//CFsEmailGlobalDialogsAppUi& iAppUi;
|
|
208 |
CFsEmailGlobalDialogsAppUi* iAppUi;
|
|
209 |
//</cmail>
|
|
210 |
|
|
211 |
/**
|
|
212 |
* Number of active dialogs.
|
|
213 |
*/
|
|
214 |
TInt iDialogCount;
|
|
215 |
|
|
216 |
// for caching of parent folder type
|
|
217 |
TFSMailMsgId iPreviousMailbox;
|
|
218 |
TFSMailMsgId iPreviousParentFolderId;
|
|
219 |
TFSFolderType iPreviousParentFolderType;
|
|
220 |
};
|
|
221 |
|
|
222 |
#endif // C_FSNOTIFICATIONHANDLERMGRIMPL_H
|