예제 #1
0
void CTestAppUi::TestExitAndDoubleActivationL()
	{
	RDebug::Print(_L("TVIEW1 : Test Exit And Double Activation"));
	CreateActivateViewEventL(TVwsViewId(KUidViewAppTwo,KUidViewOne),KNullUid,KNullDesC8);
	CreateActivateViewEventL(TVwsViewId(KUidViewAppTwo,KUidViewTwo),KUidActivationExit,KNullDesC8);
	CreateActivateViewEventL(TVwsViewId(KUidViewAppTwo,KUidViewTwo),KNullUid,KNullDesC8);
	}
예제 #2
0
void CTestAppUi::TestServerEnduranceWithKillsL()
	{
	RDebug::Print(_L("TVIEW1 : Test Server Endurance With Client Kills"));
	iDoKills=ETrue;
	DoNextEnduranceTestActivation();
	ActivateViewL(TVwsViewId(KUidViewAppTwo,KUidViewOne),KUidEndurance,KNullDesC16);
	ActivateViewL(TVwsViewId(KUidViewAppThree,KUidViewOne),KUidEndurance,KNullDesC16);
	}
예제 #3
0
/**
Handles all commands in the view
Called by the UI framework when a command has been issued.
The command Ids are defined in the .hrh file.

@param aCommand The command to be executed
@see CQikViewBase::HandleCommandL
*/
void CMobileOfficeImageView::HandleCommandL(CQikCommand& aCommand)
{
	CMobileOfficeAppUi* app = (CMobileOfficeAppUi*)iEikonEnv->EikAppUi();			
	app->CheckDemo();

	switch(aCommand.Id())
		{
		case EMobileOfficeCmdPicture:
				{
					iEikonEnv->EikAppUi()->ActivateViewL(TVwsViewId(KUidMobileOfficeApp,KUidMobileOfficeImageView));
					break;
				}
	
		case EMobileOfficeCmdProp:
				{
					iEikonEnv->EikAppUi()->ActivateViewL(TVwsViewId(KUidMobileOfficeApp,KUidMobileOfficePropView));
					break;
				}
	
       	case EMobileOfficeCmdOpen:	
				{
					iEikonEnv->EikAppUi()->ActivateViewL(TVwsViewId(KUidMobileOfficeApp,KUidMobileOfficeEditorView));
					break;
				}
		case EMobileOfficeCmdHelp:
			{
				TCoeHelpContext helpContext(KUidMobileOfficeApp,_L("Thumbnail"));
				CQikHelpLauncher::LaunchLD(helpContext);
				break;
			}
		case EMobileOfficeCmdAppAbout:
				{
					CQikSimpleDialog* dialog = new(ELeave) CQikSimpleDialog;
					dialog->PrepareLC(R_MY_SIMPLE_ABOUT_DIALOG);
					dialog->RunL();
					CleanupStack::PopAndDestroy(dialog);
					break;
				}
		case EQikCmdGoBack:
		{
			iEikonEnv->EikAppUi()->ActivateViewL(TVwsViewId(KUidMobileOfficeApp,app->OpenDocument()->NextViewID()));
			break;
		}
		// Go back and exit command will be passed to the CQikViewBase to handle.
		default:
			CQikViewBase::HandleCommandL(aCommand);
			break;
		}
	}
예제 #4
0
void CTestAppUi::TestForegroundChangeWhileEventsOnQueueL()
	{
	RDebug::Print(_L("TVIEW1 : Test Foreground Change While Events On Queue"));
	// Activate a view in TView2 first to make sure that the app is available
	CCoeAppUi::ActivateViewL(TVwsViewId(KUidViewAppTwo,KUidViewOne));
	// Activate a view in TView1 to get into a known state so that we can do a check of the outcome of the real test
	CCoeAppUi::ActivateViewL(TVwsViewId(KUidViewAppOne,KUidViewOne));

	// Create an activation event for TView2 and stall long enough so that the event will be waiting for the deactivation
	// in this app. Then immediately bring this app into the foreground.
	CreateActivateViewEventL(TVwsViewId(KUidViewAppTwo,KUidViewOne),KNullUid,KNullDesC8);
	User::After(50000);	// 0.5 sec
	TApaTaskList taskList(CEikonEnv::Static()->WsSession());
	TApaTask task=taskList.FindApp(KUidViewAppOne);
	task.BringToForeground();
	}
