|
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: Interface for accessing definitionengine |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 #include "hspsdefinitionengineinterface.h" |
|
21 #include "hspsdefinitionengine.rh" |
|
22 #include <ecom/ecom.h> |
|
23 |
|
24 // ============================ MEMBER FUNCTIONS =============================== |
|
25 |
|
26 // ----------------------------------------------------------------------------- |
|
27 // ChspsDefinitionEngineInterface::NewL |
|
28 // ----------------------------------------------------------------------------- |
|
29 // |
|
30 EXPORT_C ChspsDefinitionEngineInterface* ChspsDefinitionEngineInterface::NewL( |
|
31 const TDesC8& aPluginId ) |
|
32 { |
|
33 TUid interfaceUid = {KhspsDefinitionEngineIId}; |
|
34 TEComResolverParams resolverParams; |
|
35 resolverParams.SetDataType( aPluginId ); |
|
36 resolverParams.SetWildcardMatch( ETrue ); |
|
37 |
|
38 TAny * ecom = NULL; |
|
39 |
|
40 #ifdef _DEBUG |
|
41 TRAPD( |
|
42 err, |
|
43 ecom = REComSession::CreateImplementationL( |
|
44 interfaceUid, |
|
45 _FOFF(ChspsDefinitionEngineInterface, iDtorKey), |
|
46 NULL, |
|
47 resolverParams ) |
|
48 ); |
|
49 |
|
50 if( err != KErrNone ) |
|
51 { |
|
52 REComSession::FinalClose(); |
|
53 User::Leave( err ); |
|
54 } |
|
55 #else |
|
56 |
|
57 ecom = REComSession::CreateImplementationL( |
|
58 interfaceUid, |
|
59 _FOFF(ChspsDefinitionEngineInterface, iDtorKey), |
|
60 NULL, |
|
61 resolverParams ); |
|
62 #endif |
|
63 |
|
64 ChspsDefinitionEngineInterface* element = |
|
65 reinterpret_cast<ChspsDefinitionEngineInterface*>(ecom); |
|
66 |
|
67 return element; |
|
68 |
|
69 } |
|
70 |
|
71 // ----------------------------------------------------------------------------- |
|
72 // ChspsDefinitionEngineInterface::Destructor |
|
73 // ----------------------------------------------------------------------------- |
|
74 // |
|
75 EXPORT_C ChspsDefinitionEngineInterface::~ChspsDefinitionEngineInterface() |
|
76 { |
|
77 REComSession::DestroyedImplementation(iDtorKey); |
|
78 } |
|
79 |
|
80 // End of File |