chxavselectsettingsview.cpp
上传用户:dangjiwu
上传日期:2013-07-19
资源大小:42019k
文件大小:3k
源码类别:

Symbian

开发平台:

Visual C++

  1. /****************************************************************************
  2.  * chxavselectsettingsview.cpp
  3.  * ---------------------------
  4.  *
  5.  * Synopsis:
  6.  *
  7.  * Target:
  8.  * Symbian OS
  9.  *
  10.  *
  11.  * (c) 1995-2003 RealNetworks, Inc. Patents pending. All rights reserved.
  12.  *
  13.  *****************************************************************************/
  14. // Includes from this project...
  15. #include "chxavmisc.h"
  16. #include "chxavplayerui.h"
  17. #include "chxavsettingsview.h"
  18. #include "chxavselectsettingsview.h"
  19. #include "chxavselectsettingsviewwindow.h"
  20. #include "hxapihelp.h"
  21. #include "realplayer.hrh"
  22. #include "realplayer.mbg"
  23. #include "hxsym_debug.h"
  24. #include "chxavcleanupstack.h"
  25. ///////////////////////////////////
  26. //
  27. CHXAvSelectSettingsView::CHXAvSelectSettingsView(TInt idxView, CHXAvPlayerUI* playerUI)
  28. : CHXAvViewBase(idxView, playerUI)
  29. , m_idxCurrent(0)
  30. }
  31. CHXAvSelectSettingsView::~CHXAvSelectSettingsView()
  32. {
  33. }
  34. ////////////////////////////////////////////////////////////
  35. //
  36. void CHXAvSelectSettingsView::ConstructL()
  37. {
  38.     BaseConstructL(R_AVP_SELECT_SETTINGS_VIEW_INFO); 
  39. }
  40. ///////////////////////////////////
  41. //
  42. void CHXAvSelectSettingsView::UpdateViewStateL()
  43. {
  44.     m_spWindow->UpdateTopAndBottomL();
  45. }
  46. ///////////////////////////////////
  47. //
  48. CCoeControl* CHXAvSelectSettingsView::CreateViewWindowForActivatingViewL()
  49. {
  50.     DPRINTF(SYMP_INFO, ("CHXAvSelectSettingsView::CreateViewWindowForActivatingViewL()n"));
  51.    
  52.     if( !m_spWindow )
  53.     {
  54.         m_spWindow = new (ELeave) CHXAvSelectSettingsViewWindow(this);
  55.         m_spWindow->ConstructL(ClientRect(), m_idxCurrent);
  56.     }
  57.     return m_spWindow.raw_ptr();
  58. }
  59. ///////////////////////////////////
  60. //
  61. void CHXAvSelectSettingsView::FinishViewDeactivateL()
  62. {
  63.     DPRINTF(SYMP_INFO, ("CHXAvSelectSettingsView::FinishViewDeactivateL()n"));
  64.     m_spWindow = 0;
  65. }
  66. ////////////////////////////////////////////////////////////////
  67. //
  68. void CHXAvSelectSettingsView::LaunchSettingsViewL()
  69. {
  70.     HX_ASSERT(m_spWindow);
  71.     // prepare the settings view with the page to initially show
  72.     CAknView* pView = m_playerUI->View(TUid::Uid(CHXAvPlayerUI::VID_SettingsView));
  73.     HX_ASSERT(pView);
  74.     CHXAvSettingsView* pSettingsView = static_cast<CHXAvSettingsView*>(pView);
  75.     m_idxCurrent = m_spWindow->GetCurrentSelectionIndex();
  76.     pSettingsView->SetActivePageIndexL(m_idxCurrent);
  77.     // activate settings view
  78.     m_playerUI->ActivateLocalViewL(TUid::Uid(CHXAvPlayerUI::VID_SettingsView));
  79. }
  80. ////////////////////////////////////////////////////////////////
  81. //
  82. void CHXAvSelectSettingsView::ResetCurrentIndex(TInt idx)
  83. {
  84.     m_idxCurrent = idx;
  85. }
  86. ///////////////////////////////////
  87. //
  88. void
  89. CHXAvSelectSettingsView::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane)
  90. {
  91.     if(R_AVP_SELECT_SETTINGS_MENU_PANE == aResourceId)
  92.     {
  93.         CHXAvMisc::InitHelpMenuItem(aMenuPane);
  94.     }
  95. }
  96. ////////////////////////////////////////////////////////////////
  97. //
  98. // this view gets first crack at command; unknowns forwarded to appui
  99. //
  100. void CHXAvSelectSettingsView::HandleCommandL(TInt command)
  101. {
  102.     DPRINTF(SYMP_INFO, ("CHXAvSelectSettingsView::SaveChangesL(): HandleCommandL(%d)n", command));
  103.     switch(command)
  104.     {
  105.     case EOpenSettings:
  106.     case EAknSoftkeyOk:
  107.         LaunchSettingsViewL();
  108. break;
  109.     default:
  110. AppUi()->HandleCommandL(command);
  111. break;
  112.     }
  113. }