|
1 /* |
|
2 * Copyright (c) 2006-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 |
|
19 |
|
20 |
|
21 #include <ecom/ecom.h> |
|
22 |
|
23 // ----------------------------------------------------------------------------- |
|
24 // CHWRMPluginService::~CHWRMPluginService |
|
25 // Destructor informs ECom that implementation has been destroyed. |
|
26 // ----------------------------------------------------------------------------- |
|
27 // |
|
28 inline CHWRMPluginService::~CHWRMPluginService() |
|
29 { |
|
30 REComSession::DestroyedImplementation(iDestructorIDKey); |
|
31 } |
|
32 |
|
33 // ----------------------------------------------------------------------------- |
|
34 // CHWRMPluginService::NewL |
|
35 // Factory method to create implementation. Implementation is found via ECom. |
|
36 // ----------------------------------------------------------------------------- |
|
37 // |
|
38 inline CHWRMPluginService* CHWRMPluginService::NewL(const TDesC8& aMatch, MHWRMPluginCallback* aResponseCallback) |
|
39 { |
|
40 // Set resolve parameters to find correct implementation |
|
41 TEComResolverParams resolverParams; |
|
42 resolverParams.SetDataType(aMatch); |
|
43 resolverParams.SetWildcardMatch(EFalse); |
|
44 |
|
45 // Create instance using ECom |
|
46 TAny* interface = REComSession::CreateImplementationL(KCHWRMPluginServiceInterfaceUid, |
|
47 _FOFF(CHWRMPluginService, iDestructorIDKey), |
|
48 resolverParams, |
|
49 KRomOnlyResolverUid); |
|
50 |
|
51 CHWRMPluginService* service = reinterpret_cast<CHWRMPluginService*>(interface); |
|
52 |
|
53 // Set response callback pointer |
|
54 service->iResponseCallback = aResponseCallback; |
|
55 |
|
56 return service; |
|
57 } |
|
58 |
|
59 // End of File |