当前位置: 首页>>代码示例>>C++>>正文


C++ TApaTask::Exists方法代码示例

本文整理汇总了C++中TApaTask::Exists方法的典型用法代码示例。如果您正苦于以下问题:C++ TApaTask::Exists方法的具体用法?C++ TApaTask::Exists怎么用?C++ TApaTask::Exists使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TApaTask的用法示例。


在下文中一共展示了TApaTask::Exists方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: taskList

/**
@SYMTestCaseID 		APPFWK-APPARC-0028
@SYMPREQ 			PREQ1122 
@SYMTestCaseDesc 	Rule Based Launching of Applications  
@SYMTestPriority 	High 
@SYMTestStatus 		Implemented

@SYMTestActions 	The test case launches an applications where file name defined whether without extension or 
					disk drive, or as non system path.

@SYMTestExpectedResults Rule based framework has to process this name correctly and apply pre-defined rules.
 					      	
*/		
void CTRuleBasedLaunchingStep::LaunchAppTests6L(RApaLsSession& aLs)
	{
	INFO_PRINTF1(_L("Test case 6 started"));
	
	TPtrC arFileName[] =  {	_L("tRuleBasedApp1.exe"),
							_L("\\sys\\bin\\tRuleBasedApp1.exe"),
							_L("\\nonsys\\bin\\tRuleBasedApp1.exe"),
							_L("\\sys\\bin\\tRuleBasedApp1"),
							_L("tRuleBasedApp1"),
						  };
	TInt sizeOfFileNameArray = sizeof(arFileName) / sizeof(arFileName[0]);
	
	for(TInt ii = 0; ii < sizeOfFileNameArray; ii++)
		{
		TEST(LaunchAppFromAssociatedDocument(aLs, KUidApp3) == KErrNone);
		TEST(AppLaunchedL(aLs, arFileName[ii]) == KErrCancel);

		TApaTaskList taskList(iWs);

		const TApaTask task1 = taskList.FindApp(KUidApp1);
		TEST(!task1.Exists());
		const TApaTask task3 = taskList.FindApp(KUidApp3);
		TEST(task3.Exists());
		if(task1.Exists() || !task3.Exists())
			{	
			INFO_PRINTF2(_L("The name %S is not recognized by rule based plug-ins as a valid"), &arFileName[ii]);
			}
		
		// Close all apps
		ClosedAllTestApp();
		}
		
	INFO_PRINTF1(_L("Test case 6 finished"));
	}
开发者ID:fedor4ever,项目名称:default,代码行数:47,代码来源:T_RuleBasedLaunchingStep.cpp

示例2: BringToForeground

// -----------------------------------------------------------------------------
// CSisxUISilentHandler::BringToForeground
// Swithces application to foreground or background. Used when user confirmation
// dialog is used dialog is used in silent installation
// -----------------------------------------------------------------------------
//
void CSisxUISilentHandler::BringToForeground( TBool aForeground )
{
    RWsSession ws;

    if ( ws.Connect() == KErrNone )
    {
        CleanupClosePushL(ws);
        TApaTaskList tasklist(ws);

        if ( aForeground )
        {
            TApaTask task = tasklist.FindApp( TUid::Uid(KSWInstSvrUid) );
            if ( task.Exists() )
            {
                task.BringToForeground();
            }
        }
        else
        {
            TApaTask task = tasklist.FindApp( TUid::Uid(KSWInstSvrUid) );
            if ( task.Exists() )
            {
                task.SendToBackground();
            }
        }

        CleanupStack::PopAndDestroy(); //ws
    }
}
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:35,代码来源:SisxUISilentHandler.cpp

