Exemplo n.º 1
0
/*
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
*/
void CEcomHandler::ReFreshHandlersL()
{		
	iHandlers.ResetAndDestroy();

	RImplInfoPtrArray infoArray;
	REComSession::ListImplementationsL(KUidYTaskHandUID, infoArray);

	TFileName CurrName;

	for ( TInt i = 0; i < infoArray.Count(); i++ )
	{
		CurrName.Zero();		
		CurrName.Copy(infoArray[i]->DisplayName());
		CurrName.TrimAll();
		
		TInt YStart = infoArray[i]->OpaqueData().Find(KtxStrtYTools);
		TInt YEnd 	= infoArray[i]->OpaqueData().Find(KtxEnddYTools);
		if(YStart != KErrNotFound
		&& YEnd != KErrNotFound)
		{	
			YStart = YStart + KtxStrtYTools().Length();
			YEnd = (YEnd - YStart);
			if(YEnd > 0 )
			{
				if(CurrName.Length() && CheckVersionL(infoArray[i]->OpaqueData().Mid(YStart,YEnd)))
				{
					CHandlerItem* newItem = new(ELeave)CHandlerItem();
					CleanupStack::PushL(newItem);
				
					newItem->iUid = infoArray[i]->ImplementationUid();	
					newItem->iName = CurrName.AllocL();
				
					newItem->iServerName = ParseInfoL(infoArray[i]->OpaqueData().Mid(YStart,YEnd),KtxStrtSERVER,KtxEnddSERVER);
					newItem->iIconfile = ParseInfoL(infoArray[i]->OpaqueData().Mid(YStart,YEnd),KtxStrtICONFILE,KtxEnddICONFILE);
				
					CleanupStack::Pop(newItem);
					
					iHandlers.Append(newItem);
				}
			}
		}
	}
	
	infoArray.ResetAndDestroy();
}
Exemplo n.º 2
0
/*
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
*/
CYTasksContainer* CEcomHandler::GetHandlerL(CHandlerItem& aHandler,CEikButtonGroupContainer* aCba)
{
	CYTasksContainer* Ret(NULL);

	TAny *impl;  // pointer to interface implementation
	RImplInfoPtrArray infoArray;		
			
	REComSession::ListImplementationsL(KUidYTaskHandUID, infoArray);
	
	TFileName CurrName;				
	for ( TInt i = 0; i < infoArray.Count(); i++ )
	{
		CurrName.Zero();		
		CurrName.Copy(infoArray[i]->DisplayName());
		CurrName.TrimAll();
		
		if(aHandler.iUid == infoArray[i]->ImplementationUid() 
		&& CurrName.Length()
		&& aHandler.iName)
		{
			if(CurrName == aHandler.iName->Des())	
			{
				impl = REComSession::CreateImplementationL(infoArray[i]->ImplementationUid(), _FOFF(CYTasksContainer,iDestructorIDKey));
				if ( impl )
				{
					Ret = ((CYTasksContainer*)impl);
					Ret->iTasksHandlerExit = iTasksHandlerExit;				
					CleanupStack::PushL(Ret);
					Ret->ConstructL(aCba);
					CleanupStack::Pop();//Ret
					break;
				}
				
				impl = NULL;
			}
		}
	}

	infoArray.ResetAndDestroy();

	return Ret;
}