|
1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // This file contains the definition for the Extended Interface TImplementationProxy structure. |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file |
|
20 @publishedPartner |
|
21 @released |
|
22 */ |
|
23 |
|
24 #ifndef __EXTENDED_INTERFACE_IMPLEMENTATIONPROXY_H__ |
|
25 #define __EXTENDED_INTERFACE_IMPLEMENTATIONPROXY_H__ |
|
26 |
|
27 // ____________________________________________________________________________ |
|
28 // INCLUDES |
|
29 |
|
30 #include <e32std.h> |
|
31 #include <ecom/implementationproxy.h> |
|
32 |
|
33 // ____________________________________________________________________________ |
|
34 // TYPES - TImplementationProxy3 |
|
35 |
|
36 /** |
|
37 Pre-defined function pointer type used in TImplementationProxy3 to fetch the extended interface |
|
38 @param aObject A pointer to the instantiation interface implementation returned by a call to one of the |
|
39 CreateImplementationL() methods |
|
40 @param aExtendedInterfaceUid Identifies the interface to fetch from the instantiation interface implementation. |
|
41 @param aBitFlags Output parameter used for communication between plugin's and ECOM. Currently used by plugin implementors |
|
42 to signal if an extended interface implementation requires release. |
|
43 @param aReleaseObject Optional output parameter. If the plugin is allocating a new extension object then the address |
|
44 returned by new must be returned in this argument for ECOM to supply it back to the plugin implementation for |
|
45 later deletion when release is requried, aBitFlags must have the KReleaseRequiredMask flag set in such cases. |
|
46 If a simple re-cast extension pattern is used in this proxy function then this argument should be left unchanged. |
|
47 @leave KErrNoMemory |
|
48 @leave Or any of the System Wide error codes |
|
49 @return TAny* A pointer to the extended interface implementation if the instantiation interface implementation |
|
50 supports it, or NULL if the instantiation interface implementation does not support it. |
|
51 @publishedPartner |
|
52 @released |
|
53 */ |
|
54 typedef TAny* (*TFuncPtrGetL)(TAny* /* aObject */, const TUid& /* aExtendedInterfaceUid */, TUint32& /* aBitFlags */, TAny*& /* aReleaseObject */); |
|
55 |
|
56 /** |
|
57 Pre-defined function pointer type used in TImplementationProxy3 to release the |
|
58 extended interface. Implementations of this function must never leave. |
|
59 @param aReleaseObject The release object address, previously supplied by a function of type TProxyExtendedInterfaceGetPtrL, |
|
60 that is to be deleted by the instantiation interface implementation. |
|
61 @param aExtendedInterfaceUid Identifies the extended interface implementation that is to be released. If the supplied |
|
62 uid is not recognised then this function should be implemented in such a way that it returns without performing |
|
63 any cleanup. |
|
64 @publishedPartner |
|
65 @released |
|
66 */ |
|
67 typedef void (*TFuncPtrRelease)(TAny* /* aReleaseObject */, const TUid& /* aExtendedInterfaceUid */); |
|
68 |
|
69 /** |
|
70 Type definition for function pointer to fetch the extended interface. |
|
71 @publishedPartner |
|
72 @released |
|
73 */ |
|
74 typedef TFuncPtrGetL TProxyExtendedInterfaceGetPtrL; |
|
75 |
|
76 /** |
|
77 Type definition for function pointer to release the extended interface. |
|
78 @publishedPartner |
|
79 @released |
|
80 */ |
|
81 typedef TFuncPtrRelease TProxyExtendedInterfaceReleasePtr; |
|
82 |
|
83 /** |
|
84 Extended interface bit masks. |
|
85 @publishedPartner |
|
86 @released |
|
87 */ |
|
88 const TUint32 KReleaseRequiredMask = 0x00000001; |
|
89 |
|
90 |
|
91 /** |
|
92 The structure that defines the pairing required by the ECOM framework |
|
93 to correctly identify the instantiation method pointer to provide |
|
94 to a client's resolution request. This is for PLUGIN3 dll's and |
|
95 implementations. |
|
96 |
|
97 @publishedPartner |
|
98 @released |
|
99 */ |
|
100 typedef struct |
|
101 { |
|
102 /** The unique UID for an Interface Implementation */ |
|
103 TUid iImplementationUid; |
|
104 /** The function pointer to the instantiation method */ |
|
105 TProxyNewLPtr iNewLFuncPtr; |
|
106 /** The function pointer to the method used to fetch extended interfaces*/ |
|
107 TProxyExtendedInterfaceGetPtrL iFuncPtrInterfaceGetL; |
|
108 /** The function pointer used to release the extended interfaces. This MUST be a non-leaving method.*/ |
|
109 TProxyExtendedInterfaceReleasePtr iFuncPtrInterfaceRelease; |
|
110 /** reserved for future proofing*/ |
|
111 TInt32 iReserved1; |
|
112 TInt32 iReserved2; |
|
113 TInt32 iReserved3; |
|
114 TInt32 iReserved4; |
|
115 } TImplementationProxy3; |
|
116 |
|
117 /** |
|
118 Macro to initialise an element of a static array of TImplementationProxy objects with PLUGIN3 type. |
|
119 This macro deals with casting the function pointer to the type used in the structure. |
|
120 @publishedPartner |
|
121 @released |
|
122 */ |
|
123 #define IMPLEMENTATION_PROXY_ENTRY3(aUid, aFuncPtr, aGetExtFuncPtr, aReleaseExtFuncPtr) {{aUid},(TProxyNewLPtr)(aFuncPtr),(aGetExtFuncPtr),(aReleaseExtFuncPtr),0,0,0,0} |
|
124 |
|
125 #endif // __EXTENDED_INTERFACE_IMPLEMENTATIONPROXY_H__ |