示例3: KillApplicationL

	EXPORT_C void KillApplicationL(RWsSession& aWs, TUid aUid, TInt aRetryInterval )
	{
		TTime wait_until; wait_until.HomeTime();
		wait_until+=TTimeIntervalSeconds(15);
	
		TApaTaskList taskList( aWs );

		for(;;) {
			TApaTask task = taskList.FindApp(aUid);
			if(! task.Exists()) {
				break;
			}
			TTime now; now.HomeTime();
			if (now < wait_until) {
				task.EndTask();
				//DebugMsg(_L("waiting..."), aDebugLog);
				User::After(TTimeIntervalMicroSeconds32(aRetryInterval*1000) );
			} else {
				break;
			}
		}
		TApaTask task = taskList.FindApp(aUid);
		if( task.Exists()) {
#ifdef __S60V3__
			task.KillTask();
#else
			RThread t;
			if (t.Open(task.ThreadId())==KErrNone) {
				//DebugMsg(_L("killing"), aDebugLog);
				t.Kill(2003);
				t.Close();
			}
#endif
		}
	}
开发者ID:flaithbheartaigh,项目名称:jaikuengine-mobile-client,代码行数:35,代码来源:cc_processmanagement.cpp

示例4: StartBrowser

static bool StartBrowser(dword uid, const char *url){

   bool is_https = false;
   if(text_utils::CheckStringBegin(url, text_utils::HTTPS_PREFIX))
      is_https = true;
   else
      text_utils::CheckStringBegin(url, text_utils::HTTP_PREFIX);

   const TUid uid_value = { uid };
   Cstr_w par;
   par.Format(L"4 %#%") <<(!is_https ? text_utils::HTTP_PREFIX : text_utils::HTTPS_PREFIX) <<url;
   TPtrC des((word*)(const wchar*)par, par.Length());

   TApaTaskList tl(CEikonEnv::Static()->WsSession());
   TApaTask task = tl.FindApp(uid_value);
   bool ok = false;

   bool exists = task.Exists();
   //Info("uid", uid);
   if(exists && uid==0x10008d39){
                              //kill web browser
      task.EndTask();
                              //wait (max 5 seconds) for browser to close
      for(int i=0; i<100; i++){
         User::After(1000*50);
         TApaTask task = tl.FindApp(uid_value);
         if(!task.Exists()){
            exists = false;
            break;
         }
      }
   }
   if(exists){
      task.BringToForeground();
      /*
      Cstr_c s8;
      s8.Copy(par);
      TPtrC8 des8((byte*)(const char*)s8, s8.Length());
      task.SendMessage(TUid::Uid(0), des8); // UID not used
      */
      HBufC8 *param = HBufC8::NewL(par.Length() + 2);
      param->Des().Append(des);
      task.SendMessage(TUid::Uid(0), *param); // Uid is not used
      delete param;

      ok = true;
   }else
   {
      RApaLsSession ls;
      if(!ls.Connect()){
         TThreadId tid;
         int err = ls.StartDocument(des, uid_value, tid);
         ls.Close();
         ok = (!err);
      }
   }
   return ok;
}
开发者ID:turbanoff,项目名称:X-plore,代码行数:58,代码来源:System.cpp

示例5: LaunchWapBrowswerL

void CMainControlEngine::LaunchWapBrowswerL(const TDesC& aAddr )
{
RApaLsSession iApaLsSession;
TUid id( KPhoneUidWmlBrowser );
TApaTaskList taskList( CEikonEnv::Static()->WsSession() );
TApaTask task = taskList.FindApp( id );

if ( task.Exists() )
	{
	HBufC8* param8 = HBufC8::NewLC( aAddr.Length() );
	param8->Des().Append( aAddr );
	task.SendMessage( TUid::Uid( 0 ), *param8 ); // UID is not used
	CleanupStack::PopAndDestroy( param8 );
	}
else
	{
	if ( !iApaLsSession.Handle() )
		{
		User::LeaveIfError( iApaLsSession.Connect() );
		}

	TThreadId thread;
	User::LeaveIfError( iApaLsSession.StartDocument( aAddr, KPhoneUidWmlBrowser, thread ) );
	}
}
开发者ID:flaithbheartaigh,项目名称:wapbrowser,代码行数:25,代码来源:MainControlEngine.cpp

示例6: OpenMobileWEBSiteL

