os/ossrv/lowlevellibsandfws/pluginfw/Framework/inc/ExtendedInterfaceImplementationProxy.h
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/lowlevellibsandfws/pluginfw/Framework/inc/ExtendedInterfaceImplementationProxy.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,125 @@
1.4 +// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// This file contains the definition for the Extended Interface TImplementationProxy structure.
1.18 +//
1.19 +//
1.20 +
1.21 +/**
1.22 + @file
1.23 + @publishedPartner
1.24 + @released
1.25 +*/
1.26 +
1.27 +#ifndef __EXTENDED_INTERFACE_IMPLEMENTATIONPROXY_H__
1.28 +#define __EXTENDED_INTERFACE_IMPLEMENTATIONPROXY_H__
1.29 +
1.30 +// ____________________________________________________________________________
1.31 +// INCLUDES
1.32 +
1.33 +#include <e32std.h>
1.34 +#include <ecom/implementationproxy.h>
1.35 +
1.36 +// ____________________________________________________________________________
1.37 +// TYPES - TImplementationProxy3
1.38 +
1.39 +/**
1.40 +Pre-defined function pointer type used in TImplementationProxy3 to fetch the extended interface
1.41 +@param aObject A pointer to the instantiation interface implementation returned by a call to one of the
1.42 + CreateImplementationL() methods
1.43 +@param aExtendedInterfaceUid Identifies the interface to fetch from the instantiation interface implementation.
1.44 +@param aBitFlags Output parameter used for communication between plugin's and ECOM. Currently used by plugin implementors
1.45 + to signal if an extended interface implementation requires release.
1.46 +@param aReleaseObject Optional output parameter. If the plugin is allocating a new extension object then the address
1.47 + returned by new must be returned in this argument for ECOM to supply it back to the plugin implementation for
1.48 + later deletion when release is requried, aBitFlags must have the KReleaseRequiredMask flag set in such cases.
1.49 + If a simple re-cast extension pattern is used in this proxy function then this argument should be left unchanged.
1.50 +@leave KErrNoMemory
1.51 +@leave Or any of the System Wide error codes
1.52 +@return TAny* A pointer to the extended interface implementation if the instantiation interface implementation
1.53 + supports it, or NULL if the instantiation interface implementation does not support it.
1.54 +@publishedPartner
1.55 +@released
1.56 +*/
1.57 +typedef TAny* (*TFuncPtrGetL)(TAny* /* aObject */, const TUid& /* aExtendedInterfaceUid */, TUint32& /* aBitFlags */, TAny*& /* aReleaseObject */);
1.58 +
1.59 +/**
1.60 +Pre-defined function pointer type used in TImplementationProxy3 to release the
1.61 +extended interface. Implementations of this function must never leave.
1.62 +@param aReleaseObject The release object address, previously supplied by a function of type TProxyExtendedInterfaceGetPtrL,
1.63 + that is to be deleted by the instantiation interface implementation.
1.64 +@param aExtendedInterfaceUid Identifies the extended interface implementation that is to be released. If the supplied
1.65 + uid is not recognised then this function should be implemented in such a way that it returns without performing
1.66 + any cleanup.
1.67 +@publishedPartner
1.68 +@released
1.69 +*/
1.70 +typedef void (*TFuncPtrRelease)(TAny* /* aReleaseObject */, const TUid& /* aExtendedInterfaceUid */);
1.71 +
1.72 +/**
1.73 +Type definition for function pointer to fetch the extended interface.
1.74 +@publishedPartner
1.75 +@released
1.76 +*/
1.77 +typedef TFuncPtrGetL TProxyExtendedInterfaceGetPtrL;
1.78 +
1.79 +/**
1.80 +Type definition for function pointer to release the extended interface.
1.81 +@publishedPartner
1.82 +@released
1.83 +*/
1.84 +typedef TFuncPtrRelease TProxyExtendedInterfaceReleasePtr;
1.85 +
1.86 +/**
1.87 +Extended interface bit masks.
1.88 +@publishedPartner
1.89 +@released
1.90 +*/
1.91 +const TUint32 KReleaseRequiredMask = 0x00000001;
1.92 +
1.93 +
1.94 +/**
1.95 +The structure that defines the pairing required by the ECOM framework
1.96 +to correctly identify the instantiation method pointer to provide
1.97 +to a client's resolution request. This is for PLUGIN3 dll's and
1.98 +implementations.
1.99 +
1.100 +@publishedPartner
1.101 +@released
1.102 +*/
1.103 +typedef struct
1.104 + {
1.105 + /** The unique UID for an Interface Implementation */
1.106 + TUid iImplementationUid;
1.107 + /** The function pointer to the instantiation method */
1.108 + TProxyNewLPtr iNewLFuncPtr;
1.109 + /** The function pointer to the method used to fetch extended interfaces*/
1.110 + TProxyExtendedInterfaceGetPtrL iFuncPtrInterfaceGetL;
1.111 + /** The function pointer used to release the extended interfaces. This MUST be a non-leaving method.*/
1.112 + TProxyExtendedInterfaceReleasePtr iFuncPtrInterfaceRelease;
1.113 + /** reserved for future proofing*/
1.114 + TInt32 iReserved1;
1.115 + TInt32 iReserved2;
1.116 + TInt32 iReserved3;
1.117 + TInt32 iReserved4;
1.118 + } TImplementationProxy3;
1.119 +
1.120 +/**
1.121 +Macro to initialise an element of a static array of TImplementationProxy objects with PLUGIN3 type.
1.122 +This macro deals with casting the function pointer to the type used in the structure.
1.123 +@publishedPartner
1.124 +@released
1.125 +*/
1.126 +#define IMPLEMENTATION_PROXY_ENTRY3(aUid, aFuncPtr, aGetExtFuncPtr, aReleaseExtFuncPtr) {{aUid},(TProxyNewLPtr)(aFuncPtr),(aGetExtFuncPtr),(aReleaseExtFuncPtr),0,0,0,0}
1.127 +
1.128 +#endif // __EXTENDED_INTERFACE_IMPLEMENTATIONPROXY_H__