1 /* |
|
2 * Copyright (c) 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __MCSREQUESTNOTIFICATION_H_ |
|
20 #define __MCSREQUESTNOTIFICATION_H_ |
|
21 |
|
22 #include <e32base.h> |
|
23 #include "mcsmenunotifier.h" |
|
24 |
|
25 class MMCSCallback; |
|
26 |
|
27 /** |
|
28 * This class implements MCS SAPI core logic for Request Notification async requests. |
|
29 * |
|
30 */ |
|
31 class CMCSReqNotification: public CActive |
|
32 { |
|
33 public: |
|
34 |
|
35 /** |
|
36 * Two-phased constructor. |
|
37 * @param aMCS MenuContentService object. |
|
38 * @param aCallback Callback Object for Change notification. |
|
39 * @return CMCSRunningApps reference. |
|
40 */ |
|
41 static CMCSReqNotification* NewL(RMenu& aMCS); |
|
42 |
|
43 /** |
|
44 * Destructor. |
|
45 */ |
|
46 virtual ~CMCSReqNotification(); |
|
47 |
|
48 private: |
|
49 |
|
50 /** |
|
51 * Default constructor. |
|
52 */ |
|
53 CMCSReqNotification(); |
|
54 |
|
55 /** |
|
56 * ConstructL |
|
57 * @param aMCS MenuContentService object. |
|
58 */ |
|
59 void ConstructL(RMenu& aMCS); |
|
60 |
|
61 /** |
|
62 * Inherited from CActive class |
|
63 */ |
|
64 virtual void DoCancel(); |
|
65 |
|
66 /** |
|
67 * Inherited from CActive class |
|
68 */ |
|
69 virtual void RunL(); |
|
70 |
|
71 /** |
|
72 * Activates the request and call SetActive() function |
|
73 */ |
|
74 void ActivateRequest(TInt aReason); |
|
75 |
|
76 public : |
|
77 |
|
78 /** |
|
79 * Starts the notification of events. |
|
80 * @param aFolderId folder id to observe the events. |
|
81 * @param aEvent events to notificy. |
|
82 */ |
|
83 void StartNotificationL(TInt aFolderId, TInt aEvent, MMCSCallback* aCallback ); |
|
84 |
|
85 /** |
|
86 * Stops the registered notifcation. |
|
87 */ |
|
88 void StopNotificationL(); |
|
89 |
|
90 private: |
|
91 |
|
92 RMenuNotifier iNotifier; |
|
93 /** Folder it to watch owned. */ |
|
94 TInt iFolderId; |
|
95 /** Events to Notifiy. owned */ |
|
96 TInt iEvents; |
|
97 /** Callback Object. Not owned. */ |
|
98 MMCSCallback* iCallback; |
|
99 /** notification watch owned */ |
|
100 TBool iIsNotification; |
|
101 /** iMCS reference. Not owned. */ |
|
102 RMenu iMCS; |
|
103 |
|
104 }; |
|
105 |
|
106 #endif /*__MCSREQUESTNOTIFICATION_H_*/ |
|