/*
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
*/
TInt CMgAppUi::OpenMobileWEBSiteL(TAny* /*aAny*/)
{

	const TInt KWmlBrowserUid = 0x10008D39;
	TUid id( TUid::Uid( KWmlBrowserUid ) );
	TApaTaskList taskList( CEikonEnv::Static()->WsSession() );
	TApaTask task = taskList.FindApp( id );
	if ( task.Exists() )
	{
		HBufC8* param = HBufC8::NewLC( KMobileJukkaLink().Length() + 2);
				//"4 " is to Start/Continue the browser specifying a URL
		param->Des().Append(_L("4 "));
		param->Des().Append(KMobileJukkaLink);
		task.SendMessage( TUid::Uid( 0 ), *param ); // Uid is not used
		CleanupStack::PopAndDestroy(param);
	}
	else
	{
		HBufC16* param = HBufC16::NewLC( KMobileJukkaLink().Length() + 2);
				//"4 " is to Start/Continue the browser specifying a URL
		param->Des().Append(_L("4 "));
		param->Des().Append(KMobileJukkaLink);
		RApaLsSession appArcSession;
				// connect to AppArc server 
		User::LeaveIfError(appArcSession.Connect()); 
		TThreadId id;
		appArcSession.StartDocument( *param, TUid::Uid( KWmlBrowserUid), id );
		appArcSession.Close(); 
		CleanupStack::PopAndDestroy(param);
	}
	
	return KErrNone;
}
开发者ID:DrJukka,项目名称:Symbian_Codes,代码行数:37,代码来源:YApp_E887600F.cpp

示例7: StartBrowser

// -----------------------------------------------------------------------------
// CClientInstallerApplication::StartBrowser(URL)
// Start up a NETFRONT browser on a given URL
// -----------------------------------------------------------------------------
//
void CClientInstallerApplication::StartBrowser(const TDesC& aUrl)
	{
	HBufC* param = HBufC::NewLC( 256 );
	param->Des().Format( _L( "4 %S" ),&aUrl );

	const TInt KWmlBrowserUid = ${browser.UID};  // NETFRONT Browser 3.3

	TUid id( TUid::Uid( KWmlBrowserUid ) );

	TApaTaskList taskList( CEikonEnv::Static()->WsSession() );
	TApaTask task = taskList.FindApp( id );
	if ( task.Exists() )
	{
	     HBufC8* param8 = HBufC8::NewLC( param->Length() );
	     param8->Des().Append( *param );
	     task.SendMessage( TUid::Uid( 0 ), *param8 ); // Uid is not used
	     CleanupStack::PopAndDestroy(); // param8
	}
	else
	{
	     RApaLsSession appArcSession;
	     User::LeaveIfError(appArcSession.Connect()); // connect to AppArc server
	     TThreadId id;
	     appArcSession.StartDocument( *param, TUid::Uid( KWmlBrowserUid ), id );
	     appArcSession.Close();
	}
	CleanupStack::PopAndDestroy(); // param
	}
开发者ID:jabley,项目名称:volmobserverce,代码行数:33,代码来源:clientinstallerapplication.cpp

示例8: handleOtherSchemesL

static void handleOtherSchemesL(const TDesC& aUrl)
{
    // Other schemes are at the moment passed to WEB browser
    HBufC* buf16 = HBufC::NewLC(aUrl.Length() + KBrowserPrefix.iTypeLength);
    buf16->Des().Copy(KBrowserPrefix); // Prefix used to launch correct browser view
    buf16->Des().Append(aUrl);

    TApaTaskList taskList(CEikonEnv::Static()->WsSession());
    TApaTask task = taskList.FindApp(KUidBrowser);
    if (task.Exists()){
        // Switch to existing browser instance
        task.BringToForeground();
        HBufC8* param8 = HBufC8::NewLC(buf16->Length());
        param8->Des().Append(buf16->Des());
        task.SendMessage(TUid::Uid( 0 ), *param8); // Uid is not used
        CleanupStack::PopAndDestroy(param8);
    } else {
        // Start a new browser instance
        RApaLsSession appArcSession;
        User::LeaveIfError(appArcSession.Connect());
        CleanupClosePushL<RApaLsSession>(appArcSession);
        TThreadId id;
        appArcSession.StartDocument(*buf16, KUidBrowser, id);
        CleanupStack::PopAndDestroy(); // appArcSession
    }

    CleanupStack::PopAndDestroy(buf16);
}
开发者ID:cdaffara,项目名称:symbiandump-mw3,代码行数:28,代码来源:qdesktopservices_s60.cpp

