|
1 /* |
|
2 * Copyright (c) 2009 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 #ifndef __MCSPLUGINWATCHER_H |
|
19 #define __MCSPLUGINWATCHER_H |
|
20 |
|
21 #include <e32base.h> |
|
22 |
|
23 class CMenuOperation; |
|
24 class CMCSPluginEngine; |
|
25 |
|
26 /** |
|
27 * @ingroup group_mcsplugin |
|
28 * |
|
29 * MCS Plugin Watcher Observer |
|
30 * |
|
31 * @since S60 9.1 |
|
32 */ |
|
33 class MMCSPluginWatcherObserver |
|
34 { |
|
35 public: |
|
36 /** |
|
37 * HandleNotifyL |
|
38 */ |
|
39 virtual void HandleNotifyL() = 0; |
|
40 }; |
|
41 |
|
42 /** |
|
43 * @ingroup group_mcsplugin |
|
44 * |
|
45 * This class implements MCS menu action watcher for async calls. |
|
46 * |
|
47 * @since S60 9.1 |
|
48 */ |
|
49 class CMCSPluginWatcher: public CActive |
|
50 { |
|
51 public: |
|
52 |
|
53 /** |
|
54 * enum Type |
|
55 */ |
|
56 enum Type |
|
57 { |
|
58 EOperation, |
|
59 ENotify |
|
60 }; |
|
61 |
|
62 /** |
|
63 * Two-phased constructor. |
|
64 * |
|
65 * @param aType |
|
66 */ |
|
67 static CMCSPluginWatcher* NewL( const Type& aType ); |
|
68 |
|
69 /** |
|
70 * Destructor. |
|
71 */ |
|
72 virtual ~CMCSPluginWatcher(); |
|
73 |
|
74 /** |
|
75 * Watch menu operation or notification. |
|
76 * |
|
77 * @param aOperation |
|
78 */ |
|
79 void Watch( CMenuOperation* aOperation = NULL ); |
|
80 |
|
81 /** |
|
82 * WatchNotify |
|
83 * |
|
84 * @param aObserver |
|
85 */ |
|
86 void WatchNotify( MMCSPluginWatcherObserver* aObserver ); |
|
87 |
|
88 /** |
|
89 * StopAndWatch |
|
90 * |
|
91 * @param aOperation |
|
92 * @param aWaitScheduler |
|
93 */ |
|
94 void StopAndWatch( CMenuOperation* aOperation, |
|
95 CActiveSchedulerWait* aWaitScheduler ); |
|
96 |
|
97 /** |
|
98 * GetStatus |
|
99 */ |
|
100 TInt GetStatus(); |
|
101 |
|
102 private: |
|
103 |
|
104 /** |
|
105 * Default constructor. |
|
106 * |
|
107 * @param aType |
|
108 */ |
|
109 CMCSPluginWatcher( const Type& aType ); |
|
110 |
|
111 /** |
|
112 * ConstructL |
|
113 */ |
|
114 void ConstructL(); |
|
115 |
|
116 /** |
|
117 * Inherited from CActive class |
|
118 */ |
|
119 void RunL(); |
|
120 |
|
121 /** |
|
122 * Inherited from CActive class |
|
123 */ |
|
124 void DoCancel(); |
|
125 |
|
126 private: |
|
127 |
|
128 /** |
|
129 * Menu operation |
|
130 * Owned |
|
131 */ |
|
132 CMenuOperation* iOperation; |
|
133 |
|
134 /** |
|
135 * Wait scheduler |
|
136 * Not owned |
|
137 */ |
|
138 CActiveSchedulerWait* iWaitScheduler; |
|
139 |
|
140 /** |
|
141 * Observer reference |
|
142 * Not owned |
|
143 */ |
|
144 MMCSPluginWatcherObserver* iObserver; |
|
145 |
|
146 /** |
|
147 * iType |
|
148 */ |
|
149 Type iType; |
|
150 }; |
|
151 |
|
152 #endif /*__MCSPLUGINWATCHER_H*/ |