|
1 /* |
|
2 * Copyright (c) 2005-2006 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: Main plugin class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef MUSAOPLUGIN_H |
|
20 #define MUSAOPLUGIN_H |
|
21 |
|
22 |
|
23 #include <e32base.h> |
|
24 #include <AlwaysOnlineEComInterface.h> |
|
25 #include <ecom/implementationproxy.h> |
|
26 #include <etel.h> |
|
27 #include <etelmm.h> |
|
28 #include <e32property.h> |
|
29 |
|
30 #include "musunittesting.h" |
|
31 #include "mmuscallstateobserver.h" |
|
32 #include "musmanager.h" |
|
33 |
|
34 // Enable the below line if Kodiak Ptt has to be monitered |
|
35 //class CMusPttCallMonitor; |
|
36 class CMusPropertyMonitor; |
|
37 class CMusTsyPropertyMonitor; |
|
38 |
|
39 IMPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount ); |
|
40 |
|
41 /** |
|
42 * Main plugin class |
|
43 * |
|
44 * @lib musaoplugin.dll |
|
45 */ |
|
46 class CMusAoPlugin : public CAlwaysOnlineEComInterface, |
|
47 public MMusCallStateObserver |
|
48 { |
|
49 public: |
|
50 |
|
51 /** |
|
52 * Two-phased constructor |
|
53 * |
|
54 * @since S60 v3.2 |
|
55 * @return New CMusAoPlugin instance |
|
56 */ |
|
57 static CMusAoPlugin* NewL(); |
|
58 |
|
59 /** |
|
60 * C++ destructor. |
|
61 */ |
|
62 virtual ~CMusAoPlugin(); |
|
63 |
|
64 |
|
65 public: // new API |
|
66 |
|
67 /** |
|
68 * Define start up resource properties |
|
69 * |
|
70 * @since S60 v3.2 |
|
71 */ |
|
72 void DefinePropertiesL(); |
|
73 |
|
74 /** |
|
75 * Delete when AO end |
|
76 * |
|
77 * @since S60 v3.2 |
|
78 */ |
|
79 |
|
80 void DeleteProperties(); |
|
81 |
|
82 |
|
83 public: // from MMusCallStateObserver |
|
84 |
|
85 void MusCallStateChanged(); |
|
86 |
|
87 |
|
88 private: // constructors |
|
89 |
|
90 /** |
|
91 * C++ constructor. |
|
92 */ |
|
93 CMusAoPlugin(); |
|
94 |
|
95 /** |
|
96 * Symbian second-phase constructor. |
|
97 */ |
|
98 void ConstructL(); |
|
99 |
|
100 /** |
|
101 * Utility function to define and set keys. |
|
102 */ |
|
103 void DefinePropertyL(TInt aKey,RProperty::TType aType,TInt aVal); |
|
104 |
|
105 /** |
|
106 * Utility function to define and set keys. |
|
107 */ |
|
108 void DefinePropertyL(TInt aKey,RProperty::TType aType,const TDesC& aVal); |
|
109 |
|
110 /** |
|
111 * Utility function to delete keys. |
|
112 */ |
|
113 void DeleteProperty(TInt aKey); |
|
114 |
|
115 /** |
|
116 * Starts Mus Manager Client.In turn it will start Mus Manager |
|
117 * Server and Availability Plugin. |
|
118 */ |
|
119 void StartMusClientL(); |
|
120 |
|
121 /* |
|
122 * Stops Mus Manager Client. |
|
123 */ |
|
124 void StopMusClient(); |
|
125 |
|
126 |
|
127 public: // from base class CAlwaysOnlineEComInterface |
|
128 |
|
129 /** |
|
130 * Commands from alwaysonlinemanager to plugin |
|
131 * |
|
132 * @since S60 v3.2 |
|
133 * @param aCommand, command Id |
|
134 * @param aParameters, parameter pack |
|
135 * @return return value |
|
136 */ |
|
137 virtual TAny* HandleServerCommandL( TInt aCommand, |
|
138 TDesC8* aParameters ); |
|
139 |
|
140 private: // data |
|
141 |
|
142 /** |
|
143 * Instance of MusManager Client. Owned. |
|
144 */ |
|
145 CMusManager* iManager; |
|
146 |
|
147 |
|
148 /* Property Monitor */ |
|
149 CMusPropertyMonitor* iPropertyMonitor; |
|
150 |
|
151 /** |
|
152 * Telephony Property Key monitor. |
|
153 * Monitors the call connect/disconnect events. |
|
154 */ |
|
155 CMusTsyPropertyMonitor* iTsyPropertyMonitor; |
|
156 |
|
157 /* Ptt Call Monitor */ |
|
158 // Enable the below line if Kodiak Ptt has to be monitered |
|
159 // CMusPttCallMonitor* iPttCallMonitor; |
|
160 |
|
161 /** |
|
162 * RTelServer handle |
|
163 */ |
|
164 RTelServer iServer; |
|
165 |
|
166 /** |
|
167 * RMobilePhone handle |
|
168 */ |
|
169 RMobilePhone iPhone; |
|
170 |
|
171 /** |
|
172 * Error status. |
|
173 */ |
|
174 TInt iError; |
|
175 |
|
176 MUS_UNITTEST( UT_CMusAoPlugin ) |
|
177 }; |
|
178 |
|
179 #endif // MUSAOPLUGIN_H |