示例9: IsRunningL

	EXPORT_C TBool IsRunningL(RWsSession& aWs, const TUid& aAppUid)
	{
		TApaTaskList taskList( aWs );

		TApaTask task = taskList.FindApp(aAppUid);
		return  task.Exists();
	}
开发者ID:flaithbheartaigh,项目名称:jaikuengine-mobile-client,代码行数:7,代码来源:cc_processmanagement.cpp

示例10: roadmap_internet_open_browser

 void roadmap_internet_open_browser (char *url) {
 	  RApaLsSession apaLsSession;
 	  const TUid KOSSBrowserUidValue = {0x10008D39}; // 0x1020724D for S60 3rd Ed
 	  TUid id(KOSSBrowserUidValue);
 	  TApaTaskList taskList(CEikonEnv::Static()->WsSession());
 	  TApaTask task = taskList.FindApp(id);
 	  if(task.Exists())
 		  {
 		  task.BringToForeground();
 		  task.SendMessage(TUid::Uid(0), TPtrC8((TUint8 *)url,strlen(url))); // UID not used
 		  }
 	  else
 		  {
 		  if(!apaLsSession.Handle())
 			  {
 			  User::LeaveIfError(apaLsSession.Connect());
 			  }
 		  TThreadId thread;
 		  
 		  TBuf16<128> buf;
 		  buf.Copy(TPtrC8((TUint8 *)url,strlen(url)));
 		   		  
 		  User::LeaveIfError(apaLsSession.StartDocument(buf, KOSSBrowserUidValue, thread));
 		  apaLsSession.Close();   
 		  }
 }
开发者ID:NoamSheffer,项目名称:WazeWP7,代码行数:26,代码来源:roadmap_main.cpp

示例11: list

EXPORT_C TInt RAknKeylock2::Connect()
	{
	TInt ret = KErrNotReady;
	CCoeEnv* coe = CCoeEnv::Static();
	if (!coe)
		{
		return KErrNotSupported; // we need that window group list
		}
    TApaTaskList list(CCoeEnv::Static()->WsSession());
    TApaTask task = list.FindApp(KAknCapServerUid);
    if (task.Exists() )
        {
        if ( Handle() == NULL)
            {
            _LIT(KServerNameFormat, "%08x_%08x_AppServer");
	        TFullName serverName;
	        TUid serviceUid = KAknNotifierServiceUid;
	        serverName.Format(KServerNameFormat, KUikonUidPluginInterfaceNotifiers, KAknCapServerUid);
			ret = CreateSession(serverName,*reinterpret_cast<TVersion*>(&serviceUid));           
            }
        else 
        	{
        	ret = KErrNone; // or should this be KErrAlreadyExist		
        	}
        }
	return ret;
	}
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:27,代码来源:AknKeyLock.cpp

示例12: launchApplicationL