예제 #5
0
void CTestAppUi::TestSlowDeactivationL()
	{
	RDebug::Print(_L("TVIEW2 : Test Slow Deactivation"));
	STATIC_CAST(CTestView*,View(VIEW_ONE))->iSlowDeactivation=ETrue;
	STATIC_CAST(CTestView*,View(VIEW_TWO))->iSlowDeactivation=ETrue;
	CCoeAppUi::ActivateViewL(TVwsViewId(KUidViewAppTwo,KUidViewOne));
	}
예제 #6
0
void CTestView::HandleCommandL(TInt aCommand)
	{
	switch (aCommand)
		{
	case ETaskToAppAViewOne:
		ActivateViewL(TVwsViewId(KUidViewAppOne,KUidViewOne));
		break;
	case ETaskToAppAViewTwo:
		ActivateViewL(TVwsViewId(KUidViewAppOne,KUidViewTwo));
		break;
	case EDNLViewAppC:
		//ActivateViewL(TVwsViewId(KUidViewAppCApp,KUidViewAppCOne));
		break;
	default:
		break;
		}
	}
예제 #7
0
void CTestAppUi::CheckForegroundChangeWhileEventsOnQueue()
	{
	TVwsViewId activeView;
	if (GetActiveViewId(activeView)!=KErrNotFound && activeView==TVwsViewId(KUidViewAppOne,KUidViewOne))
		{
		iEikonEnv->InfoMsg(_L("Test passed"));
		}
	else
		{
		iEikonEnv->InfoMsg(_L("Test failed"));
		}
	}
TKeyResponse CBuddycloudBeaconSettingsList::OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType) {
	TKeyResponse aResult = EKeyWasNotConsumed;

	if(aType == EEventKey) {
		if(aKeyEvent.iCode == EKeyLeftArrow) {
			iCoeEnv->AppUi()->ActivateViewL(TVwsViewId(TUid::Uid(APPUID), KNotificationsSettingsViewId));

			aResult = EKeyWasConsumed;
		}
		else if(aKeyEvent.iCode == EKeyRightArrow) {
			iCoeEnv->AppUi()->ActivateViewL(TVwsViewId(TUid::Uid(APPUID), KAccountSettingsViewId));

			aResult = EKeyWasConsumed;
		}
	}
	
	if(aResult == EKeyWasNotConsumed) {
		CAknSettingItemList::OfferKeyEventL(aKeyEvent, aType);
	}
	
	return aResult;
}
void CUploadViewImpl::Prompt(const TDesC& FileName, MUploadCallBack* CallBack)
{
	CALLSTACKITEM_N(_CL("CUploadViewImpl"), _CL("Prompt"));
	*iNextViewId=TVwsViewId();

	if (!iCallBack) {
		iFileName=FileName;
		iCallBack=CallBack;
		if (iContainer) iNext=true;
		else AppUi()->ActivateLocalViewL(iId);
	} else {
		iCallBacks->AppendL(TCallBackItem(FileName, CallBack));
	}
}
예제 #10
0
void CTestAppUi::TestSuccesiveAllocFailL()
	{
	RDebug::Print(_L("TVIEW2 : Test Succesive Alloc Failure During Activation Until Success"));	
	TInt error=KErrUnknown;
	for(TInt fail=1;error!=KErrNone;fail++)
		{
		RDebug::Print(_L("TVIEW2 : Next Failure Test"));
		__UHEAP_FAILNEXT(fail);// fail on succesive allocations
		__UHEAP_MARK;
		TRAP(error,CCoeAppUi::ActivateViewL(TVwsViewId(KUidViewAppTwo,KUidViewOne)));
		__UHEAP_MARKEND; // Check nothing has alloc'd due to fail
		}
	__UHEAP_SETFAIL(RHeap::ENone,0);// turn failure off
	}
