// -----------------------------------------------------------------------------
// CThemeChangeAppUi::HandleCommandL()
// Takes care of command handling.
// -----------------------------------------------------------------------------
//
void CThemeChangeAppUi::HandleCommandL(TInt aCommand)
	{
	switch (aCommand)
		{
		case EEikCmdExit:
		case EAknSoftkeyExit:
			Exit();
			break;
		case ECommandExit:
			if (ShowConfirmationQueryL(R_TEXT_DLG_EXIT_CONFIRM))
				Exit();
			break;
		case EAbout:
			About();
			break;

		case ECommandHelp:
			ActivateLocalViewL(TUid::Uid(EThemeChangeHelpView));
			break;
		case ECommandSetting:
			ActivateLocalViewL(TUid::Uid(EThemeChangeSettingView));
			break;
		default:
			Panic(EThemeChangeUi);
			break;
		}
	}
// -----------------------------------------------------------------------
// Key Event Handler - Primarily to automate navigation through tab groups
// -----------------------------------------------------------------------
TKeyResponse CHindiDemoAppUi::HandleKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
{
  if (aType == EEventKey) 
  {
    if (iTabGroup == NULL)
    {
      return EKeyWasNotConsumed;
    } 
  }

  TInt active = iTabGroup->ActiveTabIndex();
  TInt count = iTabGroup->TabCount();

  switch (aKeyEvent.iCode) 
  {
    case EKeyLeftArrow:
      if (active > 0) 
      {
        // -----------------------------------------------------------------------
        // Change to usual layout
        // -----------------------------------------------------------------------
	TRect cr = ClientRect();
	if (cr.iTl.iY == Kqpn_height_status_pane_idle) 
        {
	  StatusPane()->SwitchLayoutL(R_AVKON_STATUS_PANE_LAYOUT_USUAL);
	}

	active--;
	iTabGroup->SetActiveTabByIndex(active);
	ActivateLocalViewL(TUid::Uid(iTabGroup->TabIdFromIndex(active)));
	return EKeyWasConsumed;
      }
      break;

    case EKeyRightArrow:
      if((active + 1) < count) 
      {
        TRect cr = ClientRect();  
        if (cr.iTl.iY == Kqpn_height_status_pane_idle) 
        {
	  StatusPane()->SwitchLayoutL(R_AVKON_STATUS_PANE_LAYOUT_USUAL);
        }

        active++;
        iTabGroup->SetActiveTabByIndex(active);
        ActivateLocalViewL(TUid::Uid(iTabGroup->TabIdFromIndex(active)));
        return EKeyWasConsumed;
      }
    break;

    default:
      break;
  }        

  return EKeyWasNotConsumed;
}
Example #3
0
void CMLauncherAppUi::CreateStopwatchViewL(void)
{
    LOG(ELogGeneral,1,"AppUi::CreateStopwatchViewL: start");

    //first, display the form to the user
    //create & initialie the data
    TStopwatchData stopwatchData;
    //TODO: initialize from preferences

    // Launch the dialog to edit data
    CAknForm* dlg = CStopwatchForm::NewL(stopwatchData);
    if(dlg->ExecuteLD(R_STOPWATCH_FORM_DIALOG))
    {
        //user did not dismissed the dialog, create the view
        if(iStopwatchView==NULL)
        {
            //create the view and switch to it
            iStopwatchView=CStopwatchView::NewLC();
            iStopwatchView->iStopwatchData=stopwatchData;
            AddViewL(iStopwatchView);//transfers ownership
            CleanupStack::Pop(iStopwatchView);
        };
        iCurrentView=iStopwatchView;
        iActiveViews|=EStopwatchViewActive;
        //ChangeExitWithNaviL(KStopwatchViewId);
        ActivateLocalViewL(TUid::Uid(KStopwatchViewId));
    };

    LOG(ELogGeneral,-1,"AppUi::CreateStopwatchViewL: end");
};
void CPodcastAppUi::TabChangedL (TInt aIndex)
	{
	DP("CPodcastListView::TabChangedL ");
	
	if (iNaviStyle == ENaviTabGroup)
		{
		TUid newview = TUid::Uid(0);
		TUid messageUid = TUid::Uid(0);
		if (aIndex == KTabIdFeeds) 
			{
			if (iFeedView->ViewingShows())
				{
				newview = KUidPodcastShowsViewID;
				}
			else
				{
				newview = KUidPodcastFeedViewID;
				}
			} 
		else if (aIndex == KTabIdQueue)
			{
			newview = KUidPodcastQueueViewID;
			} 
		else 
			{
			User::Leave(KErrTooBig);
			}
		
		if(newview.iUid != 0)
			{			
			ActivateLocalViewL(newview,  messageUid, KNullDesC8());
			}
		}
	}
