コード例 #1
0
TUid GetAppUidByWndGroupIdL( RWsSession &aWs, TInt aWndGroupId )
    {
    CApaWindowGroupName* wg = CApaWindowGroupName::NewLC(aWs,aWndGroupId);
    TUid id = wg->AppUid();
    CleanupStack::PopAndDestroy(wg);    	
    return id;
    }
コード例 #2
0
TUid CGSPenInputModel::AppUidFromWndGroupIdL( TInt aWndGrpId )
    {
    RWsSession &ws = CCoeEnv::Static()->WsSession();    
    CApaWindowGroupName* wg = CApaWindowGroupName::NewLC(ws,aWndGrpId);
    TUid id = wg->AppUid();
    CleanupStack::PopAndDestroy(wg);    
    return id;    
    }
/*!
* Get the uid of application in foreground.
* @return Application uid for the foreground application.
*/
unsigned int CxuiApplicationFrameworkMonitorPrivate::focusedApplicationUid()
{
    unsigned int uid(0);
    int focusWgId(mWsSession.GetFocusWindowGroup());

    TRAP_IGNORE({
        CApaWindowGroupName* wgn = CApaWindowGroupName::NewLC(mWsSession, focusWgId);
        uid = wgn->AppUid().iUid;
        CleanupStack::PopAndDestroy(wgn);
    });
コード例 #4
0
TUid AppUidFromWndGroupIdL(TInt aWndGrpId)
    {
    RWsSession &ws = CCoeEnv::Static()->WsSession();
    //TInt wgId =ws.GetFocusWindowGroup();
    CApaWindowGroupName* wg = CApaWindowGroupName::NewLC(ws,aWndGrpId);

    TUid id = wg->AppUid();
    CleanupStack::PopAndDestroy(wg);    	
    return id;
    
    }
コード例 #5
0
void  CWindowChangeMonitor::SetWgL(TInt aFirstWg)
    {
    if(iCurrentWg != aFirstWg)
        {
        iCurrentWg = aFirstWg; 
        CApaWindowGroupName* name = CApaWindowGroupName::NewLC(iSession, aFirstWg);
        iNxtUid = name->AppUid();
        CleanupStack::PopAndDestroy();
        }
    iCurrentUid = iNxtUid;
    iAborted = 0;
    }
コード例 #6
0
ファイル: server.cpp プロジェクト: Seikareikou/symbian
void CMyServer::GetWgEvent()
    {
    #ifdef __DEBUG
    __LOGSTR1("GetWgEvent,iStatus: %d",iStatus.Int());
    #endif
   if(iStatus == KErrNone)
	{
    TWsEvent e;
    iWs.GetEvent(e);
    #ifdef __DEBUG
    __LOGSTR1("event: %d",e.Type());
    #endif
	}
    TInt WgId = iWs.GetFocusWindowGroup();
    CApaWindowGroupName* gn = CApaWindowGroupName::NewLC(iWs, WgId);
    #ifdef __DEBUG
    __LOGSTR2("focused app with uid: 0x%x,config uid: 0x%x",gn->AppUid(),iConfig.iUid);
    #endif
    if(gn->AppUid() == iConfig.iUid)
	{

    	Show();
	//Draw();
    //iWindow.SetVisible(ETrue);
    //iWs.Flush();
    #ifdef __DEBUG
	__LOGSTR("UIDs ==");
    #endif
	}else{
	//iWindow.SetVisible(EFalse);
		Hide();
	iWs.Flush();
    #ifdef __DEBUG
	__LOGSTR("UIDs !=");
    #endif
	}
    WaitWgEvent();
    }
コード例 #7
0
// -----------------------------------------------------------------------------
// CPodcastAppUi::HandleCommandL(TInt aCommand)
// takes care of command handling
// -----------------------------------------------------------------------------
//
void CPodcastAppUi::HandleCommandL( TInt aCommand )
    {
    switch ( aCommand )
        {
        case EAknSoftkeyExit:
            {
            Exit();
            break;
            }
        case EEikCmdExit:
        	{
        	// we want to prevent red button from closing podcatcher, and
        	// instead we send it to background
        	// however, we want to respect the task manager (fast swap) close
        	// command, so we check if task manager is the focussed window group
        	
        	RWsSession& ws = iEikonEnv->WsSession();
			TInt wgid = ws.GetFocusWindowGroup();
			CApaWindowGroupName* gn = CApaWindowGroupName::NewLC(ws, wgid);
			TUid activeAppUid = gn->AppUid();
			CleanupStack::PopAndDestroy(gn);
        	
			const TUid KUidFastSwap = { 0x10207218 };
			if (activeAppUid == KUidFastSwap)
				{
				// closed by task manager
				Exit();
				}
			else
        		{
        		// red button pressed
				TApaTask task(iEikonEnv->WsSession());
				task.SetWgId(iEikonEnv->RootWin().Identifier());
				task.SendToBackground(); 
        		}   		
			break;
        	}
	case EPodcastHelp:
        	{	
        	HlpLauncher::LaunchHelpApplicationL(iEikonEnv->WsSession(), HelpContextL());
        	}
        	break;      	
        default:
            break;      
        }
    }
コード例 #8
0
void CWindowChangeMonitor::WgChangeL(TInt aFirstWg)
    {
    CApaWindowGroupName* name = CApaWindowGroupName::NewLC(iSession, aFirstWg);
    iNxtUid = name->AppUid();
    iCurrentWg = aFirstWg; 
    
    if(iNxtUid != iCurrentUid)
        {
        const TInt flags = AknTransEffect::TParameter::EFlagNone;
        GfxTransEffect::BeginFullScreen(
            AknTransEffect::EApplicationActivate, 
            TRect(0,0,0,0),
            AknTransEffect::EParameterType, 
            AknTransEffect::GfxTransParam(iNxtUid, iCurrentUid, flags)); 
        }
    CleanupStack::PopAndDestroy();  
    iAborted = 0;
    }
コード例 #9
0
ファイル: ImageCapture.cpp プロジェクト: fedor4ever/testfw
// ------------------------------------------------------------------------------
// CImageCapture::RunL
// Issues request to save Images and notifies the observer after saving the image
// ------------------------------------------------------------------------------
//
void CImageCapture::RunL()
{
	switch (iScreenShotStatus)
	{
		case EIdle:
		break;
			
		case EWaiting:
			{
			RWsSession& wsSession = iEEnv->WsSession();
			TInt id = wsSession.GetFocusWindowGroup();
			CApaWindowGroupName* lApaWGName;
			lApaWGName = CApaWindowGroupName::NewLC(wsSession,id);
			
			TUid uid = lApaWGName->AppUid();
			
			if(uid.operator ==(iAppUid) )
   			   Fire(ECapturing);
			else
				FireCapture(1000000);
			
			CleanupStack::PopAndDestroy(); // lApaWGName
			
			}
			break;
			
		case ECapturing:
			DoCaptureL();
			break;
			
	
		case ESaveComplete:
		default:
			iObserver.PerformNextAction(1);
			delete this;		
			
	}          
}
コード例 #10
0
// Each test step must supply a implementation for doTestStepL
enum TVerdict CTestAppLoaderEndTask::doTestStepL( void )
	{
	// Printing to the console and log file
	INFO_PRINTF1(_L("TEST-> END TASK"));

	TPtrC	program;
	if ( !GetStringFromConfig(ConfigSection(), KProgram, program) )
		{
		ERR_PRINTF2(KErrMissingParameter, &KProgram());
		SetTestStepResult(EFail);
		}
	else
		{
		RApaLsSession	apaLsSession;
		User::LeaveIfError(apaLsSession.Connect());
		CleanupClosePushL(apaLsSession);
	    User::LeaveIfError(apaLsSession.GetAllApps());

		RWsSession	ws;
		User::LeaveIfError(ws.Connect());
		CleanupClosePushL(ws);
		
	    TInt					numWindowGroups = ws.NumWindowGroups();
	    CArrayFixFlat<TInt>*	windowGroupList = new(ELeave) CArrayFixFlat<TInt>(numWindowGroups);
	    CleanupStack::PushL(windowGroupList);

	    // Populate array with current group list ids
	    User::LeaveIfError(ws.WindowGroupList(windowGroupList));

	    CApaWindowGroupName*	windowGroupName = CApaWindowGroupName::NewLC(ws);

	    /* Note: we use windowGroupList->Count() instead of numWindowGroups, as in the middle of the
	     * update the list could change in length (or worse, be reduced) thus producing an out of bounds
	     * error if numWindowGroups were used
	     */
	    TBool	searching=ETrue;
	    for ( TInt i=0; (i<windowGroupList->Count()) && searching; ++i )
	    	{
	        TInt	wgId = windowGroupList->At(i);
	        windowGroupName->ConstructFromWgIdL(wgId);

	        TUid	appUid = windowGroupName->AppUid();

	        TApaAppInfo	appInfo;
	        HBufC* 		appCaption = NULL;
	        // Some applications, like midlets, may not provide any info
	        if (apaLsSession.GetAppInfo(appInfo, appUid) == KErrNone)
	        	{
	            appCaption = appInfo.iCaption.AllocL();
	        	}
	        else
	        	{
	            appCaption = windowGroupName->Caption().AllocL();
	        	}
            CleanupStack::PushL(appCaption);

	        // Only list 'visible' applications
	        if ( appCaption->Length() )
	        	{
	            TPtrC	caption=*appCaption;
		        INFO_PRINTF2(KLogTask, &caption);

		        if ( program.CompareC(caption)==0 )
		        	{
					searching=EFalse;
					TApaTask	task(ws);
					task.SetWgId(wgId);
					if (task.Exists())
						{
						task.EndTask();
						}
					else
						{
						ERR_PRINTF2(KErrTaskNotFound, &program);
						SetTestStepResult(EFail);
						}
		        	}
				}
            CleanupStack::Pop(1, appCaption); // taskEntry, appCaption
	    	}

	    if ( searching )
	    	{
			ERR_PRINTF2(KErrTaskNotFound, &program);
			SetTestStepResult(EFail);
	    	}
	    CleanupStack::PopAndDestroy(4, &apaLsSession);    // windowGroupName, windowGroupList
		}

	// test steps return a result
	return TestStepResult();
	}