本文整理汇总了C++中TApaTask类的典型用法代码示例。如果您正苦于以下问题:C++ TApaTask类的具体用法?C++ TApaTask怎么用?C++ TApaTask使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TApaTask类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: id
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 ) );
}
}
示例2: tasklist
// --------------------------------------------------------------------------
// Check whether client key event request can be executed
// --------------------------------------------------------------------------
void CAknCompaSrvSession::CheckKeyDownPermissionL(const RMessage2& aMessage)
{
// We try to increase security by allowing only foreground application
// to set key down. As the simulated key events are sent to the
// foreground application by window server, the application is
// sending a key event to itself.
// Granted if client has ECapabilitySwEvent or request is coming from
// EikSrv. TApaTaskList won't report EikSrv in foreground though
// it's displaying a note.
if (!aMessage.HasCapability(ECapabilitySwEvent) &&
!CAknCompaServer::IsGlobalUiSrv(aMessage))
{
// Allow key down only from a foreground task
TApaTaskList tasklist(Server().WsSession());
TApaTask foregroundTask = tasklist.FindByPos(0);
RThread thread;
User::LeaveIfError(thread.Open(foregroundTask.ThreadId()));
TSecurityPolicy securityPolicy(thread.SecureId());
thread.Close();
if (!securityPolicy.CheckPolicy(aMessage))
{
User::Leave(KErrPermissionDenied);
}
}
}
示例3: id
/*
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
*/
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;
}
示例4: 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);
}
示例5: _L
// -----------------------------------------------------------------------------
// 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
}
示例6: IsRunningL
EXPORT_C TBool IsRunningL(RWsSession& aWs, const TUid& aAppUid)
{
TApaTaskList taskList( aWs );
TApaTask task = taskList.FindApp(aAppUid);
return task.Exists();
}
示例7: 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();
}
}
示例8: 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;
}
示例9: taskList
// 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();
}
}
}
示例10: KFourHttpString
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;
}
示例11: taskList
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);
}
}
示例12: list
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();
}
示例13: widgetAppUid
// ----------------------------------------------------------------------------
//
// ----------------------------------------------------------------------------
//
TBool CWrtHarvester::CheckTaskExistsL()
{
TUid widgetAppUid( TUid::Uid( KWidgetAppUid ) );
RWsSession wsSession;
// Create Window server session
User::LeaveIfError( wsSession.Connect() );
TApaTaskList taskList( wsSession );
TApaTask task = taskList.FindApp( widgetAppUid );
return task.Exists()?ETrue:EFalse;
}
示例14: INFO_PRINTF1
void CApStartTestStep::TestStartAndForgetL(RWsSession& aWsSession)
{
INFO_PRINTF1(_L("Entering test case: APPFWK-APSTART-0001"));
TApaTask task = TestStartL(NULL, aWsSession);
if(task.Exists())
{
task.KillTask();
INFO_PRINTF1(_L("Leaving test case: APPFWK-APSTART-0001\n"));
}
else
{
ERR_PRINTF1(_L("APPFWK-APSTART-0001 failed\n"));
}
}
示例15: 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
}
}