Example #5
0
void CMLauncherAppUi::CreateMusicPlayerViewL(CPlaylist *aPlaylist, TBool aIsPreview, TBool aStartPlaying)
{
	LOG(ELogGeneral,1,"AppUi::CreateMusicPlayerViewL: start");
	
	//check if we need to load this playlist
	TRAPD(err,aPlaylist->LoadPlaylistL(MyDoc()));
	if(err)
	{
		LOG(ELogGeneral,-1,"AppUi::CreateMusicPlayerViewL: end (error loading playlist: %d)",err);
		return;
	};

	if(iMusicPlayerView==NULL)
	{
		//create the view and switch to it
		iMusicPlayerView=CMusicPlayerView::NewLC();
		AddViewL(iMusicPlayerView);//transfers ownership
		CleanupStack::Pop(iMusicPlayerView);
	};
	iCurrentView=iMusicPlayerView;
	iActiveViews|=EMusicPlayerViewActive;
	ActivateLocalViewL(TUid::Uid(KMusicPlayerViewId));
	err=iMusicPlayerView->StartPlaylistL(aPlaylist,aIsPreview,aStartPlaying);
	if(err)
		CloseMusicPlayerViewL();
	LOG(ELogGeneral,-1,"AppUi::CreateMusicPlayerViewL: end");
};
Example #6
0
TKeyResponse CAppUi::HandleKeyEventL(const TKeyEvent &aKeyEvent, TEventCode
  aType)
{
  TKeyResponse keyResponse = EKeyWasNotConsumed;

  if (aType != EEventKey)
  {
    return keyResponse;
  }

  switch (aKeyEvent.iCode)
  {
    case EKeyOK:
      {
        ActivateLocalViewL(KCamViewId);
        keyResponse = EKeyWasConsumed;
        break;
      }
    default:
      {
        keyResponse = EKeyWasNotConsumed;
        break;
      }
  }
  return keyResponse;
}
Example #7
0
TKeyResponse CIncallertAppUi::HandleKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
{

    TKeyResponse ret = iTabGroup->OfferKeyEventL(aKeyEvent,aType);

    if(ret == EKeyWasConsumed)
        ActivateLocalViewL(TUid::Uid(iTabGroup->ActiveTabId()));

    return ret;
}
Example #8
0
void CMLauncherAppUi::SourcesViewDoneL()
{
    LOG(ELogGeneral,1,"SourcesViewDone: start");
    //iActiveViews&=~ESourcesViewActive; //no need to do it, because we can not activate any other view from the sources view
    //we need to switch to list view
    iCurrentView=iListView;
    ActivateLocalViewL(iCurrentView->Id());

    LOG(ELogGeneral,-1,"SourcesViewDone: end");
};
// ---------------------------------------------------------------------------
// symbian 2nd phase ctor
// ---------------------------------------------------------------------------
//
void CBCTestEditorAppUi::ConstructL()
    {
    BaseConstructL();
    AknsUtils::SetAvkonSkinEnabledL( ETrue );

    // init view
    CBCTestEditorView* view = CBCTestEditorView::NewL();
    CleanupStack::PushL( view );
    AddViewL( view );
    CleanupStack::Pop( view );    
    
    ActivateLocalViewL( view->Id() );
    }
