|
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 * GetStatus |
|
90 */ |
|
91 TInt GetStatus(); |
|
92 |
|
93 private: |
|
94 |
|
95 /** |
|
96 * Default constructor. |
|
97 * |
|
98 * @param aType |
|
99 */ |
|
100 CMCSPluginWatcher( const Type& aType ); |
|
101 |
|
102 /** |
|
103 * ConstructL |
|
104 */ |
|
105 void ConstructL(); |
|
106 |
|
107 /** |
|
108 * Inherited from CActive class |
|
109 */ |
|
110 void RunL(); |
|
111 |
|
112 /** |
|
113 * Inherited from CActive class |
|
114 */ |
|
115 void DoCancel(); |
|
116 |
|
117 private: |
|
118 |
|
119 /** |
|
120 * Menu operation |
|
121 * Owned |
|
122 */ |
|
123 CMenuOperation* iOperation; |
|
124 |
|
125 /** |
|
126 * Observer reference |
|
127 * Not owned |
|
128 */ |
|
129 MMCSPluginWatcherObserver* iObserver; |
|
130 |
|
131 /** |
|
132 * iType |
|
133 */ |
|
134 Type iType; |
|
135 }; |
|
136 |
|
137 #endif /*__MCSPLUGINWATCHER_H*/ |