void CContextContactsDetailView::HandleCommandL(TInt aCommand)
{   
	CALLSTACKITEM_N(_CL("CContextContactsDetailView"), _CL("HandleCommandL"));


	switch ( aCommand )
        {
		case EAknSoftkeyBack:
		{
			ActivateParentViewL();
			break;
		}
		case EContextContactsCmdCreateSms:
		{
			if ( iContainer->IsCurrentPhoneNumber() )
			{
				TPtrC no( iItem->PbkFieldAt(iContainer->get_current_item_idx()).PbkFieldText() );
				CDesCArrayFlat* recip=new CDesCArrayFlat(1);
				CleanupStack::PushL(recip);
				CDesCArrayFlat* alias=new CDesCArrayFlat(1);
				CleanupStack::PushL(alias);
				recip->AppendL(no);
				alias->AppendL( *(iItem->GetContactTitleL()) );
				aPhoneHelper.send_sms(recip, alias);
				CleanupStack::PopAndDestroy(2); // recip, alias
			}
			else
			{
                                CPbkSmsAddressSelect* sel=new (ELeave) CPbkSmsAddressSelect();
#ifndef __S60V3__
				TPtrC no(sel->ExecuteLD(*iItem, NULL, EFalse));
#else
				TPtrC no(0, 0);
				CPbkSmsAddressSelect::TParams p(*iItem);
				TBool selected=sel->ExecuteLD(p);
				if (selected) {
					const TPbkContactItemField* f=p.SelectedField();
					if (f && f->StorageType()==KStorageTypeText) {
						no.Set(f->Text());
					}
				}
#endif

				if (no.Length()>0)
				{
					CDesCArrayFlat* recip=new CDesCArrayFlat(1);
					CleanupStack::PushL(recip);
					CDesCArrayFlat* alias=new CDesCArrayFlat(1);
					CleanupStack::PushL(alias);
					recip->AppendL(no);
					alias->AppendL( *(iItem->GetContactTitleL()) );
					aPhoneHelper.send_sms(recip, alias);
					CleanupStack::PopAndDestroy(2); // recip, alias
				}
			}			
			break;
		}
		case EContextContactsCmdCreateMms:
		{
			if ( (iContainer->IsCurrentMMS()) || (iContainer->IsCurrentPhoneNumber()) ) 
			{
				TPtrC no( iItem->PbkFieldAt(iContainer->get_current_item_idx()).PbkFieldText() );
				CDesCArrayFlat* recip=new CDesCArrayFlat(1);
				CleanupStack::PushL(recip);
				CDesCArrayFlat* alias=new CDesCArrayFlat(1);
				CleanupStack::PushL(alias);
				recip->AppendL(no);
				alias->AppendL(*(iItem->GetContactTitleL()));
				aPhoneHelper.send_mms(recip,alias);
				CleanupStack::PopAndDestroy(2); // recip, alias
			}
			else
			{
				CPbkMmsAddressSelect* sel=new (ELeave) CPbkMmsAddressSelect();
#ifndef __S60V3__
				TPtrC no(sel->ExecuteLD(*iItem, NULL, EFalse));
#else
				TPtrC no(0, 0);
				CPbkMmsAddressSelect::TParams p(*iItem);
				TBool selected=sel->ExecuteLD(p);
				if (selected) {
					const TPbkContactItemField* f=p.SelectedField();
					if (f && f->StorageType()==KStorageTypeText) {
						no.Set(f->Text());
					}
				}
#endif
				if ((no!=KNullDesC))
				{
					CDesCArrayFlat* recip=new CDesCArrayFlat(1);
					CleanupStack::PushL(recip);
					CDesCArrayFlat* alias=new CDesCArrayFlat(1);
					CleanupStack::PushL(alias);
					recip->AppendL(no);
					alias->AppendL(*(iItem->GetContactTitleL()));
					aPhoneHelper.send_mms(recip,alias);
					CleanupStack::PopAndDestroy(2); // recip,alias
				}
			}
			break;
		}
		case EContextContactsCmdCreateEmail:
		{
			if ( iContainer->IsCurrentMMS())
			{
				TPtrC no( iItem->PbkFieldAt(iContainer->get_current_item_idx()).PbkFieldText() );
				CDesCArrayFlat* recip=new CDesCArrayFlat(1);
				CleanupStack::PushL(recip);
				CDesCArrayFlat* alias=new CDesCArrayFlat(1);
				CleanupStack::PushL(alias);
				recip->AppendL(no);
				alias->AppendL(*(iItem->GetContactTitleL()));
				aPhoneHelper.send_email(recip,alias);
				CleanupStack::PopAndDestroy(2); // recip,alias
			}
			else
			{
				CPbkEmailAddressSelect* sel=new (ELeave) CPbkEmailAddressSelect();
#ifndef __S60V3__
				TPtrC no(sel->ExecuteLD(*iItem, NULL, EFalse));
#else
				TPtrC no(0, 0);
				CPbkEmailAddressSelect::TParams p(*iItem);
				TBool selected=sel->ExecuteLD(p);
				if (selected) {
					const TPbkContactItemField* f=p.SelectedField();
					if (f && f->StorageType()==KStorageTypeText) {
						no.Set(f->Text());
					}
				}
#endif
				if (no!=KNullDesC)
				{
					CDesCArrayFlat* recip=new CDesCArrayFlat(1);
					CleanupStack::PushL(recip);
					CDesCArrayFlat* alias=new CDesCArrayFlat(1);
					CleanupStack::PushL(alias);
					recip->AppendL(no);
					alias->AppendL(*(iItem->GetContactTitleL()));
					aPhoneHelper.send_email(recip, alias);
					CleanupStack::PopAndDestroy(2); // recip
				}
			}
			break;
		}
		case EContextContactsCmdCall:
		{
			if ( iContainer->IsCurrentPhoneNumber() )
			{
				TPtrC no( iItem->PbkFieldAt(iContainer->get_current_item_idx()).PbkFieldText() );
				aPhoneHelper.make_callL(no);
			}
			else
			{
				CPbkPhoneNumberSelect* sel=new (ELeave) CPbkPhoneNumberSelect();
#ifndef __S60V3__
				TPtrC no(sel->ExecuteLD(*iItem, NULL, EFalse));
#else
				TPtrC no(0, 0);
				CPbkPhoneNumberSelect::TParams p(*iItem);
				TBool selected=sel->ExecuteLD(p);
				if (selected) {
					const TPbkContactItemField* f=p.SelectedField();
					if (f && f->StorageType()==KStorageTypeText) {
						no.Set(f->Text());
					}
				}
#endif
				aPhoneHelper.make_callL(no);
			}
			break;
		}
		case EContextContactsCmdEdit:
		{
			aPhoneHelper.show_editor(iViewState->FocusedContactId(), false, iContainer->get_current_item_idx());
			Refresh();
			break;
		}
		case EContextContactsCmdDefaults:
		{
			CPbkContactItem * temp_item = pbkengine->OpenContactLCX(iViewState->FocusedContactId());
			CDefaultNumbersPopupList * popup = CDefaultNumbersPopupList::NewL(temp_item);
			CleanupStack::PushL(popup);
			popup->ExecuteLD();
			CleanupStack::Pop();//popup
			pbkengine->CommitContactL(*temp_item);
			CleanupStack::PopAndDestroy(2); // lock, temp_item

			Refresh();
			break;
		}
		case EContextContactsCmdGoToWeb:
		{
			TBuf<255> url;
			url.Copy(iContainer->GetWebAddress());
			if (url.Length() == 0) return;

			#ifndef __S60V3__
			// FIXME3RD
			#ifndef __WINS__
		
			#  ifndef __S60V2__

			auto_ptr<CDorisBrowserInterface> ido(CDorisBrowserInterface::NewL());
			ido->AppendL(CDorisBrowserInterface::EOpenURL_STRING, url);
			ido->ExecuteL();
		
			#  else
			HBufC8* addr8=HBufC8::NewLC(url.Length());
			TPtr8 addrp=addr8->Des();
			CC()->ConvertFromUnicode(addrp, url);
		
			TUid KUidOperaBrowserUid = {0x101F4DED};
			TUid KUidOperaRenderViewUid = {0};

			TVwsViewId viewId(KUidOperaBrowserUid, KUidOperaRenderViewUid);
		
			CVwsSessionWrapper* vws;
			vws=CVwsSessionWrapper::NewLC();
			vws->ActivateView(viewId, KUidOperaRenderViewUid, *addr8);
			CleanupStack::PopAndDestroy(2);
			#  endif

			#endif
			#endif
			break;
		}
		case EContextContactsCmdDelete:
		{
			//note: this isn't the behaviour of original contact app
			TInt idx = iContainer->get_current_item_idx();
			TInt id = iItem->PbkFieldAt(idx).PbkFieldId();
			TPbkContactItemField * field = iItem->FindField(id, idx);
			TInt length = field->Label().Length() + field->Text().Length() + 10;

			HBufC * header = CEikonEnv::Static()->AllocReadResourceL(R_DELETE);
			CleanupStack::PushL(header);
			HBufC * message= HBufC::NewL(length);
			CleanupStack::PushL(message);

			message->Des().Append(field->Label());
			message->Des().Append(_L(" ("));
			message->Des().Append(field->Text());
			message->Des().Append(_L(") ?"));

			CAknMessageQueryDialog * dlg = CAknMessageQueryDialog::NewL(*message);
			CleanupStack::PushL(dlg);
			dlg->PrepareLC(R_CONFIRMATION_QUERY);
			dlg->QueryHeading()->SetTextL(*header);
			CleanupStack::Pop(dlg);
			
			if ( dlg->RunLD() )
			{
				CPbkContactItem * temp_item = pbkengine->OpenContactLCX(iViewState->FocusedContactId());
				temp_item->RemoveField(iContainer->get_current_item_idx());
				pbkengine->CommitContactL(*temp_item);
				CleanupStack::PopAndDestroy(2);
			}
			CleanupStack::PopAndDestroy(2); //header, message
						
			Refresh();
			break;
		}
#ifdef __S60V3__
		case EContextContactsMenuMsgCurrent:
		case EContextContactsMenuMsg:
		{
			HandleCreateMessageL();
		}
			break;
#endif

		default:
		{
#ifndef __S60V3__
//FIXME3RD
			if (!iSendAppUi->CommandIsValidL(aCommand, TSendingCapabilities(0, 0, TSendingCapabilities::EAllMTMs)))
#endif
			{
				AppUi()->HandleCommandL( aCommand );
			}
#ifndef __S60V3__
			else
			{
				TUid mtm = iSendAppUi->MtmForCommand(aCommand);
				CArrayFixFlat<TInt> * c = new CArrayFixFlat<TInt>(1);
				CleanupStack::PushL(c);
				c->AppendL(iViewState->FocusedContactId());
				aPhoneHelper.send_as( mtm, c);
				CleanupStack::PopAndDestroy(1); // c
			}
#endif
			break;
		}
	}
}
void CTTGPSLoggerPositioningMethod::EditItemL(TBool aCalledFromMenu) // edit text
    {
	CDesC16ArrayFlat *itemArray = new (ELeave) CDesC16ArrayFlat(20);
	CDesC16ArrayFlat *itemArrayDetails = new (ELeave) CDesC16ArrayFlat(20);
	CleanupStack::PushL(itemArray); // in case the appends leave
	CleanupStack::PushL(itemArrayDetails); // in case the appends leave
	RPositionServer iPositionServer;
	RPositioner iPositioner;
	User::LeaveIfError(iPositionServer.Connect());
	User::LeaveIfError(iPositioner.Open(iPositionServer));
	itemArray->AppendL(_L("(Info on all modules)"));
	itemArray->AppendL(_L("(Default)"));
	TUint aModules = 0;
	TInt defaultModule=-1;

	// Get the available numbers of modules
	User::LeaveIfError(iPositionServer.GetNumModules(aModules));
    TPositionModuleInfo info;
	TPositionModuleId aModuleId;
	iPositionServer.GetDefaultModuleId(aModuleId);

	// Prepare itemArray and itemArrayDetails
    for(TUint i = 0; i < aModules; i++)
    	{
    	if ((iPositionServer.GetModuleInfoByIndex(i,info) == KErrNone) && (info.IsAvailable()))
    		{
    		TBuf<200> smallBuffer;
    		smallBuffer.Zero();
    		info.GetModuleName(smallBuffer);
    		itemArray->AppendL(smallBuffer);

			TBuf<200> buffer;
			buffer.Zero();
			info.GetModuleName(buffer);
			buffer.Append(_L(" ("));
			if (info.DeviceLocation() & TPositionModuleInfo::EDeviceExternal)
				buffer.Append(_L("External "));
			if (info.DeviceLocation() & TPositionModuleInfo::EDeviceInternal)
				buffer.Append(_L("Internal "));
			if (info.DeviceLocation() & TPositionModuleInfo::EDeviceUnknown)
				buffer.Append(_L("Unknown "));
			if (info.TechnologyType()& TPositionModuleInfo::ETechnologyAssisted)
				buffer.Append(_L("Assisted "));
			if (info.TechnologyType()& TPositionModuleInfo::ETechnologyTerminal)
				buffer.Append(_L("GPS, "));
			if (info.TechnologyType()& TPositionModuleInfo::ETechnologyNetwork)
				buffer.Append(_L("Network, "));
			if (info.TechnologyType()& TPositionModuleInfo::ETechnologyUnknown)
				buffer.Append(_L("Unknown tech, "));
			if (buffer.Mid(buffer.Length()-2, 2).Compare( _L(", ")) == KErrNone)
				buffer.Replace(buffer.Length()-2, 2, _L(")"));
			if (buffer.Mid(buffer.Length()-1, 1).Compare( _L(" "))  == KErrNone)
				buffer.Replace(buffer.Length()-1, 1, _L(")"));
			if ( info.ModuleId() == aModuleId)
				{
				buffer.Append(_L(" [Default]"));
				defaultModule=i;
				}
    		itemArrayDetails->AppendL(buffer);    		
    		}
    	}	
	iPositioner.Close();
	iPositionServer.Close();

	// Present list of positioning methods
	TInt selectIndex;
    selectIndex=iPosMethod+1;
    HBufC* title = NULL;
	title = CEikonEnv::Static()->AllocReadResourceLC(R_TTGP_TBUF32_DIALOG_POSITIONING_TITLE); // Select positioning method:
    CAknListQueryDialog* dialog = new (ELeave) CAknListQueryDialog(&selectIndex);
    dialog->PrepareLC(R_TTGP_DIALOG_LISTQUERY);
    dialog->QueryHeading()->SetTextL(*title);
    dialog->SetItemTextArray(itemArray);
    dialog->SetOwnershipType(ELbmDoesNotOwnItemArray);
    TInt answer = dialog->RunLD();
    CleanupStack::PopAndDestroy(); // title
    // Check answer
    if (answer)
    	{
        if (selectIndex==0) // (Info on all modules)
    		{
    		TBuf<1000> aText;
    		aText.Zero();
    		for (TInt i=0;i<itemArrayDetails->Count();i++)
    			{
    			aText.AppendFormat(_L("%d. "), i+1);
    			aText.Append(itemArrayDetails->MdcaPoint(i));
    			if (i<itemArrayDetails->Count()-1)
    				aText.Append(_L("\n"));
    			}
    		HBufC* title = CEikonEnv::Static()->AllocReadResourceLC(R_TTGP_TBUF32_AVAILABLEPOSITIONING_TITLE); // Available modules:
    		CAknMessageQueryDialog* dialog = new (ELeave) CAknMessageQueryDialog();
    		CleanupStack::PushL(dialog);
    		dialog->PrepareLC(R_TTGP_DIALOG_MESSAGEQUERY_OK);
    		dialog->QueryHeading()->SetTextL(*title);
    		dialog->SetMessageTextL(aText);
    		CleanupStack::Pop(); // dialog
    		dialog->RunLD();
    		CleanupStack::PopAndDestroy(); // title
    		}
        else
        if (selectIndex==1) // Default module
        	{
        	if (defaultModule>-1)
        		{
        		// Present default module name
        		HBufC* title = CEikonEnv::Static()->AllocReadResourceLC(R_TTGP_TBUF32_SELECTEDPOSITIONING_TITLE); // Selected module:
        		CAknMessageQueryDialog* dialog = new (ELeave) CAknMessageQueryDialog();
        		CleanupStack::PushL(dialog);
        		dialog->PrepareLC(R_TTGP_DIALOG_MESSAGEQUERY_OK);
        		dialog->QueryHeading()->SetTextL(*title);
        		dialog->SetMessageTextL(itemArrayDetails->MdcaPoint(defaultModule));
        		CleanupStack::Pop(); // dialog
        		dialog->RunLD();
        		CleanupStack::PopAndDestroy(); // title
        		}
    		iPosMethod=0; // default module selected
    		C_APPUI->Engine()->Requester()->SetPositioningMethod(iPosMethod);
    		C_APPUI->Engine()->Requester()->StartL();
        	}
        else
        if (selectIndex>1) // Custom selection of the module
        	{
    		HBufC* title = CEikonEnv::Static()->AllocReadResourceLC(R_TTGP_TBUF32_SELECTEDPOSITIONING_TITLE); // Selected module:
    		CAknMessageQueryDialog* dialog = new (ELeave) CAknMessageQueryDialog();
    		CleanupStack::PushL(dialog);
    		dialog->PrepareLC(R_TTGP_DIALOG_MESSAGEQUERY_OK);
    		dialog->QueryHeading()->SetTextL(*title);
    		dialog->SetMessageTextL(itemArrayDetails->MdcaPoint(selectIndex-2));
    		CleanupStack::Pop(); // dialog
    		dialog->RunLD();
    		CleanupStack::PopAndDestroy(); // title
    		iPosMethod=selectIndex-1;
    		C_APPUI->Engine()->Requester()->SetPositioningMethod(iPosMethod);
    		C_APPUI->Engine()->Requester()->StartL();
    		}
    	UpdateListBoxTextL();
    	}
    CleanupStack::PopAndDestroy(); // itemArrayDetails
    CleanupStack::PopAndDestroy(); // itemArray
    }