Example #10
0
// ----------------------------------------------------
// CSymellaAppUi::HandleKeyEventL(
//     const TKeyEvent& aKeyEvent,TEventCode /*aType*/)
// ?implementation_description
// ----------------------------------------------------
//
TKeyResponse CSymellaAppUi::HandleKeyEventL(
    const TKeyEvent& aKeyEvent,TEventCode /*aType*/)
    {
    if ( iTabGroup == NULL )
        {
        return EKeyWasNotConsumed;
        }

    TInt active = iTabGroup->ActiveTabIndex();
    TInt count = iTabGroup->TabCount();

    switch ( aKeyEvent.iCode )
        {
        case EKeyLeftArrow:
            if ( active > 0 )
                {
                active--;
                iTabGroup->SetActiveTabByIndex( active );
                ActivateLocalViewL(TUid::Uid(iTabGroup->TabIdFromIndex(active)));
                }
            break;
        case EKeyRightArrow:
            if( (active + 1) < count )
                {
                active++;
                iTabGroup->SetActiveTabByIndex( active );
                ActivateLocalViewL(TUid::Uid(iTabGroup->TabIdFromIndex(active)));
                }
            break;
        default:
            return EKeyWasNotConsumed;
            break;
        }

    return EKeyWasConsumed;
    }
// ----------------------------------------------------------------------------
// void CBCTestQueryAppUi::ConstructL()
// Symbian 2nd phase constructor can leave.
// Creates view class object.
// ----------------------------------------------------------------------------
void CBCTestQueryAppUi::ConstructL()
    {
    BaseConstructL();
    AknsUtils::SetAvkonSkinEnabledL( ETrue );
    
    iTestUtil = CBCTestUtil::NewL();
    
    CBCTestQueryView* view = CBCTestQueryView::NewL( iTestUtil );
    CleanupStack::PushL( view );
    AddViewL( view );
    CleanupStack::Pop( view );    
    
    ActivateLocalViewL( view->Id() );
    
    }
Example #12
0
void CMLauncherAppUi::CreateSourcesViewL()
{
	LOG(ELogGeneral,1,"AppUi::CreateSourcesViewL: start");

	if(iSourcesView==NULL)
	{
		//create the view and switch to it
		iSourcesView=CSourcesView::NewLC();
		AddViewL(iSourcesView);//transfers ownership
		CleanupStack::Pop(iSourcesView);
	};
	iCurrentView=iSourcesView;
	//iActiveViews|=ESourcesViewActive;//no need to set this view as active, because we can not switch away from it anyway
	ActivateLocalViewL(TUid::Uid(KSourcesViewId));
	LOG(ELogGeneral,-1,"AppUi::CreateSourcesViewL: end");
};
Example #13
0
void CMLauncherAppUi::CreateMyFilesViewL()
{
	LOG(ELogGeneral,1,"AppUi::CreateMyFilesView: start");

	if(iMyFilesView==NULL)
	{
		//create the view and switch to it
		iMyFilesView=CMyFilesView::NewLC();
		AddViewL(iMyFilesView);//transfers ownership
		CleanupStack::Pop(iMyFilesView);
	};
	iCurrentView=iMyFilesView;
	iActiveViews|=EMyFilesViewActive;
	ActivateLocalViewL(TUid::Uid(KMyFilesViewId));
	LOG(ELogGeneral,-1,"AppUi::CreateMyFilesView: end");
}
Example #14
0
void CMLauncherAppUi::NewTransferL(const TInt aNrFiles, const TInt aTotalSize, const RArray<TInt> &aFileSizes)
{
	LOG(ELogGeneral,1,"AppUi::NewTransferL: start");
	if(iFiletransferView==NULL)
	{
		//create the view and switch to it
		iFiletransferView=CFiletransferView::NewLC();
		AddViewL(iFiletransferView);//transfers ownership
	    CleanupStack::Pop(iFiletransferView);
	};
	iFiletransferView->NewTransferL(aNrFiles,aTotalSize,aFileSizes);
	iCurrentView=iFiletransferView;
	iActiveViews|=EFiletransferViewActive;
	//ChangeExitWithNaviL(KFiletransferViewId);
	ActivateLocalViewL(TUid::Uid(KFiletransferViewId));
	LOG(ELogGeneral,-1,"AppUi::NewTransferL: end");
};
Example #15
0
/*
-----------------------------------------------------------------------------

  CSAEXAppUi::ConstructL()                          
  
  2nd phase constructor

-----------------------------------------------------------------------------
*/
void CSAEXAppUi::ConstructL()
    {

    BaseConstructL();                                   // init this AppUi with standard values

	iSession=NULL;	
	iSession=CMsvSession::OpenSyncL(*this);

    iRecipient=HBufC::NewL(KMaxTelephoneNumberLength);  // for recipient sms number
    iRecipient->Des() = _L("09416043351");                             

    // Create SendUi
    iSUI = CSendAppUi::NewL(ESAEXCmdSendUi); 

    // Series60 view launching
    CSAEXAppView* view = CSAEXAppView::NewLC(); 
    AddViewL(view);                     // add created view to this AppUi
    ActivateLocalViewL( view->Id() );   // activate view
    CleanupStack::Pop(); // view
    }
