|
1 // |
|
2 // Interface.inl |
|
3 // Copyright © 1997-2001 Symbian Ltd. All rights reserved. |
|
4 // |
|
5 |
|
6 // Set default to be first implementation found by resolver |
|
7 _LIT8(KDefaultImplementation,"*"); |
|
8 |
|
9 inline CExampleInterface::CExampleInterface() |
|
10 { |
|
11 } |
|
12 |
|
13 inline CExampleInterface::~CExampleInterface() |
|
14 { |
|
15 // Destroy any instance variables and then |
|
16 // inform the framework that this specific |
|
17 // instance of the interface has been destroyed. |
|
18 REComSession::DestroyedImplementation(iDtor_ID_Key); |
|
19 } |
|
20 |
|
21 inline CExampleInterface* CExampleInterface::NewL() |
|
22 { |
|
23 // Set up the interface find for the default resolver. |
|
24 TEComResolverParams resolverParams; |
|
25 resolverParams.SetDataType(KDefaultImplementation()); |
|
26 resolverParams.SetWildcardMatch(ETrue); // Allow wildcard matching |
|
27 |
|
28 // Set up some empty initialisation parameters |
|
29 TExampleInterfaceInitParams initParams; |
|
30 initParams.integer = 0; |
|
31 initParams.descriptor = NULL; |
|
32 |
|
33 const TUid KExResolverUid = {0x10009DD0}; |
|
34 return REINTERPRET_CAST(CExampleInterface*, |
|
35 REComSession::CreateImplementationL(KCExampleInterfaceUid, |
|
36 _FOFF(CExampleInterface,iDtor_ID_Key), |
|
37 &initParams, |
|
38 resolverParams, |
|
39 KExResolverUid)); |
|
40 } |
|
41 |
|
42 inline CExampleInterface* CExampleInterface::NewL(const TDesC8& aMatchString) |
|
43 { |
|
44 // Set up the interface find for the default resolver. |
|
45 TEComResolverParams resolverParams; |
|
46 resolverParams.SetDataType(aMatchString); |
|
47 resolverParams.SetWildcardMatch(ETrue); // Allow wildcard matching |
|
48 |
|
49 // Set up some empty initialisation parameters |
|
50 TExampleInterfaceInitParams initParams; |
|
51 initParams.integer = 0; |
|
52 initParams.descriptor = NULL; |
|
53 |
|
54 return REINTERPRET_CAST(CExampleInterface*, |
|
55 REComSession::CreateImplementationL(KCExampleInterfaceUid, |
|
56 _FOFF(CExampleInterface,iDtor_ID_Key), |
|
57 &initParams, |
|
58 resolverParams)); |
|
59 } |
|
60 |
|
61 inline CExampleInterface* CExampleInterface::NewL(const TDesC8& aMatchString, TExampleInterfaceInitParams& aParams) |
|
62 { |
|
63 // Set up the interface find for the default resolver. |
|
64 TEComResolverParams resolverParams; |
|
65 resolverParams.SetDataType(aMatchString); |
|
66 resolverParams.SetWildcardMatch(ETrue); // Allow wildcard matching |
|
67 |
|
68 // The CreateImplementationL method will return |
|
69 // the created item. |
|
70 return REINTERPRET_CAST(CExampleInterface*, REComSession::CreateImplementationL(KCExampleInterfaceUid, |
|
71 _FOFF(CExampleInterface,iDtor_ID_Key), |
|
72 &aParams, |
|
73 resolverParams)); |
|
74 } |
|
75 |
|
76 inline void CExampleInterface::ListAllImplementationsL(RImplInfoPtrArray& aImplInfoArray) |
|
77 { |
|
78 REComSession::ListImplementationsL(KCExampleInterfaceUid, aImplInfoArray); |
|
79 } |