Example #3
0
void CTraceContainer::HandleCommandL(TInt aCommand)
{	
	switch (aCommand)
    { 
	case EAppHelpBack:
		{
			delete iMyHelpContainer;
			iMyHelpContainer = NULL;
		}
		SetMenuL();
		DrawNow();
		break;
	case EAppHelp:
		{
			delete iMyHelpContainer;
			iMyHelpContainer = NULL;    		
			iMyHelpContainer = CMyHelpContainer::NewL();
		}
		SetMenuL();
		DrawNow();    		
		break;    
    case EItemInfo:
    	{
    /*		RExampleServerClient CrashClient;
			CrashClient.Connect();
			
			TExampleItem ItemBuffer;
			
			TFileName Bufferrr;
			TInt ItemCount(0);
			CrashClient.GetItemCount(ItemCount);
			for(TInt i=0; i < ItemCount; i++)
			{
				ItemBuffer.iIndex = i;
				CrashClient.GetItemL(ItemBuffer);	
				
				AddItemListL(ItemBuffer);
			}

			if(!iServerIsOn)
			{
				CrashClient.ShutServerDownNow();
			}

			CrashClient.Close();*/
    	}
    
    		
/*		if(iSelectionBox)
		{
			TInt CurrInd = iSelectionBox->CurrentItemIndex();
			if(CurrInd >= 0 && CurrInd <= iArray.Count())
			{
				if(iArray[CurrInd])
				{
		    		HBufC* Informmm = HBufC::NewLC(3000);
		    		
		    		TPtr Pointter(Informmm->Des());
		    		GetInfoBufferL(*iArray[CurrInd],Pointter);
		    		
					TPtr NewPointter(Informmm->Des());
					CAknMessageQueryDialog* dlg = CAknMessageQueryDialog::NewL(NewPointter);
					dlg->PrepareLC(R_ABOUT_HEADING_PANE);
					dlg->SetHeaderTextL(KTraceApplicationName);  
					dlg->RunLD();
					
					CleanupStack::PopAndDestroy(Informmm);
		    	}
			}
		}*/
    	break;
    case ESettingsMe:
    	{
			iProfileSettings = new(ELeave)CProfileSettings();
			iProfileSettings->ConstructL();
    	}
    	SetMenuL();
    	DrawNow();
    	break;
    case ESettingsOk:
    	{
			if(iProfileSettings)
			{
				iProfileSettings->SaveValuesL();
				
			//	if(iServerIsOn)
				{
					RExampleServerClient CrashClient;
					CrashClient.Connect();
					CrashClient.ReReadSettings();
					CrashClient.Close();
				}
			}
    	
			delete iProfileSettings;
			iProfileSettings = NULL;
    	}
    	SetMenuL();
    	DrawNow();
    	break;
    case ESetMeOn:
    	{
    		iServerIsOn = ETrue;
    		RExampleServerClient CrashClient;
			CrashClient.Connect();
			
			CrashClient.StartTrace();
			
			CrashClient.Close();
			
			ChangeIconAndNameL();
			
			if(iTimeOutTimer)
			{
				iTimeOutTimer->Cancel();
			}
			else
			{
				iTimeOutTimer = CTimeOutTimer::NewL(EPriorityNormal,*this);
			}

			iTimeOutTimer->After(1000000);
    	}
    	break;
	case ESetMeOff:
		{
			iServerIsOn = EFalse;
    		RExampleServerClient CrashClient;
			CrashClient.Connect();
			CrashClient.ShutServerDownNow();
			CrashClient.Close();
			
			ChangeIconAndNameL();
			
			if(iTimeOutTimer)
			{
				iTimeOutTimer->Cancel();
			}
    	}
    	break;
	case EClearMe:
		{
			CAknQueryDialog* dlg = CAknQueryDialog::NewL();
			if(dlg->ExecuteLD(R_QUERY,_L("Clear list")))
			{
	    		RExampleServerClient CrashClient;
				CrashClient.Connect();
				CrashClient.ClearItemList();

				if(!iServerIsOn)
				{
					CrashClient.ShutServerDownNow();
				}
				else
				{	// re-start the trace
					CrashClient.StopTrace();
					CrashClient.StartTrace();
				}

				CrashClient.Close();
				
				iArray.ResetAndDestroy();
				// refresh info
			}
    	}
    	break;
	case EResetMe:
		{

				
    		// refresh info
    	}
    	break;
    case EAbout:
    	{
    		HBufC* Abbout = KTraceAbbout().AllocLC();
			TPtr Pointter(Abbout->Des());
			CAknMessageQueryDialog* dlg = CAknMessageQueryDialog::NewL(Pointter);
			dlg->PrepareLC(R_ABOUT_HEADING_PANE);
			dlg->SetHeaderTextL(KTraceApplicationName);  
			dlg->RunLD();
			
			CleanupStack::PopAndDestroy(Abbout);
    	}
    	break;
    case EBacktoYTasks:
    	if(iTasksHandlerExit)
    	{
    		if(!iServerIsOn)
    		{
    			CAknQueryDialog* dlg = CAknQueryDialog::NewL();
				if(dlg->ExecuteLD(R_QUERY,_L("Set Trace on")))
				{
					RExampleServerClient CrashClient;
					CrashClient.Connect();
					CrashClient.Close();
				}
    		}
    	
    		iTasksHandlerExit->HandlerExitL(this);	
    	}
    	break; 
	default:
		break;
    };
}
// ----------------------------------------------------
// CMobileOfficeAppUi::HandleCommandL(TInt aCommand)
// takes care of command handling
// ----------------------------------------------------
//
void CMobileOfficeAppUi::HandleCommandL(TInt aCommand)
{
		CheckDemo();
	
		switch ( aCommand )
        {
		case EAknSoftkeyExit:
		case EEikCmdExit:	
            {
				if (iDoorObserver)
					iDoorObserver->NotifyExit( MApaEmbeddedDocObserver::ENoChanges );
				#ifndef FREEVERSION
					licMan.End();
				#endif
				Exit();
				break;
            }
        case EMobileOfficeCmdAppAbout:
            {
			
				HBufC* messageText = StringLoader::LoadLC( R_MOBILESEARCH_ABOUT );
				
				/*
				TBuf<500> nein;
				nein.Copy(*messageText);
				nein.Append(_L("\r\n"));
				nein.Append(_L("\r\n"));
				nein.Append(_L("Application: 1.1"));
				nein.Append(_L("\r\n"));
				*/
				CAknMessageQueryDialog* dlg = CAknMessageQueryDialog::NewL( *messageText );
				dlg->PrepareLC(R_MESSAGE_QUERY);
				HBufC* aboutTitleText = StringLoader::LoadLC( R_MOBILESEARCH_ABOUTTITLE );	
				dlg->QueryHeading()->SetTextL( *aboutTitleText );
				CleanupStack::PopAndDestroy( aboutTitleText );
				dlg->RunLD();
				CleanupStack::PopAndDestroy( messageText );
				break;
            }
		case EMobileOfficeCmdOpen:
            {
				TUid viewID = KEditorViewViewId;	
				ActivateLocalViewL(viewID);
				//SendFileL(iOpenDocument->Filename());

				
				break;
			
			}
	
		case EMobileOfficeCmdList:
            {
				TUid viewID = KViewId;
				ActivateLocalViewL(viewID);
				break;
			
			}
	
		case EMobileOfficeCmdProp:
            {
				TUid viewID = KView2Id;
				ActivateLocalViewL(viewID);
				break;
			
			}
	#ifndef FREEVERSION
		case EMobileOfficeCmdRegister:
			{
				Register();	
				break;		
			}
	#endif
		case EMobileOfficeCmdPicture:
            {
				TUid viewID = KViewImageViewId;
				ActivateLocalViewL(viewID);
				break;
			
			}
		case EMobileOfficeCmdNewText:
			{
				TUid viewID = KEditorViewViewId;	
				OpenDocument()->SetNextViewID(viewID);
				OpenDocument()->SetEditable(ETrue);
				ActivateLocalViewL(viewID);
				break;
			}
		case EMobileOfficeCmdBack:
            {
			
				ActivateLocalViewL(OpenDocument()->NextViewID());
				break;
			
			}
		case EMobileOfficeCmdHelp:
			{
				CArrayFix<TCoeHelpContext>* buf = AppHelpContextL();
				HlpLauncher::LaunchHelpApplicationL(iEikonEnv->WsSession(), buf);
			}
        default:
            break;      
        }
    }