// --------------------------------------------------------------------------
// symbian 2nd phase ctor
// --------------------------------------------------------------------------
//
void CBCTestButtonAppUi::ConstructL()
    {
    BaseConstructL();
    AknsUtils::SetAvkonSkinEnabledL( ETrue );

	// init test util
	iTestUtil = CBCTestUtil::NewL();

    // init view
    CBCTestButtonView* view = CBCTestButtonView::NewL(iTestUtil);
    CleanupStack::PushL( view );
    AddViewL( view );
    CleanupStack::Pop( view );    
    
    ActivateLocalViewL( view->Id() );

	// Add test case here.
    iTestUtil->AddTestCaseL( CBCTestButtonCase::NewL( view->Container() ),
        _L("AknButton test case") );
    }
// ---------------------------------------------------------------------------
// symbian 2nd phase ctor
// ---------------------------------------------------------------------------
//
void CBCTestVolumeAppUi::ConstructL()
    {
    BaseConstructL();
    AknsUtils::SetAvkonSkinEnabledL( ETrue );

    // Creates CBCTestVolumeView class object.
    CBCTestVolumeView* view = CBCTestVolumeView::NewL();
    CleanupStack::PushL( view );
    AddViewL( view ); // transfer ownership to CAknViewAppUi.
    CleanupStack::Pop(); // view

    ActivateLocalViewL( view->Id() );

    // init bc test framework    
    iTestUtil = CBCTestUtil::NewL();

    // add all test cases....
    iTestUtil->AddTestCaseL( CTestVolumeSettingPage::NewL(view), _L("CTestVolumeSettingPage") );
    iTestUtil->AddTestCaseL( CTestVolumeNaviPane::NewL(view), _L("CTestVolumeNaviPane") );
	iTestUtil->AddTestCaseL( CTestOthers::NewL(view), _L("CTestOthers") );
    }
Example #18
0
// -----------------------------------------------------------------------------
// CAknExNoteAppUi::ConstructL()
// Symbian 2nd phase constructor can leave.
// -----------------------------------------------------------------------------
//
void CAknExNoteAppUi::ConstructL()
    {

    // Initialise app UI with standard value.
    BaseConstructL( EAknEnableSkin );

    // Creates CAknExNoteView class object.
    CAknExNoteView* view = new( ELeave ) CAknExNoteView;

    // Push CAknExNoteView's pointer into CleanUpStack for safety object construction.
    CleanupStack::PushL( view );

    //Construct View
    view->ConstructL();
    
     // View is constructed correctly , Pop it's pointer from CleanUpStack
    CleanupStack::Pop();

    // Transfer ownership to CAknViewAppUi.
    AddViewL( view ); 

    ActivateLocalViewL( view->Id() );
    }