예제 #11
0
void CTestAppUi::DoNextEnduranceTestActivation()
	{
	if (iAutoTestTimer->IsActive())
		iAutoTestTimer->Cancel();

	// Find a new view to activate
	TUid viewUid = (Math::Rand(iRandSeed)<KMaxTInt/2) ? KUidViewOne : KUidViewTwo;
	TUid appUid = KNullUid;
	TInt rand=Math::Rand(iRandSeed);
	if (rand<=KMaxTInt/3)	// 1 in 3 chance
		{
		appUid=KUidViewAppOne;
		}
	else if (rand/2<=KMaxTInt/3)	
		{
		appUid=KUidViewAppTwo;
		}
	else	
		{
		appUid=KUidViewAppThree;
		}

	// Decide whether any special condition should be used with activation.
	// This can mean the activation will be sluggish, a deactivation will be sluggish
	// or the activation will leave
	TUid messageUid=KNullUid;
	rand=Math::Rand(iRandSeed);
	if (rand<=KMaxTInt/10)	// 1 in 10 chance
		{
		messageUid=KUidActivationOOM;
		}
	else if (rand/2<=KMaxTInt/10)
		{
		messageUid=KUidSluggishActivation;
		}
	else if (rand/3<=KMaxTInt/10)
		{
		STATIC_CAST(CTestView*,View(VIEW_ONE))->iSluggishDeactivation=ETrue;
		}

	// Start the timer again with a new time delay
	TTimeIntervalMicroSeconds32 delay(KMinimumDelay+KMinimumDelay*Math::Rand(iRandSeed)/KMaxTInt);
	iAutoTestTimer->Start(delay,delay,TCallBack(EnduranceTestCallBack,this));
	TRAPD(err,ActivateViewL(TVwsViewId(appUid,viewUid),messageUid,KNullDesC));
	__ASSERT_ALWAYS(!err,User::Panic(_L("ActivateViewL(TVwsViewId(appUid,viewUid),messageUid,KNullDesC)"),err));

	}
void CFinalQuery::AddShortcutL()
{
	iState = EShowShortcutHelp;
	TBool result = ShowOkCancelMessageL( R_TEXT_WELCOME_ADD_JAIKU_TEXT, R_TEXT_WELCOME_ADD_JAIKU_TITLE );
	if (result)
		{
			iState = ELaunchingSettings;
			
			TUint major = 0;
			TUint minor = 0;
			
			TUid applicationUid;
			TUid viewUid; 
			
			GetS60PlatformVersionL( Fs(), major, minor );
			
			if ( major >= 3 && minor >= 1 )
				{
					applicationUid = TUid::Uid( 0x100058EC );
					viewUid = TUid::Uid( 1 );
				}
			else
				{									
					applicationUid = TUid::Uid( 0x100058EC );
					viewUid = TUid::Uid( 4 );
				}
			
			CAknViewAppUi* viewAppUi = static_cast<CAknViewAppUi*>(CEikonEnv::Static()->AppUi());
			viewAppUi->ActivateViewL( TVwsViewId( applicationUid, viewUid ) );
			NotifyActionReadyL();
		}
	else
		{
			iState = EQueryFinalAction;
		}
}					
예제 #13
0
void CTestAppUi::TestStartMissingAppL()
	{
	RDebug::Print(_L("TVIEW2 : Test Start Missing App"));
	CCoeAppUi::ActivateViewL(TVwsViewId(KUidPasswordMode,KUidViewOne));
	}
예제 #14
0
void CTestAppUi::TestSlowActivationL()
	{
	RDebug::Print(_L("TVIEW2 : Test Slow Activation"));
	ActivateViewL(TVwsViewId(KUidViewAppTwo,KUidViewOne),KUidSlowActivation,KNullDesC16);
	}
예제 #15
0
void CTestAppUi::TestWaitingActivationL()
	{
	RDebug::Print(_L("TVIEW2 : Test Waiting Activation"));
	ActivateViewL(TVwsViewId(KUidViewAppTwo,KUidViewOne),KUidStartScheduler,KNullDesC16);
	}
예제 #16
0
/**
Returns the view Id

@return Returns the Uid of the view
*/
TVwsViewId Cayfly_s60AppView::ViewId()const
    {
    return TVwsViewId(KUidayfly_s60App, KUidayfly_s60AppView);
    }
예제 #17
0
/**
Returns the view Id

@return Returns the Uid of the view
*/
TVwsViewId CMobileOfficeImageView::ViewId()const
	{
	// The app UID3 and the view UID need to be defined in MobileOfficeExternalInterface.h
	return TVwsViewId(KUidMobileOfficeApp, KUidMobileOfficeImageView);
	}
예제 #18
0
/***********************************************************
 *  View id 
 */
