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