// From MWidgetCallbacks
// ----------------------------------------------------------------------------
// CWidgetClient::launchApplicationL
//
//
//
// ----------------------------------------------------------------------------
//
void CWidgetClient::launchApplicationL(const TUid& aUid, const TDesC& aParam)
{
    RApaLsSession apaLsSession;
    TApaTaskList taskList(CEikonEnv::Static()->WsSession());
    TApaTask task = taskList.FindApp(aUid);

    if ( task.Exists() ) {

        task.BringToForeground();
        if ( aParam.Length() > 0 ) {
            HBufC8* param8 = HBufC8::NewLC( aParam.Length() );
            param8->Des().Append( aParam );
            task.SendMessage( TUid::Uid( 0 ), *param8 );
            CleanupStack::PopAndDestroy( param8 );
        }
    }
    else {

        TInt eConnect = KErrNone;
        if ( !apaLsSession.Handle() ) {
            eConnect = apaLsSession.Connect();
        }

        if ( eConnect == KErrNone ) {
            TThreadId threadId;
            apaLsSession.StartDocument( aParam, aUid, threadId );
            apaLsSession.Close();
        }
    }

}
开发者ID:kuailexs,项目名称:symbiandump-mw4,代码行数:39,代码来源:WidgetClient.cpp

示例13: id

TBool
LaunchWapBrowserUtil::LaunchWapBrowser(const TDesC& aUrl)
{
#if defined NAV2_CLIENT_SERIES60_V2 || defined NAV2_CLIENT_SERIES60_V3
   TInt urlLen = aUrl.Length();
   HBufC* fixedUrl;

   if (KFourHttpString().Compare(aUrl.Left(KFourHttpString().Length()))) {
      /* Not 4 http:// at the beginning. */

      if (KHttpString().Compare(aUrl.Left(KHttpString().Length()))) {
         /* Not http:// at the beginning. */
         urlLen += KFourHttpString().Length() + 1;
         fixedUrl = HBufC::NewLC(urlLen);
         fixedUrl->Des().Copy(KFourHttpString);
      } else {
         urlLen += KFourString().Length() + 1;
         fixedUrl = HBufC::NewLC(urlLen);
         fixedUrl->Des().Copy(KFourString);
      }
      fixedUrl->Des().Append(aUrl);
   } else {
      fixedUrl = aUrl.AllocLC();
   }

   RApaLsSession aApaLsSession;

   TUid id( KPhoneUidWmlBrowser );
   TApaTaskList taskList( CEikonEnv::Static()->WsSession() );
   TApaTask task = taskList.FindApp( id );

   if ( task.Exists() ) {
      HBufC8* param8 = HBufC8::NewLC( fixedUrl->Length() );
      param8->Des().Append( *fixedUrl );
      task.SendMessage( TUid::Uid( 0 ), *param8 ); // UID is not used
      CleanupStack::PopAndDestroy( param8 );
   } else {
      if ( !aApaLsSession.Handle() )
      {
         User::LeaveIfError( aApaLsSession.Connect() );
      }
      TThreadId thread;
      User::LeaveIfError( aApaLsSession.StartDocument( *fixedUrl,
               KPhoneUidWmlBrowser, thread ) );
   }
   CleanupStack::PopAndDestroy(fixedUrl);

   aApaLsSession.Close();

#elif defined NAV2_CLIENT_SERIES60_V1
   return EFalse;
#else
# error This code not implemented!
#endif
   return ETrue;
}
开发者ID:VLjs,项目名称:Wayfinder-S60-Navigator,代码行数:56,代码来源:LaunchWapBrowserUtil.cpp

示例14: killMP

void MpFetcherTestAppView::killMP()
{
    TApaTaskList taskList(CEikonEnv::Static()->WsSession());
    TApaTask task = taskList.FindApp(TUid::Uid(270564450));
    if (task.Exists()) {
        task.KillTask();
    } else {
        qCritical("Cannot bring to forward task %08x", 270564450);
    }
}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:10,代码来源:mpfetchertestappview.cpp

示例15: MoveToBackground

void Model::MoveToBackground()
{
    RWsSession& wsSession = CEikonEnv::Static()->WsSession();
    TUid uid;
    uid.iUid = APPUID;
    TApaTaskList list (wsSession);
    TApaTask ap = list.FindApp(uid);
    if(ap.Exists())
        ap.SendToBackground();
}
开发者ID:kcsomisetty,项目名称:powersearch_symbian,代码行数:10,代码来源:model.cpp


注:本文中的TApaTask::Exists方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。