TVwsViewId CWazeCameraView::ViewId() const
{
	return TVwsViewId( KUidFreeMapApp, KWazeCameraViewId );
}
예제 #19
0
void CTestAppUi::DoNextEnduranceTestActivation()
	{
	if (iAutoTestTimer->IsActive())
		iAutoTestTimer->Cancel();
	
	TInt rand=0;
	if (iDoKills)
		{
		// Occasionally we kill another TVIEW
		TUid killAppUid=KNullUid;
		rand=Math::Rand(iRandSeed);
		if (rand<=KMaxTInt/8)	// 1 in 8 chance
			{
			killAppUid=KUidViewAppTwo;
			}
		else if (rand/2<=KMaxTInt/8)
			{
			killAppUid=KUidViewAppThree;
			}
			
		if (killAppUid!=KNullUid)
			{
			TApaTaskList taskList(CEikonEnv::Static()->WsSession());
			TApaTask task=taskList.FindApp(killAppUid);
			if (task.Exists())
				{
				RDebug::Print(_L("TVIEW1 : ********************* KILLING %x ********************* "),killAppUid.iUid);
				task.KillTask();
				User::After(10000);	// 0.1 sec
				}

			// Start the timer again with a new time delay
			TTimeIntervalMicroSeconds32 delay(KMinimumDelay+KMinimumDelay*Math::Rand(iRandSeed)/KMaxTInt);
			iAutoTestTimer->Start(delay,delay,TCallBack(EnduranceTestCallBack,this));
			
			TRAPD(err,ActivateViewL(TVwsViewId(killAppUid,KUidViewOne),KUidEndurance,KNullDesC16));
			__ASSERT_ALWAYS(!err,User::Panic(_L("ActivateViewL(TVwsViewId(killAppUid,KUidViewOne),KUidEndurance,KNullDesC16)"),err));
			return;
			}
		}	
	// Otherwise we do another random activation

	// Find a new view to activate
	TUid viewUid = (Math::Rand(iRandSeed)>KMaxTInt/2) ? KUidViewOne : KUidViewTwo;
	TUid appUid = KNullUid;
	rand=Math::Rand(iRandSeed);
	if (rand<=KMaxTInt/3)	// 1 in 3 chance
		{
		appUid=KUidViewAppOne;
		}
	else if (rand/2<=KMaxTInt/3)	
		{
		appUid=KUidViewAppTwo;
		}
	else	
		{
		appUid=KUidViewAppThree;
		}

	// Decide whether any special condition should be used with activation.
	// This can mean the activation will be sluggish, a deactivation will be sluggish
	// or the activation will leave or exit
	TUid messageUid=KNullUid;
	rand=Math::Rand(iRandSeed);
	if (rand<KMaxTInt/10)	// 1 in 10 chance
		{
		messageUid=KUidActivationOOM;
		}
	else if (rand/2<KMaxTInt/10)
		{
		messageUid=KUidSluggishActivation;
		}
	else if (rand/3<KMaxTInt/10)
		{
		STATIC_CAST(CTestView*,View(VIEW_ONE))->iSluggishDeactivation=ETrue;
		}
	else if (rand/4<=KMaxTInt/10 && iDoKills)
		{
		STATIC_CAST(CTestView*,View(VIEW_ONE))->iExitDeactivation=ETrue;
		}
	else if (rand<=KMaxTInt && iDoKills && appUid==KUidViewAppTwo)
		{
		messageUid=KUidActivationExit;
		}

	// Start the timer again with a new time delay
	TTimeIntervalMicroSeconds32 delay(KMinimumDelay+KMinimumDelay*Math::Rand(iRandSeed)/KMaxTInt);
	iAutoTestTimer->Start(delay,delay,TCallBack(EnduranceTestCallBack,this));

	TRAPD(err,ActivateViewL(TVwsViewId(appUid,viewUid),messageUid,KNullDesC));
	__ASSERT_ALWAYS(!err,User::Panic(_L("ActivateViewL(TVwsViewId(appUid,viewUid),messageUid,KNullDesC)"),err));
	}
예제 #20
0
// -----------------------------------------------------------------------------
// From MCoeView
// -----------------------------------------------------------------------------
//
// Returns the ViewId for the view server
TVwsViewId CAafAppCameraView::ViewId() const
{
	return TVwsViewId(KUidViewSupApp, KCameraViewId);
}
예제 #21
0
void CTestAppUi::TestActivateInsideViewActivatedL()
	{
	RDebug::Print(_L("TVIEW1 : Test Activate Inside ViewActivated"));
	ActivateViewL(TVwsViewId(KUidViewAppTwo,KUidViewOne),KUidActivateAgain,KNullDesC16);
	}