// ----------------------------------------------------------------------------
// CSetupWizardListView::HandleCommandL( TInt )
// Handles the commands.
// ----------------------------------------------------------------------------
//
void CSetupWizardListView::HandleCommandL( TInt aCommand )
    {
	TInt temp;
	TInt iCurrentPos;
	TInt err;

    switch ( aCommand ) // Command is...
        {
        case EAknSoftkeyBack:
            {
				// save settings
				iListBox->StoreSettingsL();
                iListBox->SaveSettingsToDB();				
				
				if(iPhotosAppUi->RegFileExists())
				//if(1)
				{
					switch(iPhotosAppUi->iSettingsScreenValue)
					{
						case 0:						
							AppUi()->HandleCommandL(EMainView);	
							break;
						case 1:
							//iPhotosAppUi->ShowSetupWizard(1);						
							iPhotosAppUi->CallSetupWizardStep5();
							break;
						case 2:	
							//iPhotosAppUi->ShowSetupWizard(2);
							//iPhotosAppUi->ShowMessage(2);
							iPhotosAppUi->CallSetupWizardStep11();
							break;
						case 3:
							//iPhotosAppUi->ShowMessage();
							//AppUi()->HandleCommandL(EMainView);	
							//iPhotosAppUi->ShowSetupWizard(3);
							//iPhotosAppUi->ShowMessage(3);
							iPhotosAppUi->CallSetupWizardStep17();
							break;
						default:
							break;
					}
				}
				else
					AppUi()->HandleCommandL(EUnRegView);	
				
				iPhotosAppUi->iRipplePhotos = 2;
				break;
            }	
		case ESave:	
			iCurrentPos = iListBox->ListBox()->CurrentItemIndex();

		switch(iPhotosAppUi->iSettingsScreenValue)
		{
			case 0:	
			if(iCurrentPos == 0)// || iCurrentPos == 1 || iCurrentPos == 2)
			{
				iListBox->PopUp();				
				iListBox->StoreSettingsL();
            }
			else if(iCurrentPos == 1)//3)
			{
				//iListBox->SelectAccess();
				iPhotosAppUi->AccessPointSettings();
		        iListBox->LoadSettingsL();
				//iPhotosAppUi->BringToForeground();				
			}

				break;
			case 1:	
			if(iCurrentPos == 0)
			{
				temp=iData->iContactsRoam;
				
				iListBox->PopUp();
				iListBox->StoreSettingsL();					
				
				if(iData->iContactsRoam == 1)
				{
					//TBuf<150> msg;
					//msg.Copy(_L("Contacts will be uploaded even while Roaming."));
					//msg.Copy(*(iEikonEnv->AllocReadResourceL(R_CONTACTS_MESSAGE1)));
					CAknMessageQueryDialog* dlg = CAknMessageQueryDialog::NewL(*(iEikonEnv->AllocReadResourceL(R_CONTACTS_MESSAGE1)));
					dlg->PrepareLC(R_ROAMING_MESSAGE);					
					err = dlg->RunLD() ;
					if (err == 0)
					{
						iData->iContactsRoam = temp;     
						iListBox->LoadSettingsL();
					}
					else
					{
						iListBox->LoadSettingsL();
					}
				}
				else {
					//TBuf<150> msg;
					//msg.Copy(_L("Contacts taken while roaming will be uploaded after returning to home country."));					
					//msg.Copy(*(iEikonEnv->AllocReadResourceL(R_CONTACTS_MESSAGE2)));
					CAknMessageQueryDialog* dlg = CAknMessageQueryDialog::NewL(*(iEikonEnv->AllocReadResourceL(R_CONTACTS_MESSAGE2)));
				    dlg->PrepareLC(R_ROAMINGOFF_MESSAGE);
				    err = dlg->RunLD();
				}
				
            }					

				break;
			case 2:	
			if(iCurrentPos == 1)
			{
				temp=iData->iDesc;

				if(iData->iMode==1)
				{				
					iListBox->PopUp();
					iListBox->StoreSettingsL();					

					if(iData->iDesc==0) //disabled
					{
						CAknMessageQueryDialog* dlg = CAknMessageQueryDialog::NewL(*(iEikonEnv->AllocReadResourceL(R_PHOTOS_MESSAGE_DESCRIPTION_OFF)));
						dlg->PrepareLC(R_ROAMINGOFF_MESSAGE);
						err = dlg->RunLD();						
					}
					else
					{ // enabled
						CAknMessageQueryDialog* dlg = CAknMessageQueryDialog::NewL(*(iEikonEnv->AllocReadResourceL(R_PHOTOS_MESSAGE_DESCRIPTION_ON)));
						dlg->PrepareLC(R_ROAMINGOFF_MESSAGE);
						err = dlg->RunLD();						
					}
				}
					
				iListBox->LoadSettingsL();
			}
			else if(iCurrentPos == 0)
			{
				temp=iData->iMode;
				
				iListBox->PopUp();
				iListBox->StoreSettingsL();					
				
				if(iData->iMode==0)
				{
					
					CAknMessageQueryDialog* dlg = CAknMessageQueryDialog::NewL(*(iEikonEnv->AllocReadResourceL(R_PHOTOS_MESSAGE_AUTO)));
				    dlg->PrepareLC(R_ROAMINGOFF_MESSAGE);
				    err = dlg->RunLD();

					if (iListBox->SelectFolder() == -1)
					{
						iData->iMode = temp;     
						iListBox->LoadSettingsL();
					}
					iData->iDesc = 0;
				}
				else if(iData->iMode==1){
					CAknMessageQueryDialog* dlg = CAknMessageQueryDialog::NewL(*(iEikonEnv->AllocReadResourceL(R_PHOTOS_MESSAGE_PROMPT)));
				    dlg->PrepareLC(R_ROAMINGOFF_MESSAGE);
				    err = dlg->RunLD();
				}
				else
				{
					CAknMessageQueryDialog* dlg = CAknMessageQueryDialog::NewL(*(iEikonEnv->AllocReadResourceL(R_PHOTOS_MESSAGE_MANUAL)));
				    dlg->PrepareLC(R_ROAMINGOFF_MESSAGE);
				    err = dlg->RunLD();
					iData->iDesc = 0;
				}
				iListBox->LoadSettingsL();
			}
			else if(iCurrentPos == 2)
			{
				temp=iData->iPublishRoam;
				
				iListBox->PopUp();
				iListBox->StoreSettingsL();					
				
				if(iData->iPublishRoam == 1)
				{
					//TBuf<150> msg;
					//msg.Copy(_L("Photos will be uploaded even while Roaming."));
					//msg.Copy(*(iEikonEnv->AllocReadResourceL(R_PHOTOS_MESSAGE1)));
					CAknMessageQueryDialog* dlg = CAknMessageQueryDialog::NewL(*(iEikonEnv->AllocReadResourceL(R_PHOTOS_MESSAGE1)));
					dlg->PrepareLC(R_ROAMING_MESSAGE);					
					err = dlg->RunLD() ;
					if (err == 0)
					{
						iData->iPublishRoam = temp;     
						iListBox->LoadSettingsL();
					}
					else
					{
						iListBox->LoadSettingsL();
					}
				}
				else {
					//TBuf<150> msg;
					//msg.Copy(_L("Photos taken while roaming will be uploaded after returning to home country."));					
					//msg.Copy(*(iEikonEnv->AllocReadResourceL(R_PHOTOS_MESSAGE2)));
					CAknMessageQueryDialog* dlg = CAknMessageQueryDialog::NewL(*(iEikonEnv->AllocReadResourceL(R_PHOTOS_MESSAGE2)));
				    dlg->PrepareLC(R_ROAMINGOFF_MESSAGE);
				    err = dlg->RunLD();
				}
				
            }					
			else if(iCurrentPos == 3)
			{
				temp=iData->iSecureGallery;
				
				iListBox->PopUp();
				iListBox->StoreSettingsL();					

				if(iData->iSecureGallery==0) //disabled
				{
					CAknMessageQueryDialog* dlg = CAknMessageQueryDialog::NewL(*(iEikonEnv->AllocReadResourceL(R_PHOTOS_SECUREGALLERY_OFF)));
					dlg->PrepareLC(R_ROAMINGOFF_MESSAGE);
					err = dlg->RunLD();						
				}
				else
				{ // enabled
					CAknMessageQueryDialog* dlg = CAknMessageQueryDialog::NewL(*(iEikonEnv->AllocReadResourceL(R_PHOTOS_SECUREGALLERY_ON)));
					dlg->PrepareLC(R_ROAMINGOFF_MESSAGE);
					err = dlg->RunLD();						
				}
				
					
				iListBox->LoadSettingsL();
			}

				break;
			case 3:	
			if(iCurrentPos == 0)
			{
				//temp=iData->iSmsType;
				
				iListBox->PopUp();
				iListBox->StoreSettingsL();					
				
				if(iData->iSmsType == 0)
				{
					CAknMessageQueryDialog* dlg = CAknMessageQueryDialog::NewL(*(iEikonEnv->AllocReadResourceL(R_TEXT_SMS_SELECTIVE)));
					dlg->PrepareLC(R_ROAMINGOFF_MESSAGE);					
					err = dlg->RunLD() ;

					iPhotosAppUi->iStoragePath = 1;
					iListBox->StoreSettingsL();
					iPhotosAppUi->SaveSmsSettingsToDB(iData->iSmsType, iData->iTime, iData->iSmsRoam);					
					iPhotosAppUi->ActivateView(KViewIdSelectiveSms );
				}
				else if(iData->iSmsType == 1)
				{
					CAknMessageQueryDialog* dlg = CAknMessageQueryDialog::NewL(*(iEikonEnv->AllocReadResourceL(R_TEXT_SMS_AUTO)));
					dlg->PrepareLC(R_ROAMINGOFF_MESSAGE);					
					err = dlg->RunLD() ;
				}
				else if(iData->iSmsType == 2)
				{
					CAknMessageQueryDialog* dlg = CAknMessageQueryDialog::NewL(*(iEikonEnv->AllocReadResourceL(R_TEXT_SMS_AUTO_HOURLY)));
					dlg->PrepareLC(R_ROAMINGOFF_MESSAGE);					
					err = dlg->RunLD() ;
				}
				else
				{
					CAknMessageQueryDialog* dlg = CAknMessageQueryDialog::NewL(*(iEikonEnv->AllocReadResourceL(R_TEXT_SMS_MANUAL)));
					dlg->PrepareLC(R_ROAMINGOFF_MESSAGE);					
					err = dlg->RunLD() ;
				}
            }
			else if(iCurrentPos == 1)
			{
				CAknMessageQueryDialog* dlg = CAknMessageQueryDialog::NewL(*(iEikonEnv->AllocReadResourceL(R_TEXT_SMS_UPLOAD_TIME)));
				dlg->PrepareLC(R_ROAMINGOFF_MESSAGE);					
				err = dlg->RunLD() ;

				iListBox->PopUp();				
				iListBox->StoreSettingsL();
			}
			else if(iCurrentPos == 2)
			{
				temp=iData->iSmsRoam;
				
				iListBox->PopUp();
				iListBox->StoreSettingsL();					
				
				if(iData->iSmsRoam == 1)
				{
					//TBuf<150> msg;
					//msg.Copy(_L("Photos will be uploaded even while Roaming."));
					//msg.Copy(*(iEikonEnv->AllocReadResourceL(R_TEXT_SMS_ROAMING_MESSAGE1)));
					CAknMessageQueryDialog* dlg = CAknMessageQueryDialog::NewL(*(iEikonEnv->AllocReadResourceL(R_TEXT_SMS_ROAMING_MESSAGE1)));
					dlg->PrepareLC(R_ROAMING_MESSAGE);					
					err = dlg->RunLD() ;
					if (err == 0)
					{
						iData->iSmsRoam = temp;     
						iListBox->LoadSettingsL();
					}
					else
					{
						iListBox->LoadSettingsL();
					}
				}
				else {
					//TBuf<150> msg;
					//msg.Copy(_L("Photos taken while roaming will be uploaded after returning to home country."));					
					//msg.Copy(*(iEikonEnv->AllocReadResourceL(R_TEXT_SMS_ROAMING_MESSAGE2)));
					CAknMessageQueryDialog* dlg = CAknMessageQueryDialog::NewL(*(iEikonEnv->AllocReadResourceL(R_TEXT_SMS_ROAMING_MESSAGE2)));
				    dlg->PrepareLC(R_ROAMINGOFF_MESSAGE);
				    err = dlg->RunLD();
				}
				
            }					

				break;
			default:
				break;
		}

			break;		
        default:
            break;
        }
    }
