88 { |
88 { |
89 // add support for more than one observer later on. Only one is used at the moment. Last one |
89 // add support for more than one observer later on. Only one is used at the moment. Last one |
90 // given is used. |
90 // given is used. |
91 |
91 |
92 if( !iMCCEExtensionObserver ) |
92 if( !iMCCEExtensionObserver ) |
93 { |
93 { |
94 return KErrNotFound; |
94 return KErrNotFound; |
95 } |
95 } |
96 |
96 |
97 iMCCEExtensionObserver = NULL; |
97 iMCCEExtensionObserver = NULL; |
98 return KErrNone; |
98 return KErrNone; |
99 } |
99 } |
100 |
100 |
101 // ----------------------------------------------------------------------------- |
101 // ----------------------------------------------------------------------------- |
102 // RequestCommand() |
102 // RequestCommand() |
103 // ----------------------------------------------------------------------------- |
103 // ----------------------------------------------------------------------------- |
104 // |
104 // |
105 TInt CCCEExtension::RequestCommand( TUint32 aServiceId, |
105 TInt CCCEExtension::RequestCommand( TUint32 aServiceId, |
106 TInt aRequestId, |
106 TInt aRequestId, |
107 TDesC8& aData ) |
107 TDesC8& aData ) |
108 { |
108 { |
109 CCELOGSTRING3("CCCEExtension::RequestCommand(): Service id=%d Request id=%d", aServiceId, aRequestId ); |
109 CCELOGSTRING3("CCCEExtension::RequestCommand(): Service id=%d Request id=%d", aServiceId, aRequestId ); |
110 |
110 |
111 CConvergedCallProvider* plugin = GetExtIfPlugin(aServiceId); |
111 CConvergedCallProvider* plugin = GetExtIfPlugin(aServiceId); |
112 |
112 |
113 if( !plugin ) |
113 if( !plugin ) |
114 { |
114 { |
115 CCELOGSTRING("CCCEExtension::RequestCommand(): Plug-in for service-id was not found. Returning KErrNotFound" ); |
115 CCELOGSTRING("CCCEExtension::RequestCommand(): Plug-in for service-id was not found. Returning KErrNotFound" ); |
116 return KErrNotFound; |
116 return KErrNotFound; |
117 } |
117 } |
118 |
118 |
119 MCCPExtensionProvider* extif = NULL; |
119 MCCPExtensionProvider* extif = NULL; |
120 TRAPD( err, extif = plugin->ExtensionProviderL(*this) ); |
120 TRAPD( err, extif = plugin->ExtensionProviderL(*this) ); |
121 |
121 |
122 if( err!=KErrNone ) |
122 if( err!=KErrNone ) |
123 { |
123 { |
124 CCELOGSTRING2("CCCEExtension::RequestCommand(): Plug-in was found, but extension interface get failed with error=%d", err ); |
124 CCELOGSTRING2("CCCEExtension::RequestCommand(): Plug-in was found, but extension interface get failed with error=%d", err ); |
125 return err; |
125 return err; |
126 } |
126 } |
127 |
127 |
128 if( extif ) |
128 if( extif ) |
129 { |
129 { |
130 extif->RequestCommand(aRequestId,aData); |
130 extif->RequestCommand(aRequestId,aData); |
131 } |
131 } |
132 else |
132 else |
133 { |
133 { |
134 CCELOGSTRING("CCCEExtension::RequestCommand() Plug-in extension interface was found, but extensions are not supported. Returning KErrNotSupported" ); |
134 CCELOGSTRING("CCCEExtension::RequestCommand() Plug-in extension interface was found, but extensions are not supported. Returning KErrNotSupported" ); |
135 return KErrNotSupported; |
135 return KErrNotSupported; |
136 } |
136 } |
137 |
137 |
138 return KErrNone; |
138 return KErrNone; |
139 } |
139 } |
141 // ----------------------------------------------------------------------------- |
141 // ----------------------------------------------------------------------------- |
142 // CancelRequest() |
142 // CancelRequest() |
143 // ----------------------------------------------------------------------------- |
143 // ----------------------------------------------------------------------------- |
144 // |
144 // |
145 TInt CCCEExtension::CancelRequest( TUint32 aServiceId, |
145 TInt CCCEExtension::CancelRequest( TUint32 aServiceId, |
146 TInt aRequestId ) |
146 TInt aRequestId ) |
147 { |
147 { |
148 CCELOGSTRING3("CCCEExtension::CancelRequest(): Service id=%d Request id=%d", aServiceId, aRequestId ); |
148 CCELOGSTRING3("CCCEExtension::CancelRequest(): Service id=%d Request id=%d", aServiceId, aRequestId ); |
149 |
149 |
150 CConvergedCallProvider* plugin = GetExtIfPlugin(aServiceId); |
150 CConvergedCallProvider* plugin = GetExtIfPlugin(aServiceId); |
151 |
151 |
152 if( !plugin ) |
152 if( !plugin ) |
153 { |
153 { |
154 CCELOGSTRING("CCCEExtension::CancelRequest(): Plug-in for service-id was not found. Returning KErrNotFound" ); |
154 CCELOGSTRING("CCCEExtension::CancelRequest(): Plug-in for service-id was not found. Returning KErrNotFound" ); |
155 return KErrNotFound; |
155 return KErrNotFound; |
156 } |
156 } |
157 |
157 |
158 MCCPExtensionProvider* extif = NULL; |
158 MCCPExtensionProvider* extif = NULL; |
159 TRAPD( err, extif = plugin->ExtensionProviderL(*this) ); |
159 TRAPD( err, extif = plugin->ExtensionProviderL(*this) ); |
160 |
160 |
161 if( err!=KErrNone ) |
161 if( err!=KErrNone ) |
162 { |
162 { |
163 CCELOGSTRING2("CCCEExtension::CancelRequest(): Plug-in was found, but extension interface get failed with error=%d", err ); |
163 CCELOGSTRING2("CCCEExtension::CancelRequest(): Plug-in was found, but extension interface get failed with error=%d", err ); |
164 return err; |
164 return err; |
165 } |
165 } |
166 |
166 |
167 if( extif ) |
167 if( extif ) |
168 { |
168 { |
169 extif->CancelRequest(aRequestId); |
169 extif->CancelRequest(aRequestId); |
170 } |
170 } |
171 else |
171 else |
172 { |
172 { |
173 CCELOGSTRING("CCCEExtension::CancelRequest() Plug-in extension interface was found, but extensions are not supported. Returning KErrNotSupported" ); |
173 CCELOGSTRING("CCCEExtension::CancelRequest() Plug-in extension interface was found, but extensions are not supported. Returning KErrNotSupported" ); |
174 return KErrNotSupported; |
174 return KErrNotSupported; |
175 } |
175 } |
176 |
176 |
177 return KErrNone; |
177 return KErrNone; |
178 } |
178 } |
180 // ----------------------------------------------------------------------------- |
180 // ----------------------------------------------------------------------------- |
181 // HandleExtensionEvents() |
181 // HandleExtensionEvents() |
182 // ----------------------------------------------------------------------------- |
182 // ----------------------------------------------------------------------------- |
183 // |
183 // |
184 void CCCEExtension::HandleExtensionEvents( TUint32 aServiceId, |
184 void CCCEExtension::HandleExtensionEvents( TUint32 aServiceId, |
185 TInt aEvent, |
185 TInt aEvent, |
186 TInt aStatus ) |
186 TInt aStatus ) |
187 { |
187 { |
188 CCELOGSTRING3("CCCEExtension::HandleExtensionEvents(): Service id=%d Event=%d", aServiceId, aEvent ); |
188 CCELOGSTRING3("CCCEExtension::HandleExtensionEvents(): Service id=%d Event=%d", aServiceId, aEvent ); |
189 CCELOGSTRING2("CCCEExtension::HandleExtensionEvents(): Status=%d", aStatus ); |
189 CCELOGSTRING2("CCCEExtension::HandleExtensionEvents(): Status=%d", aStatus ); |
190 |
190 |
191 if( iMCCEExtensionObserver ) |
191 if( iMCCEExtensionObserver ) |
192 { |
192 { |
193 iMCCEExtensionObserver->HandleExtensionEvents(aServiceId,aEvent,aStatus); |
193 iMCCEExtensionObserver->HandleExtensionEvents(aServiceId,aEvent,aStatus); |
194 } |
194 } |
195 else |
195 else |
196 { |
196 { |
197 CCELOGSTRING("CCCEExtension::HandleExtensionEvents(): No observer was set, ignoring no event was notified!" ); |
197 CCELOGSTRING("CCCEExtension::HandleExtensionEvents(): No observer was set, ignoring no event was notified!" ); |
198 } |
198 } |
199 } |
199 } |
200 |
200 |
201 // ----------------------------------------------------------------------------- |
201 // ----------------------------------------------------------------------------- |
202 // HandleExtensionEvents() |
202 // HandleExtensionEvents() |
203 // ----------------------------------------------------------------------------- |
203 // ----------------------------------------------------------------------------- |