examples/SysLibs/ECom/InterfaceDefinition/Interface.inl

00001 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
00002 // All rights reserved.
00003 // This component and the accompanying materials are made available
00004 // under the terms of "Eclipse Public License v1.0"
00005 // which accompanies this distribution, and is available
00006 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
00007 //
00008 // Initial Contributors:
00009 // Nokia Corporation - initial contribution.
00010 //
00011 // Contributors:
00012 //
00013 // Description:
00014 //
00015 
00016 // Set default to be first implementation found by resolver
00017 _LIT8(KDefaultImplementation,"*");
00018 
00019 inline CExampleInterface::CExampleInterface()
00020         {
00021         }
00022 
00023 inline CExampleInterface::~CExampleInterface()
00024         {
00025         // Destroy any instance variables and then
00026         // inform the framework that this specific 
00027         // instance of the interface has been destroyed.
00028         REComSession::DestroyedImplementation(iDtor_ID_Key);
00029         }
00030 
00031 inline CExampleInterface* CExampleInterface::NewL()
00032         {
00033         // Set up the interface find for the default resolver.
00034         TEComResolverParams resolverParams;
00035         resolverParams.SetDataType(KDefaultImplementation());
00036         resolverParams.SetWildcardMatch(ETrue);         // Allow wildcard matching
00037 
00038         // Set up some empty initialisation parameters
00039         TExampleInterfaceInitParams initParams;
00040         initParams.integer              = 0;
00041         initParams.descriptor   = NULL;
00042 
00043         const TUid KExResolverUid = {0x10009DD0};
00044         return REINTERPRET_CAST(CExampleInterface*, 
00045                                                         REComSession::CreateImplementationL(KCExampleInterfaceUid, 
00046                                                                                                                            _FOFF(CExampleInterface,iDtor_ID_Key),
00047                                                                                                                            &initParams,
00048                                                                                                                            resolverParams,
00049                                                                                                                            KExResolverUid));
00050         }
00051 
00052 inline CExampleInterface* CExampleInterface::NewL(const TDesC8& aMatchString)
00053         {
00054         // Set up the interface find for the default resolver.
00055         TEComResolverParams resolverParams;
00056         resolverParams.SetDataType(aMatchString);
00057         resolverParams.SetWildcardMatch(ETrue);         // Allow wildcard matching
00058 
00059         // Set up some empty initialisation parameters
00060         TExampleInterfaceInitParams initParams;
00061         initParams.integer              = 0;
00062         initParams.descriptor   = NULL;
00063 
00064         return REINTERPRET_CAST(CExampleInterface*, 
00065                                                         REComSession::CreateImplementationL(KCExampleInterfaceUid, 
00066                                                                                                                            _FOFF(CExampleInterface,iDtor_ID_Key), 
00067                                                                                                                            &initParams,
00068                                                                                                                            resolverParams));
00069         }
00070 
00071 inline CExampleInterface* CExampleInterface::NewL(const TDesC8& aMatchString, TExampleInterfaceInitParams& aParams)
00072         {
00073         // Set up the interface find for the default resolver.
00074         TEComResolverParams resolverParams;
00075         resolverParams.SetDataType(aMatchString);
00076         resolverParams.SetWildcardMatch(ETrue);         // Allow wildcard matching
00077 
00078         // The CreateImplementationL method will return
00079         // the created item.
00080         return REINTERPRET_CAST(CExampleInterface*, REComSession::CreateImplementationL(KCExampleInterfaceUid,
00081                                                                                                 _FOFF(CExampleInterface,iDtor_ID_Key),
00082                                                                                                 &aParams,
00083                                                                                                 resolverParams));
00084         }
00085 
00086 inline void CExampleInterface::ListAllImplementationsL(RImplInfoPtrArray& aImplInfoArray)
00087         {
00088         REComSession::ListImplementationsL(KCExampleInterfaceUid, aImplInfoArray);
00089         }

Generated by  doxygen 1.6.2