Example #6
0
// -----------------------------------------------------------------------------
// CHelloS60AppUi::HandleCommandL()
// Takes care of command handling.
// -----------------------------------------------------------------------------
//
void CHelloS60AppUi::HandleCommandL(TInt aCommand)
{
    switch (aCommand)
    {
    case EEikCmdExit:
    case EAknSoftkeyExit:
        Exit();
        break;

    case ECommand1:
    {

        // Load a string from the resource file and display it
        HBufC* textResource = StringLoader::LoadLC(R_COMMAND1_TEXT);
        CAknInformationNote* informationNote;

        informationNote = new (ELeave) CAknInformationNote;

        // Show the information Note with
        // textResource loaded with StringLoader.
        informationNote->ExecuteLD(*textResource);

        // Pop HBuf from CleanUpStack and Destroy it.
        CleanupStack::PopAndDestroy(textResource);
    }
    break;
    case ECommand2:
    {
        RFile rFile;

        //Open file where the stream text is
        User::LeaveIfError(rFile.Open(CCoeEnv::Static()->FsSession(),
                                      KFileName, EFileStreamText));//EFileShareReadersOnly));// EFileStreamText));
        CleanupClosePushL(rFile);

        // copy stream from file to RFileStream object
        RFileReadStream inputFileStream(rFile);
        CleanupClosePushL(inputFileStream);

        // HBufC descriptor is created from the RFileStream object.
        HBufC* fileData = HBufC::NewLC(inputFileStream, 32);

        CAknInformationNote* informationNote;

        informationNote = new (ELeave) CAknInformationNote;
        // Show the information Note
        informationNote->ExecuteLD(*fileData);

        // Pop loaded resources from the cleanup stack
        CleanupStack::PopAndDestroy(3); // filedata, inputFileStream, rFile
    }
    break;
    case EHelp:
    {

        CArrayFix<TCoeHelpContext>* buf = CCoeAppUi::AppHelpContextL();
        HlpLauncher::LaunchHelpApplicationL(iEikonEnv->WsSession(), buf);
    }
    break;
    case EAbout:
    {

        CAknMessageQueryDialog* dlg = new (ELeave) CAknMessageQueryDialog();
        dlg->PrepareLC(R_ABOUT_QUERY_DIALOG);
        HBufC* title = iEikonEnv->AllocReadResourceLC(R_ABOUT_DIALOG_TITLE);
        dlg->QueryHeading()->SetTextL(*title);
        CleanupStack::PopAndDestroy(); //title
        HBufC* msg = iEikonEnv->AllocReadResourceLC(R_ABOUT_DIALOG_TEXT);
        dlg->SetMessageTextL(*msg);
        CleanupStack::PopAndDestroy(); //msg
        dlg->RunLD();
    }
    break;
    default:
        Panic( EHelloS60Ui);
        break;
    }
}
Example #7
0
// ----------------------------------------------------
// CRhodesAppView::HandleCommandL(TInt aCommand)
// ----------------------------------------------------
//
void CRhodesAppView::HandleCommandL(TInt aCommand)
	{
		/*if ( iBrCtlInterface )
		{
			iBrCtlInterface->ClearCache();
		}*/
		
	    switch ( aCommand )
	    {
	        case ECmdAppRestoreSetting:
	        {
	            if (iBrCtlInterface)
	            {
	                TRect rect( Position(), Size() );
	                iBrCtlInterface->SetRect( rect );
	                iBrCtlInterface->SetBrowserSettingL(TBrCtlDefs::ESettingsSmallScreen, 1);
	                iBrCtlInterface->SetBrowserSettingL(TBrCtlDefs::ESettingsSecurityWarnings, 1);
	                iBrCtlInterface->SetBrowserSettingL(TBrCtlDefs::ESettingsAutoLoadImages, 1);
	                iBrCtlInterface->SetBrowserSettingL(TBrCtlDefs::ESettingsCSSFetchEnabled, 1);
	                iBrCtlInterface->SetBrowserSettingL(TBrCtlDefs::ESettingsECMAScriptEnabled, 1);
	                iBrCtlInterface->SetBrowserSettingL(TBrCtlDefs::ESettingsBrowserUtf8Encoding, 1);
	            }
	            break;
	        }
	        case ECmdAppReload:
	        {
	            /*if (iBrCtlInterface)
	            {
	                iBrCtlInterface->HandleCommandL(iCommandBase + TBrCtlDefs::ECommandReload);
	            }*/
				webview_refresh();
				
				break;
	        }
	        case EAknSoftkeyBack:
        	{
        		if (iBrCtlInterface)
    			{
					//iBrCtlInterface->ClearCache();
		            TBrCtlDefs::TBrCtlElementType type = iBrCtlInterface->FocusedElementType();
		            
		            if(type == TBrCtlDefs::EElementActivatedInputBox )
		            	break;
    			}
    		}
	        case ECmdAppBack:
	        {
	            if (iBrCtlInterface)
	            {
					//iBrCtlInterface->ClearCache();
	                iBrCtlInterface->HandleCommandL(iCommandBase + TBrCtlDefs::ECommandBack);
	            }
	            break;
	        }
	        case ECmdAppForward:
	        {
	            if (iBrCtlInterface)
	            {
	                iBrCtlInterface->HandleCommandL(iCommandBase + TBrCtlDefs::ECommandForward);
				}
	            break;
	        }
	        case ECmdAppHome:
        	{
        		if (iBrCtlInterface)
        			{
        				iBrCtlInterface->LoadUrlL(iStartPage);
        			}
        		break;
        	}
	        case EOptions:
			{
				if (iBrCtlInterface)
					{
						iBrCtlInterface->LoadUrlL(iOptionsPage);
					    //iBrCtlInterface->ClearCache();
					}
				break;
			}	
	        case ECmdTakePicture:
	        	{
	        	iRhoCamera->StopViewFinder();
				iRhoCamera->StartViewFinderL();
	        	break;
	        	}
	        case ECmdChoosePicture:
	        	{
	        	ChoosePicture();	
	        	break;
	        	}
			case ELoggingOptions:
				{
					
					iBrCtlInterface->SetDimmed( ETrue);
					iBrCtlInterface->MakeVisible( EFalse );
					iBrCtlInterface->DrawNow();
					
					 CLogOptionsDialog::RunDlgLD();
					 
					 iBrCtlInterface->SetDimmed( EFalse );
					 iBrCtlInterface->MakeVisible( ETrue );
					 iBrCtlInterface->DrawNow();
					 
					 break;
				}
			case ELogView:
				{
					rho::String strText;
					LOGCONF().getLogText(strText);
						
					TPtrC8 ptr8((TUint8*)strText.c_str());
					HBufC *msg = HBufC::NewLC(ptr8.Length());
					msg->Des().Copy(ptr8);

					CAknMessageQueryDialog* dlg = CAknMessageQueryDialog::NewL(*msg);
					dlg->PrepareLC(R_STAT_QUERY_DIALOG);
					HBufC* title = iEikonEnv->AllocReadResourceLC(R_LOG_VIEW_DIALOG_TITLE);
					dlg->QueryHeading()->SetTextL(*title);
					CleanupStack::PopAndDestroy(); //title
					
					dlg->SetExtentToWholeScreen();
					dlg->RunLD();
					
					CleanupStack::PopAndDestroy(msg);
										
					break;
				}
	        /*case EAknSoftkeyCancel:
        	{
        		CEikButtonGroupContainer* current = CEikButtonGroupContainer::Current();
	        	if ( current )
        		{
	        		current->SetCommandSetL( R_AVKON_SOFTKEYS_OPTIONS_BACK );
	        		current->SetFocus(EFalse, EDrawNow);
        		}
	        	break;
        	}*/
	        default:
	        	if (aCommand >= iCommandBase &&
	                aCommand < iCommandBase + TBrCtlDefs::ECommandIdWMLBase &&
	                iBrCtlInterface)
	                {
	                iBrCtlInterface->HandleCommandL(aCommand);
	                }

	            if (aCommand >= iCommandBase + TBrCtlDefs::ECommandIdWMLBase &&
	                aCommand < iCommandBase + TBrCtlDefs::ECommandIdRange &&
	                iBrCtlInterface)
	                {
	                iBrCtlInterface->HandleCommandL(aCommand);
	                }              
	            break;      
	    }
	    
	}