// -----------------------------------------------------------------------
// Constructs AppUI Object
// -----------------------------------------------------------------------
void CHindiDemoAppUi::ConstructL()
{
  BaseConstructL();
  InitViewsL();

#ifdef WITH_TAB_GROUP
  // -----------------------------------------------------------------------
  // Show tabs for main views from resources
  // -----------------------------------------------------------------------
  CEikStatusPane* sp = StatusPane();
  iNaviPane = (CAknNavigationControlContainer *)sp->ControlL(TUid::Uid(EEikStatusPaneUidNavi));
  sp->SetDimmed(ETrue);

  // -------------------------------------------------------------------------------
  // Tabgroup has been read from resource and it was pushed to the navi pane.
  // Get pointer to the navigation decorator with the ResourceDecorator() function.
  // Application owns the decorator and it has responsibility to delete the object.
  // -------------------------------------------------------------------------------
  iDecoratedTabGroup = iNaviPane->ResourceDecorator();

  if (iDecoratedTabGroup) 
  {
    iTabGroup = (CAknTabGroup*) iDecoratedTabGroup->DecoratedControl();
  }

  if (iTabGroup) 
  {
    ActivateLocalViewL(TUid::Uid(iTabGroup->ActiveTabId()));
  } 
#else
  // -----------------------------------------------------------------------
  // Set default view
  // -----------------------------------------------------------------------
  SetDefaultViewL(*iMainViewView);
#endif
}
Example #20
0
// ----------------------------------------------------
// CSymellaAppUi::HandleCommandL(TInt aCommand)
// ?implementation_description
// ----------------------------------------------------
//
void CSymellaAppUi::HandleCommandL(TInt aCommand)
{
    switch ( aCommand )
    {
		case ESymellaCmdConnect:
		{
			CTR->ConnectL();
		}
		break;

		case ESymellaCmdSelectGenre:
		{
			TInt index = 0;
			CAknListQueryDialog* queryDialog = new(ELeave) CAknListQueryDialog(&index);
			if(queryDialog->ExecuteLD(R_SYMELLA_GENRE_SELECTION_LIST))
			{
				CTR->SetGenre(index);
			}
		}
		break;

		case ESymellaCmdResetHostCache:
		{
			// ask to quit
			CAknQueryDialog* query = CAknQueryDialog::NewL();
			CleanupStack::PushL(query);
			_LIT(KPrompt, "Are you sure you want to reset the hostcache?");
			query->SetPromptL(KPrompt);
			CleanupStack::Pop(); // query

			if (query->ExecuteLD(R_GENERAL_QUERY))
			{				
				CTR->HostCache().Reset();				
			}		

		}
		break;

		case ESymellaCmdDisconnect:
		{
			CTR->DisconnectL();
		}
		break;

		case ESymellaCmdConnectInfo:
		{
			HBufC* info = CTR->CreateConnectInfoL();
			CleanupStack::PushL(info);

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

			CleanupStack::PopAndDestroy(); //info
		}
		break;

		case ESymellaCmdAbout:
		{
			TBuf<30> time;
			TBuf<50> date;
			date.Copy(_L8(__DATE__));
			time.Copy(_L8(__TIME__));
			_LIT(KBuild, "Built on ");
			HBufC* info = HBufC::NewLC(TPtrC(KAbout).Length() + 64 /*+ TPtrC(KEngineVersion).Length() */+
				TPtrC(KBuild).Length() + date.Length() + 4);
			TPtr des = info->Des();
			des.Append(_L("Version "));
			des.Append(SYMELLA_VERSION_LIT);
			des.Append(KAbout);
			//des.Append(KEngineVersion);
			des.Append(KBuild);
			des.Append(date);

			CAknMessageQueryDialog* dlg = new (ELeave)CAknMessageQueryDialog();
			CleanupStack::PushL(dlg);
			dlg->PrepareLC( R_MESSAGE_QUERY );
			dlg->SetMessageTextL(des);
			dlg->QueryHeading()->SetTextL(_L("Symella S60"));
			CleanupStack::Pop(); //dlg
			dlg->RunLD();

			CleanupStack::PopAndDestroy(); //info
		}
		break;

		case ESymellaCmdAddNode:
            {
				// Create dialog to allow user to view/edit connection details
				TBuf<100> hostName;
				//hostName.Copy(_L(""));
			          hostName.Copy(_L("192.168.0.100"));
				TInt port = 6346;

				CAknMultiLineDataQueryDialog* dialog =
					CAknMultiLineDataQueryDialog::NewL(hostName, port);

				// Display and execute dialog, and act according to return value
				if (dialog->ExecuteLD(R_ADD_NODE_DIALOG))
				{
					TInetAddr addr;

					if (addr.Input(hostName) == KErrNone)
					{
						addr.SetPort(port);
						CTR->HostCache().AddUltrapeerL(addr);
					}                              
				}
            }
            break;
           
    	case EAknCmdExit:
        case EEikCmdExit:
        {
        	PREFERENCES->SaveWebCachesL();
    		LOG->WriteLineL(_L("Saving hostcache..."));
			CTR->HostCache().SaveHostCacheL();
			LOG->WriteLineL(_L("Symella terminating"));
			Exit();	
        }
    	break;
    	
    	case EAknSoftkeyBack:
		case EAknSoftkeyExit:
		{			
        	// ask to quit
			CAknQueryDialog* query = CAknQueryDialog::NewL();
			CleanupStack::PushL(query);
			_LIT(KPrompt, "Quit Symella?");
			query->SetPromptL(KPrompt);
			CleanupStack::Pop(); // query

			if (query->ExecuteLD(R_GENERAL_QUERY))
			{
			//	((CSymellaSearchView*)View(TUid::Uid(1)))->CloseFindBoxL();
				PREFERENCES->SaveWebCachesL();
				LOG->WriteLineL(_L("Saving hostcache..."));
				CTR->HostCache().SaveHostCacheL();
				LOG->WriteLineL(_L("Symella terminating"));
				Exit();								
			}		
        }			
        break;

		case ESymellaCmdSearch:
		{
			TBuf<256> query;
			query.Copy(CTR->SearchString());
			CAknTextQueryDialog* dlg = 
				new (ELeave) CAknTextQueryDialog(query, CAknQueryDialog::ENoTone);

			dlg->SetPredictiveTextInputPermitted(ETrue);
			if (! dlg->ExecuteLD(R_SEARCH_QUERY)) 
				break;
			
			HBufC8* query8 = HBufC8::NewLC(query.Length());
			TPtr8 query8Ptr(query8->Des());
			query8Ptr.Copy(query);
			CTR->SearchL(*query8);
			CleanupStack::PopAndDestroy(); // query8
			
			iTabGroup->SetActiveTabByIndex(1);
            ActivateLocalViewL(TUid::Uid(iTabGroup->TabIdFromIndex(1)));

			LOG->WriteL(_L("Searching for: "));
			LOG->WriteLineL(query);
		}
		break;

		case ESymellaCmdSettings:
		{
			ActivateLocalViewL(KSettingsViewId);
		}
		break;

        default:
            break;      
    }
}
Example #21
0
void CStarDictAppUi::SetActiveMeaningView()
{
	ActivateLocalViewL(iViewId2);
}
Example #22
0
void CStarDictAppUi::SetActiveMainView()
{
	ActivateLocalViewL(iViewId1);
}
Example #23
0
 void COokjorAppUi::HandleCommandL(TInt aCommand)
    {

	 switch(aCommand)
	 {
	 case EAknSoftkeyExit:
	 //flow through to next case
	 case EEikCmdExit:
	 {

			Exit();
		    return;
	 }
	 default:
	 break;
	 }

    if(CAknViewAppUi::iView == iAppView)
    {
	    switch(aCommand)
	        {


	        case EOokjorSettingsCommand:
	        	{
	    ActivateLocalViewL(TUid::Uid(ENavigationPaneSettingsViewId));
	        	};
	        	break;

	        	case EAknSoftkeyDone:
		        {

				 _LIT(msg,"Switching to Background");
	        	CAknInformationNote* informationNote = new (ELeave) CAknInformationNote(ETrue);
	        	informationNote->SetTimeout(CAknNoteDialog::EShortTimeout);
	        	informationNote->ExecuteLD(msg);

				 TApaTask task(iEikonEnv->WsSession( ));
				 task.SetWgId(CEikonEnv::Static()->RootWin().Identifier());
				 task.SendToBackground();

				 if(iAppView)
					 ((COokjorAppView*)iAppView)->CleanupCamera(); //stream mobile screen instead of camera

		        }
	        break;


	        case EOokjorHelpCommand:
	        	{
				ActivateLocalViewL(TUid::Uid(ENavigationPaneHelpViewId));
	        	};
	        	break;
	        case EOokjorAboutCommand:
	        	{
				ActivateLocalViewL(TUid::Uid(ENavigationPaneAboutViewId));
	        	};
	        	break;

	        default:
	            break;
	        }
    	}
    	else
    	if( CAknViewAppUi::iView == iAboutAppView)
    	{
			ActivateLocalViewL(TUid::Uid(ENavigationPaneStatusViewId));
    	}

    }
