sl@0: // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // This file contains the placeholder class sl@0: // which represents the interface creation. sl@0: // sl@0: // sl@0: sl@0: /** sl@0: @internalComponent sl@0: @file sl@0: */ sl@0: sl@0: sl@0: const TUid KCExampleInterfaceUid = {0x10009DC0}; sl@0: const TUid KCExample10InterfaceUid = {0x10009DBB}; sl@0: const TUid KCExtendedInterfaceUid1 = {0x10009E44}; sl@0: const TUid KCExtendedInterfaceUid2 = {0x10009E45}; sl@0: const TUid KCExtendedInterfaceUid3 = {0x10009E46}; sl@0: sl@0: _LIT8(KImplementationTest,"text/wml"); sl@0: _LIT8(KImplementationTest10,"Example 10"); sl@0: sl@0: inline CExampleInterface::CExampleInterface() sl@0: : CActive(CActive::EPriorityLow) sl@0: { sl@0: // Do nothing sl@0: } sl@0: sl@0: sl@0: inline CExampleInterface::~CExampleInterface() sl@0: { sl@0: Cancel(); sl@0: // Destroy any instance variables and then sl@0: // inform the framework that this specific sl@0: // instance of the interface has been destroyed. sl@0: REComSession::DestroyedImplementation(iDtor_ID_Key); sl@0: } sl@0: sl@0: sl@0: inline CExampleInterface* CExampleInterface::NewL() sl@0: { sl@0: // Set up the interface find for the default resolver. sl@0: TEComResolverParams ResolverParams; sl@0: ResolverParams.SetDataType(KImplementationTest()); sl@0: ResolverParams.SetWildcardMatch(ETrue); // Allow wildcard matching sl@0: TUid resolverUid = {0x10009DD0}; sl@0: sl@0: // Set up some empty initialisation parameters sl@0: TExampleInterfaceInitParams initParams; sl@0: initParams.integer = 0; sl@0: initParams.descriptor = NULL; sl@0: sl@0: return REINTERPRET_CAST(CExampleInterface*, sl@0: REComSession::CreateImplementationL(KCExampleInterfaceUid, sl@0: _FOFF(CExampleInterface,iDtor_ID_Key), sl@0: &initParams, sl@0: ResolverParams, sl@0: resolverUid)); sl@0: } sl@0: sl@0: inline CExampleInterface* CExampleInterface::NewL(const TDesC8& aMatchString) sl@0: { sl@0: // Set up the interface find for the default resolver. sl@0: TEComResolverParams ResolverParams; sl@0: ResolverParams.SetDataType(aMatchString); sl@0: ResolverParams.SetWildcardMatch(ETrue); // Allow wildcard matching sl@0: sl@0: // Set up some empty initialisation parameters sl@0: TExampleInterfaceInitParams initParams; sl@0: initParams.integer = 0; sl@0: initParams.descriptor = NULL; sl@0: sl@0: return REINTERPRET_CAST(CExampleInterface*, sl@0: REComSession::CreateImplementationL(KCExampleInterfaceUid, sl@0: _FOFF(CExampleInterface,iDtor_ID_Key), sl@0: &initParams, sl@0: ResolverParams)); sl@0: } sl@0: sl@0: inline CExampleInterface* CExampleInterface::NewL(TInt aIntParameterTest, const TDesC& aDesParameterTest) sl@0: { sl@0: // Set up the interface find for the default resolver. sl@0: TEComResolverParams ResolverParams; sl@0: ResolverParams.SetDataType(KImplementationTest()); sl@0: ResolverParams.SetWildcardMatch(ETrue); // Allow wildcard matching sl@0: sl@0: // Set up the initialisation parameter passing sl@0: TExampleInterfaceInitParams initParams; sl@0: initParams.integer = aIntParameterTest; sl@0: initParams.descriptor = &aDesParameterTest; sl@0: sl@0: // The CreateImplementationL method will return sl@0: // the created item. sl@0: return REINTERPRET_CAST(CExampleInterface*, REComSession::CreateImplementationL(KCExampleInterfaceUid, sl@0: _FOFF(CExampleInterface,iDtor_ID_Key), sl@0: &initParams, sl@0: ResolverParams)); sl@0: } sl@0: sl@0: inline CExampleInterface* CExampleInterface::NewL2(const TUid aImplementationUid) sl@0: { sl@0: // Set up some empty initialisation parameters sl@0: TExampleInterfaceInitParams initParams; sl@0: initParams.integer = 0; sl@0: initParams.descriptor = NULL; sl@0: sl@0: // The CreateImplementationL method will return sl@0: // the created item. sl@0: return REINTERPRET_CAST(CExampleInterface*, sl@0: REComSession::CreateImplementationL(aImplementationUid, sl@0: _FOFF(CExampleInterface,iDtor_ID_Key), sl@0: &initParams)); sl@0: } sl@0: sl@0: inline CExampleInterface* CExampleInterface::NewL3() sl@0: { sl@0: // Set up the interface find for the default resolver. sl@0: TEComResolverParams ResolverParams; sl@0: ResolverParams.SetDataType(KImplementationTest()); sl@0: ResolverParams.SetWildcardMatch(ETrue); // Allow wildcard matching sl@0: sl@0: // Set up some empty initialisation parameters sl@0: TExampleInterfaceInitParams initParams; sl@0: initParams.integer = 0; sl@0: initParams.descriptor = NULL; sl@0: sl@0: // The CreateImplementationL method will return sl@0: // the created item. sl@0: return REINTERPRET_CAST(CExampleInterface*, sl@0: REComSession::CreateImplementationL(KCExampleInterfaceUid, sl@0: _FOFF(CExampleInterface,iDtor_ID_Key), sl@0: &initParams, sl@0: ResolverParams)); sl@0: } sl@0: sl@0: inline CExampleInterface* CExampleInterface::NewL4() sl@0: { sl@0: // Set up the interface find for the default resolver. sl@0: TEComResolverParams ResolverParams; sl@0: ResolverParams.SetDataType(KImplementationTest()); sl@0: ResolverParams.SetWildcardMatch(ETrue); // Allow wildcard matching sl@0: TUid resolverUid = {0x10009DD0}; sl@0: sl@0: // Set up some empty initialisation parameters sl@0: TExampleInterfaceInitParams initParams; sl@0: initParams.integer = 0; sl@0: initParams.descriptor = NULL; sl@0: sl@0: // The CreateImplementationL method will return sl@0: // the created item. sl@0: return REINTERPRET_CAST(CExampleInterface*, sl@0: REComSession::CreateImplementationL(KCExampleInterfaceUid, sl@0: _FOFF(CExampleInterface,iDtor_ID_Key), sl@0: &initParams, sl@0: ResolverParams, sl@0: resolverUid)); sl@0: } sl@0: sl@0: sl@0: inline CExampleInterface* CExampleInterface::NewL5() sl@0: { sl@0: //set up extended interface; sl@0: RArray extendedInterface; sl@0: CleanupClosePushL(extendedInterface); sl@0: extendedInterface.AppendL(KCExtendedInterfaceUid1); sl@0: extendedInterface.AppendL(KCExtendedInterfaceUid2); sl@0: extendedInterface.AppendL(KCExtendedInterfaceUid3); sl@0: sl@0: // Set up the interface find for the default resolver. sl@0: TEComResolverParams ResolverParams; sl@0: ResolverParams.SetDataType(KImplementationTest10()); sl@0: ResolverParams.SetWildcardMatch(ETrue); // Allow wildcard matching sl@0: sl@0: // The CreateImplementationL method will return the created item. sl@0: CExampleInterface* dll = REINTERPRET_CAST(CExampleInterface*, sl@0: REComSession::CreateImplementationL(KCExample10InterfaceUid, sl@0: extendedInterface, sl@0: _FOFF(CExampleInterface,iDtor_ID_Key), sl@0: ResolverParams)); sl@0: CleanupStack::PopAndDestroy(&extendedInterface); sl@0: return dll; sl@0: } sl@0: sl@0: sl@0: inline CExampleInterface* CExampleInterface::NewL6() sl@0: { sl@0: //set up extended interface; sl@0: RArray extendedInterface; sl@0: CleanupClosePushL(extendedInterface); sl@0: extendedInterface.AppendL(KCExtendedInterfaceUid1); sl@0: extendedInterface.AppendL(KCExtendedInterfaceUid2); sl@0: extendedInterface.AppendL(KCExtendedInterfaceUid3); sl@0: sl@0: // Set up the interface find for the default resolver. sl@0: TEComResolverParams ResolverParams; sl@0: ResolverParams.SetDataType(KImplementationTest10()); sl@0: ResolverParams.SetWildcardMatch(ETrue); // Allow wildcard matching sl@0: TUid resolverUid = {0x10009DD0}; sl@0: sl@0: // The CreateImplementationL method will return the created item. sl@0: CExampleInterface* dll = REINTERPRET_CAST(CExampleInterface*, sl@0: REComSession::CreateImplementationL(KCExample10InterfaceUid, sl@0: extendedInterface, sl@0: _FOFF(CExampleInterface,iDtor_ID_Key), sl@0: ResolverParams, sl@0: resolverUid)); sl@0: CleanupStack::PopAndDestroy(&extendedInterface); sl@0: return dll; sl@0: } sl@0: sl@0: sl@0: inline CExampleInterface* CExampleInterface::NewL7() sl@0: { sl@0: //set up extended interface; sl@0: RArray extendedInterface; sl@0: CleanupClosePushL(extendedInterface); sl@0: extendedInterface.AppendL(KCExtendedInterfaceUid1); sl@0: extendedInterface.AppendL(KCExtendedInterfaceUid2); sl@0: extendedInterface.AppendL(KCExtendedInterfaceUid3); sl@0: sl@0: // Set up the interface find for the default resolver. sl@0: TEComResolverParams ResolverParams; sl@0: ResolverParams.SetDataType(KImplementationTest10()); sl@0: ResolverParams.SetWildcardMatch(ETrue); // Allow wildcard matching sl@0: sl@0: // Set up some empty initialisation parameters sl@0: TExampleInterfaceInitParams initParams; sl@0: initParams.integer = 0; sl@0: initParams.descriptor = NULL; sl@0: sl@0: // The CreateImplementationL method will return the created item. sl@0: CExampleInterface* dll = REINTERPRET_CAST(CExampleInterface*, sl@0: REComSession::CreateImplementationL(KCExample10InterfaceUid, sl@0: extendedInterface, sl@0: _FOFF(CExampleInterface,iDtor_ID_Key), sl@0: ResolverParams, sl@0: &initParams)); sl@0: CleanupStack::PopAndDestroy(&extendedInterface); sl@0: return dll; sl@0: } sl@0: sl@0: sl@0: inline CExampleInterface* CExampleInterface::NewL8() sl@0: { sl@0: //set up extended interface; sl@0: RArray extendedInterface; sl@0: CleanupClosePushL(extendedInterface); sl@0: extendedInterface.AppendL(KCExtendedInterfaceUid1); sl@0: extendedInterface.AppendL(KCExtendedInterfaceUid2); sl@0: extendedInterface.AppendL(KCExtendedInterfaceUid3); sl@0: sl@0: // Set up the interface find for the default resolver. sl@0: TEComResolverParams ResolverParams; sl@0: ResolverParams.SetDataType(KImplementationTest10()); sl@0: ResolverParams.SetWildcardMatch(ETrue); // Allow wildcard matching sl@0: TUid resolverUid = {0x10009DD0}; sl@0: sl@0: // Set up some empty initialisation parameters sl@0: TExampleInterfaceInitParams initParams; sl@0: initParams.integer = 0; sl@0: initParams.descriptor = NULL; sl@0: sl@0: // The CreateImplementationL method will return the created item. sl@0: CExampleInterface* dll = REINTERPRET_CAST(CExampleInterface*, sl@0: REComSession::CreateImplementationL(KCExample10InterfaceUid, sl@0: extendedInterface, sl@0: _FOFF(CExampleInterface,iDtor_ID_Key), sl@0: ResolverParams, sl@0: resolverUid, sl@0: &initParams)); sl@0: CleanupStack::PopAndDestroy(&extendedInterface); sl@0: return dll; sl@0: } sl@0: sl@0: sl@0: sl@0: inline void CExampleInterface::ListImplementationsL(RImplInfoPtrArray& aImplInfoArray) sl@0: { sl@0: // Set up the interface find for the default resolver. sl@0: TEComResolverParams ResolverParams; sl@0: ResolverParams.SetDataType(KImplementationTest()); sl@0: ResolverParams.SetWildcardMatch(ETrue); // Allow wildcard matching sl@0: sl@0: REComSession::ListImplementationsL(KCExampleInterfaceUid, sl@0: ResolverParams, sl@0: aImplInfoArray); sl@0: } sl@0: sl@0: inline void CExampleInterface::ListAllImplementationsL(RImplInfoPtrArray& aImplInfoArray) sl@0: { sl@0: REComSession::ListImplementationsL(KCExampleInterfaceUid, aImplInfoArray); sl@0: } sl@0: sl@0: sl@0: inline void CExampleInterface::DoMethodL() sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: sl@0: inline TInt CExampleInterface::FireAndForget() sl@0: { sl@0: return KErrNotSupported; sl@0: } sl@0: sl@0: inline TAny* CExampleInterface::GetExtendedInterfaceL(const TUid& aInterfaceUid) sl@0: { sl@0: TAny *object = NULL; sl@0: object = REComSession::GetExtendedInterfaceL(iDtor_ID_Key, aInterfaceUid); sl@0: return object; sl@0: } sl@0: sl@0: inline void CExampleInterface::ManuallyReleaseExtendedInterfaceL(const TUid& aInterfaceUid) sl@0: { sl@0: REComSession::ManuallyReleaseExtendedInterfaceL(iDtor_ID_Key, aInterfaceUid); sl@0: }