TKeyResponse CSymellaSearchContainer::OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType)
{
	if (aType == EEventKey) 
	{
		switch (aKeyEvent.iCode) 
		{
		case EKeyUpArrow:
		case EKeyDownArrow:
			return iListBox->OfferKeyEventL(aKeyEvent, aType);
		case EKeyDevice3: //EKeyOk
			{
				if (CurrentItemIndex() >= 0)
				{
					HBufC* info = CTR->DlManager()->CreateHitInfoL(CurrentItemIndex());
					CleanupStack::PushL(info);

					/*CAknNoteDialog* note = new (ELeave) CAknNoteDialog;
					CleanupStack::PushL(note);
					note->SetTextL(*info);
					CleanupStack::Pop();
					note->PrepareLC(R_HIT_INFO_NOTE);
					note->RunLD();*/
					CAknMessageQueryDialog* dlg = new (ELeave)CAknMessageQueryDialog();
					dlg->PrepareLC( R_MESSAGE_QUERY );
					dlg->SetMessageTextL(info->Des());
					dlg->QueryHeading()->SetTextL(_L("Hit info"));
					dlg->RunLD();

					CleanupStack::PopAndDestroy();
				}
			}
			break;
		case EKeyLeftArrow:
		case EKeyRightArrow:
		{
			// Empty FindBox Search Text		
			_LIT(KBlank, "");
			FindBox()->SetSearchTextL(KBlank);

			// Press Backspace on Empty FindBox to Close it
			TBool refresh = false;
			TKeyEvent key;
			key.iCode = 8;
			key.iScanCode = 1;
			key.iRepeats = 1;
			key.iModifiers = 0;
			AknFind::HandleFindOfferKeyEventL(key, EEventKey, this, ListBox(), FindBox(), ETrue, refresh);
		}
		break;
			
		default:
			{
				if (iFindBox)
				{
					

					TBool needRefresh( EFalse );
	            	TBool flagsOfPopup( EFalse );

					if ( AknFind::HandleFindOfferKeyEventL( aKeyEvent, aType, this,
		                                                    iListBox, iFindBox,
		                                                    ETrue,
		                                                    needRefresh ) ==
		                                                        EKeyWasConsumed )
		            {
		                if ( needRefresh )
		                {
		                	SizeChanged();
		                    DrawNow();
		                }

		                return EKeyWasConsumed;
		            }
				}
			}
			break;
		}
	}

	return EKeyWasNotConsumed;
}
Example #9
0
// -----------------------------------------------------------------------------
// CRhodesAppUi::HandleCommandL()
// Takes care of command handling.
// -----------------------------------------------------------------------------
//
void CRhodesAppUi::HandleCommandL(TInt aCommand)
	{
	switch (aCommand)
		{
		case EEikCmdExit:
		case EAknSoftkeyExit:
			
			if ( iSyncEngineWrap )
				iSyncEngineWrap->TerminateThread();
			
			Exit();
			break;
		case EHelp:
			{

			CArrayFix<TCoeHelpContext>* buf = CCoeAppUi::AppHelpContextL();
			HlpLauncher::LaunchHelpApplicationL(iEikonEnv->WsSession(), buf);
			}
			break;
		case EAbout:
			{

			CAknMessageQueryDialog* dlg = new (ELeave)CAknMessageQueryDialog();
			dlg->PrepareLC(R_ABOUT_QUERY_DIALOG);
			HBufC* title = iEikonEnv->AllocReadResourceLC(R_ABOUT_DIALOG_TITLE);
			dlg->QueryHeading()->SetTextL(*title);
			CleanupStack::PopAndDestroy(); //title
			HBufC* msg = iEikonEnv->AllocReadResourceLC(R_ABOUT_DIALOG_TEXT);
			dlg->SetMessageTextL(*msg);
			CleanupStack::PopAndDestroy(); //msg
			dlg->RunLD();
			}
			break;
#ifdef ENABLE_RUBY_VM_STAT			
		case EStat:
			{
			CAknMessageQueryDialog* dlg = new (ELeave)CAknMessageQueryDialog();
			dlg->PrepareLC(R_STAT_QUERY_DIALOG);
			HBufC* title = iEikonEnv->AllocReadResourceLC(R_STAT_DIALOG_TITLE);
			dlg->QueryHeading()->SetTextL(*title);
			CleanupStack::PopAndDestroy(); //title
			char buf[500] = {0};
			sprintf( buf,    "stat:\n___________________\n"
							 "iceq stat:\n "
							 "iseq binread: %u%s\n"
							 "iseq marshal: %u%s\n"
							 "require_compiled: %u%s\n"
							 "httpd thread loaded: %d\n"
							 "sync thread loaded: %d\n",
							 g_iseq_binread_msec, "msec",
							 g_iseq_marshal_load_msec, "msec",
							 g_require_compiled_msec, "msec",
							 g_httpd_thread_loaded,
							 g_sync_thread_loaded);
			
			TPtrC8 ptr8((TUint8*)buf);
			HBufC *msg = HBufC::NewLC(ptr8.Length());
			msg->Des().Copy(ptr8);
			dlg->SetMessageTextL(*msg);
			CleanupStack::PopAndDestroy(msg);
			dlg->RunLD();
			}	
			break;
#endif			
		default:
			iAppView->HandleCommandL(aCommand);
			break;
		}
	}