Example #24
0
// Activate profile list view
void CPuttyAppUi::ActivateProfileListViewL() {
    ActivateLocalViewL(TUid::Uid(KUidPuttyProfileListViewDefine));    
}
Example #25
0
// Activate profile edit view
void CPuttyAppUi::ActivateProfileEditViewL(CPuttyEngine &aPutty,
                                           TDes &aProfileName) {
    iProfileEditPutty = &aPutty;
    iProfileEditName = &aProfileName;
    ActivateLocalViewL(TUid::Uid(KUidPuttyProfileEditViewDefine));    
}
Example #26
0
// Activate terminal view
void CPuttyAppUi::ActivateTerminalViewL(TDesC &aProfileFile) {
    iTerminalProfileFile = aProfileFile;
    ActivateLocalViewL(TUid::Uid(KUidPuttyTerminalViewDefine));
}
Example #27
0
void CIncallertAppUi::HandleCommandL(TInt aCommand)
{

    switch(aCommand)
    {
    case EAknSoftkeyExit:
    //flow through to next case
    case EEikCmdExit:
    {
        if(!iAutoStarted)
            Exit();
        else
        {
            TTime now;
            now.HomeTime();
            TTimeIntervalMicroSeconds diff = now.MicroSecondsFrom(iStartTime);

            if(diff<=TTimeIntervalMicroSeconds(5))
            {

                //auto started apps must not exit sooner than 5 secs or phone might say our app has corrupted
                iEikonEnv->RootWin().SetOrdinalPosition(-1,ECoeWinPriorityNeverAtFront);
                if(!iExitTimer)//if not already started exit timer
                {
                    iExitTimer = CPeriodic::NewL(0);
                    iExitTimer->Start( 5000000, 5000000, TCallBack(ExitTimerCallBack,this));
                }

            }
            else
                Exit(); //app was already started long enough
        }

        return;
    }
    default:
        break;
    }

    if(CAknViewAppUi::iView == iAppView)
    {
        switch(aCommand)
        {


        case EIncallertSettingsCommand:
        {
            this->iLineStatusHandler->PlaySoundTest();
            iTabGroup->SetActiveTabById(ENavigationPaneSettingsViewId);
            ActivateLocalViewL(TUid::Uid(iTabGroup->ActiveTabId()));

        };
        break;

        case EAknSoftkeyDone:
        {

            _LIT(msg,"Switching to Background");
            CAknInformationNote* informationNote = new (ELeave) CAknInformationNote(ETrue);
            informationNote->SetTimeout(CAknNoteDialog::EShortTimeout);
            informationNote->ExecuteLD(msg);

            TApaTask task(iEikonEnv->WsSession( ));
            task.SetWgId(CEikonEnv::Static()->RootWin().Identifier());
            task.SendToBackground();
        }
        break;


        case EIncallertHelpCommand:
        {

            iTabGroup->SetActiveTabById(ENavigationPaneHelpViewId);
            ActivateLocalViewL(TUid::Uid(iTabGroup->ActiveTabId()));


        };
        break;
        case EIncallertAboutCommand:
        {

            iTabGroup->SetActiveTabById(ENavigationPaneAboutViewId);
            ActivateLocalViewL(TUid::Uid(iTabGroup->ActiveTabId()));

        };
        break;

        default:
            break;
        }
    }
    else if(CAknViewAppUi::iView == iHelpAppView || CAknViewAppUi::iView == iAboutAppView)
    {
        iTabGroup->SetActiveTabById(ENavigationPaneStatusViewId);
        ActivateLocalViewL(TUid::Uid(iTabGroup->ActiveTabId()));
    }

}
Example #28
0
// ----------------------------------------------------
// 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;      
        }
    }