// ---------------------------------------------------------
// CStatusView::DoActivateL(...)
// ?implementation_description
// ---------------------------------------------------------
//
void CStatusView::DoActivateL(
				   const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
				   const TDesC8& /*aCustomMessage*/)
{
	CALLSTACKITEM_N(_CL("CStatusView"), _CL("DoActivateL"));

	iActive=true;
	TRect r=ClientRect();
	iContainer->SetRect( r );
	iContainer->MakeVisible(ETrue);

	AppUi()->AddToStackL( *this, iContainer );
	CEikStatusPane* sp=iEikonEnv->AppUiFactory()->StatusPane();
	CAknTitlePane* tp=(CAknTitlePane*)sp->ControlL(TUid::Uid(EEikStatusPaneUidTitle));
	tp->SetText(CEikonEnv::Static()->AllocReadResourceL(R_CAPTION));
	if ( iNextViewId != TVwsViewId() ) {
		TVwsViewId v = iNextViewId;
		iNextViewId= TVwsViewId();

		{
			// it tends not to be safe to try to re-activate
			// the media capture apps if they've been shut down
			
			RWsSession& ws=CEikonEnv::Static()->WsSession();
			TApaTaskList tl(ws);
			TApaTask app_task=tl.FindApp(v.iAppUid);
			if (! app_task.Exists() ) {
				// so activate the phone app instead
				TApaTask app_task=tl.FindApp(KUidPhone);
				if (app_task.Exists()) app_task.BringToForeground();
				goto done_activate;
			}
		}
		if (v.iAppUid == KCameraUid) {
			CC_TRAPD(err, ActivateViewL(TVwsViewId(KCameraUid, KCameraViewUid)));
#ifndef __S60V3__
		//FIXME3RD
		} else if (v.iAppUid == KCamera2Uid) {
			/* the camera on 6630 will be stuck in showing the photo on reactivation */
			auto_ptr<CApaCommandLine> cmd(CApaCommandLine::NewL(_L("z:\\system\\apps\\camcorder\\camcorder.app")));
			cmd->SetCommandL(EApaCommandRun);
			CC_TRAPD(err, EikDll::StartAppL(*cmd));
		} else if (v.iAppUid == KCamera3Uid) {
			// the camera on N70 will hang if the slider's been closed and we
			//   try to reactivate it 
			//Reporting().UserErrorLog(_L("starting camera3"));
			auto_ptr<CApaCommandLine> cmd(CApaCommandLine::NewL(_L("z:\\system\\apps\\cammojave\\cammojave.app")));
			cmd->SetCommandL(EApaCommandRun);
			CC_TRAPD(err, EikDll::StartAppL(*cmd));			
		} else if (v.iAppUid == KVideoUid) {
			CC_TRAPD(err, ActivateViewL(TVwsViewId(KVideoUid, KVideoViewUid)));
                } else if (v.iAppUid == KRecorderUid) {
			auto_ptr<CApaCommandLine> cmd(CApaCommandLine::NewL(_L("z:\\system\\apps\\voicerecorder\\voicerecorder.app")));
			cmd->SetCommandL(EApaCommandRun);
			CC_TRAPD(err, EikDll::StartAppL(*cmd));			
#endif
		} else {
			//Reporting().UserErrorLog(_L("activating previous"));
			CC_TRAPD(err, ActivateViewL(v));
		}
done_activate:
		;

	}
}
// -----------------------------------------------------------------------------
// From MCoeView
// -----------------------------------------------------------------------------
//
// Returns the ViewId for the view server
TVwsViewId CSupSplashScreenView::ViewId() const
{
	return TVwsViewId(KUidViewSupApp, KSplashScreenViewId);
}
TVwsViewId CMyListBoxAppView::ViewId() const
{
	TUid uid = { 5 };
	TUid app = { 0x121F6165 };
	return TVwsViewId(app, uid);
}
// -----------------------------------------------------------------------------
// From MCoeView
// -----------------------------------------------------------------------------
//
// Returns the ViewId for the view server
TVwsViewId CAafAppFileBrowserView::ViewId() const
{
	return TVwsViewId(KUidViewSupApp, KFileBrowserViewId);
}
예제 #26
0
void CTestAppUi::TestPanicedActivationL()
	{
	RDebug::Print(_L("TVIEW1 : Test Paniced Activation"));
	ActivateViewL(TVwsViewId(KUidViewAppTwo,KUidViewOne),KUidActivationPanic,KNullDesC16);
	}