Example #10
0
/*
-----------------------------------------------------------------------
-----------------------------------------------------------------------
*/
TBool CMovingBallAppUi::ShowDisclaimerL(void)
{
	TBool OkToContinue(EFalse);

	TFindFile AppFile(CCoeEnv::Static()->FsSession());
	if(KErrNone != AppFile.FindByDir(KtxDisclaimerFileName, KNullDesC))
	{
		HBufC* Abbout = KtxDisclaimer().AllocLC();
		TPtr Pointter(Abbout->Des());
		CAknMessageQueryDialog* dlg = CAknMessageQueryDialog::NewL(Pointter);
		dlg->PrepareLC(R_DDD_HEADING_PANE);
		dlg->SetHeaderTextL(KtxDisclaimerTitle);  
		if(dlg->RunLD())
		{
			TFileName ShortFil;
		#ifdef __SERIES60_3X__
			if(KErrNone ==CCoeEnv::Static()->FsSession().PrivatePath(ShortFil))
			{
				TFindFile privFile(CCoeEnv::Static()->FsSession());
				if(KErrNone == privFile.FindByDir(ShortFil, KNullDesC))
				{
					TParsePtrC hjelp(privFile.File());
					ShortFil.Copy(hjelp.Drive());
					ShortFil.Append(KtxDisclaimerFileName);
				}
			}
		#else
			TFindFile privFile(CCoeEnv::Static()->FsSession());
			if(KErrNone == privFile.FindByDir(KtxApplicationFileName, KNullDesC))
			{
				TParsePtrC hjelp(privFile.File());
				ShortFil.Copy(hjelp.Drive());
				ShortFil.Append(KtxDisclaimerFileName);
			}
		#endif
		
			BaflUtils::EnsurePathExistsL(CCoeEnv::Static()->FsSession(),ShortFil);
		
			RFile MyFile;
			if(KErrNone == MyFile.Create(CCoeEnv::Static()->FsSession(),ShortFil,EFileWrite))
			{
				TTime NowTime;
				NowTime.HomeTime();
				
				TBuf8<255> InfoLine;
				InfoLine.Copy(_L8("Accepted on Date\t"));
					
				InfoLine.AppendNum(NowTime.DateTime().Day() + 1);
				InfoLine.Append(_L8("."));
				InfoLine.AppendNum((NowTime.DateTime().Month() + 1));
				InfoLine.Append(_L8("."));
				InfoLine.AppendNum(NowTime.DateTime().Year());
				InfoLine.Append(_L8(" "));
				InfoLine.Append(_L8("--"));
				InfoLine.AppendNum(NowTime.DateTime().Hour());
				InfoLine.Append(_L8(":"));		
				TInt HelperInt = NowTime.DateTime().Minute();
				if(HelperInt < 10)
					InfoLine.AppendNum(0);
				InfoLine.AppendNum(HelperInt);
				InfoLine.Append(_L8(":"));
				HelperInt = NowTime.DateTime().Second();
				if(HelperInt < 10)
					InfoLine.AppendNum(0);
				InfoLine.AppendNum(HelperInt);
				InfoLine.Append(_L8(" "));
				
				MyFile.Write(InfoLine);
				MyFile.Close();
			}
			
			OkToContinue = ETrue;
		}
		
		CleanupStack::PopAndDestroy(Abbout);
	}
	else
	{
		OkToContinue = ETrue;
	}
	
	return OkToContinue;
}
void CPhotoListView::HandleCommandL(TInt aCommand)
    {   
	TInt path;
	TInt count;

    switch ( aCommand )
        {
		case EMarkSel:
			{
				TInt count;
				if( iPhotosAppUi->ImageFolderPath() == 0 || iPhotosAppUi->ImageFolderPath() == 2)
					count = iContainer->iPhoneCount;
				else
					count = iContainer->iMmcCount;

				if(count > 0)
					iContainer->MarkUnMarkSelectedItem();
			}
			break;
		case EMarkAll:
			{
				TInt count;
				if( iPhotosAppUi->ImageFolderPath() == 0 || iPhotosAppUi->ImageFolderPath() == 2)
					count = iContainer->iPhoneCount;
				else
					count = iContainer->iMmcCount;

				if(count > 0)
					iContainer->MarkAllItems();
			}
			break;
		case EUnMarkAll:
			{
				TInt count;
				if( iPhotosAppUi->ImageFolderPath() == 0 || iPhotosAppUi->ImageFolderPath() == 2)
					count = iContainer->iPhoneCount;
				else
					count = iContainer->iMmcCount;

				if(count > 0)
					iContainer->UnMarkAllItems();
			}
			break;
        //case EAknSoftkeyDone:
		case ESendSel:
            {
				TInt count;
				if( iPhotosAppUi->ImageFolderPath() == 0 || iPhotosAppUi->ImageFolderPath() == 2)
					count = iContainer->iPhoneCount;
				else
					count = iContainer->iMmcCount;

				if(count > 0)
					iContainer->MarkSelectedItem();

				iPhotoSendMode = iContainer->IsImageSelected();
				if(iPhotoSendMode == 1)
				{
					TBuf<150> msg;
					TInt path=0;	
					
					count = GetPhotoCount();

					msg.Copy(_L(""));

					msg.AppendNum(count);

					path = iPhotosAppUi->ImageFolderPath();
					if(path == 0 || path == 1)			
						//msg.Append(_L(" Photos"));
						msg.Append(*(iEikonEnv->AllocReadResourceL(R_IMAGES_CONFIRM_PHOTOS)));
					else if(path == 2 || path == 3)
						//msg.Append(_L(" Videos"));		
						msg.Append(*(iEikonEnv->AllocReadResourceL(R_IMAGES_CONFIRM_VIDEOS)));

					//msg.Append(_L(" will be sent to your Ripple Vault. Confirm?"));
					msg.Append(*(iEikonEnv->AllocReadResourceL(R_IMAGES_CONFIRM)));

					CAknMessageQueryDialog* dlg = CAknMessageQueryDialog::NewL(msg);
					dlg->PrepareLC(R_UPLOAD_ALLPHOTOS);
					if(dlg->RunLD())
					{
						SendPhotoToServer();
						
						iPhotosAppUi->ActivateView(KViewIdStatusScreen);
						
						/*
						TInt8 choice;
						iPhotosAppUi->GetChoice(choice);
						if(choice){
							//iPhotosAppUi->ActivateView(KViewIdSubScreen);
							iPhotosAppUi->ActivateView(KViewIdEmptyScreen);
							iPhotosAppUi->ActivateView(KViewIdStatusScreen);
						}
						else
						{
							if(iPhotosAppUi->iStoragePath==PHOTOS_PHONEMEMORY || iPhotosAppUi->iStoragePath==PHOTOS_MMC){
								iPhotosAppUi->iStoragePath = VIDEOS_PHONEMEMORY;									
								iPhotosAppUi->ActivateView(KViewIdEmptyScreen );
								iPhotosAppUi->ActivateView(KViewIdPhotoList );
							}
							else{
								iPhotosAppUi->CallSetupWizardStep12();
							}
						}
						*/
					}
				}
				else
				{					
						path = iPhotosAppUi->ImageFolderPath();

						CAknMessageQueryDialog* abtdlg;
						
						//abtdlg= CAknMessageQueryDialog::NewL(*(CEikonEnv::Static()->AllocReadResourceL(R_TEXT_HELP_RIPPLE_VAULT)));
						//abtdlg->SetHeaderTextL(*(CEikonEnv::Static()->AllocReadResourceL(R_EXAMPLE_RIPPLE_PUBLISH)));

					if(path == 0 || path == 1)
						//iPhotosAppUi->ShowMessageBoxFromResource(R_EXAMPLE_TEXT_NOTSEL);
						abtdlg= CAknMessageQueryDialog::NewL(*(CEikonEnv::Static()->AllocReadResourceL(R_EXAMPLE_TEXT_NOTSEL)));
					else if(path == 2 || path == 3)
						//iPhotosAppUi->ShowMessageBoxFromResource(R_EXAMPLE_TEXT_NOTSEL1);
						abtdlg= CAknMessageQueryDialog::NewL(*(CEikonEnv::Static()->AllocReadResourceL(R_EXAMPLE_TEXT_NOTSEL1)));

							abtdlg->PrepareLC(R_UPGRADE_QUERY);

							if (abtdlg->RunLD()) 
							{
							}
							else
							{

								iPhotosAppUi->ActivateView(KViewIdStatusScreen);
								/*
								TInt8 choice;
								iPhotosAppUi->GetChoice(choice);
								if(choice)
									iPhotosAppUi->ActivateView(KViewIdSubScreen );
								else
								{
									if(iPhotosAppUi->iStoragePath==PHOTOS_PHONEMEMORY || iPhotosAppUi->iStoragePath==PHOTOS_MMC){
										iPhotosAppUi->iStoragePath = VIDEOS_PHONEMEMORY;
										iPhotosAppUi->ActivateView(KViewIdEmptyScreen );
										iPhotosAppUi->ActivateView(KViewIdPhotoList );
									}
									else{
										iPhotosAppUi->CallSetupWizardStep12();
									}
								}*/
							}

				}
				break;
            }
		case ESendAll:
			{
				iPhotoSendMode = 1000;
				SendPhotoToServer();
				break;
			}
		//case ESendSel:
		case EAknSoftkeyBack:
            {
				if(iContainer->IsImageSelected())
				{
					CAknMessageQueryDialog* abtdlg;
					abtdlg= CAknMessageQueryDialog::NewL(*(CEikonEnv::Static()->AllocReadResourceL(R_TEXT_CANCEL_BACKUP)));
					abtdlg->PrepareLC(R_GALLERY_INFO);
					if (abtdlg->RunLD()) 
					{
						iPhotosAppUi->ActivateView(KViewIdStatusScreen);
					}
				}
				else
					iPhotosAppUi->ActivateView(KViewIdStatusScreen);
				
				/*
				TInt8 choice;
				iPhotosAppUi->GetChoice(choice);
				if(choice)
					iPhotosAppUi->ActivateView(KViewIdSubScreen );
				else
				{
					if(iPhotosAppUi->iStoragePath==PHOTOS_PHONEMEMORY || iPhotosAppUi->iStoragePath==PHOTOS_MMC){
						iPhotosAppUi->iStoragePath = VIDEOS_PHONEMEMORY;									
						iPhotosAppUi->ActivateView(KViewIdEmptyScreen );
						iPhotosAppUi->ActivateView(KViewIdPhotoList );
					}
					else{
						iPhotosAppUi->CallSetupWizardStep12();
					}
				}
				*/

				break;
            }
        default:
            {       
			AppUi()->HandleCommandL(aCommand);
            break;
            }
        }
    }