void CContextLocaAppUi::HandleCommandL(TInt aCommand)
{
	CALLSTACKITEM_N(_CL("CContextLocaAppUi"), _CL("HandleCommandL"));

	SetInHandlableEvent(ETrue);
#ifdef __WINS__
	TInt err;
	TBreakItem b(GetContext(), err);
#endif
	if (BaseHandleCommandL(aCommand)) return;

	switch ( aCommand )
	{
	case Econtext_logCmdAppPauseLog:
		Settings().WriteSettingL(SETTING_LOGGING_ENABLE, EFalse);
		break;
	case Econtext_logCmdAppUnPauseLog:
		Settings().WriteSettingL(SETTING_LOGGING_ENABLE, ETrue);
		break;
	case Econtext_logCmdCancelSend:
		// do nothing
		break;
	case Econtext_logCmdAppSettings:
		ActivateLocalViewL(KSettingsViewId);
		break;
	case Econtext_logCmdDumpCommDb:
		{
		CCommDbDump* dump=CCommDbDump::NewL();
		dump->DumpDBtoFileL(_L("c:\\commdb.txt"));
		delete dump;
		}
		break;
	case Econtext_logCmdCreateAp:
		{
		CreateAPL(_L("cingular"),
			_L("WAP.CINGULAR"),
			_L("*****@*****.**"),
			_L("CINGULAR1"));
		}
		break;
	case Econtext_logCmdStartSensors:
		{
			if  (!iSensorRunner)
				iSensorRunner=CSensorRunner::NewL(
					AppContext(), smsh, EFalse, *this);
		}
		break;

	case Econtext_logCmdAppTest:
		{
		//loc->test();
		//recorder->test();
		DialogTest();
		}
		break;
	case Econtext_logCmdAppImsi:
		{
			/*if (loc) status_change(loc->GetImsi());
			else */{
#ifndef __WINS__
				TBuf<20> machineId;
				GetImeiL(machineId);
				status_change(machineId);
#else
				// Return a fake IMEI when working on emulator
				_LIT(KEmulatorImsi, "244050000000000");
				status_change(KEmulatorImsi);
#endif
			}
		}
			
		break;
	default:
		if (aCommand>Econtext_logCmdSendAppUi || aCommand==Econtext_logCmdSendFtp) {
			
			if (aCommand==Econtext_logCmdSendFtp) {
				//iPeriodicTransfer->Transfer(false);
				//iPeriodicTransfer->Transfer(true);
			} else {
				status_change(_L("trying transfer"));

				/*
				cellid_name_file.Close();
				*/
				
				TFileName transfer_cellid_filen, cellid_filen;
				transfer_cellid_filen.Format(_L("%S%S"), &AppDir(), &transfer_cellid_file);
				cellid_filen.Format(_L("%S%S"), &DataDir(), &cellid_file);

				TInt ferr=BaflUtils::CopyFile(Fs(), cellid_filen, transfer_cellid_filen);
				if (ferr!=KErrNone) {
					TBuf<30> errmsg;
					errmsg.Format(_L("copy: %d"), ferr);
					error(errmsg);
					return;
				}
				/*
				ferr=cellid_name_file.Open(Fs(), cellid_filen, 
					EFileShareAny | EFileStreamText | EFileRead | EFileWrite);
				if (ferr!=KErrNone) {
					TBuf<30> errmsg;
					errmsg.Format(_L("reopen: %d, RESTART NOW"), ferr);
					error(errmsg);
					return;
				}
				*/
				iLog->switch_file();

				transferer->transfer_files(aCommand);
			}
			
		}
		break;
	}
}