chxavselectsettingsview.cpp
上传用户:zhongxx05
上传日期:2007-06-06
资源大小:33641k
文件大小:3k
源码类别:
Symbian
开发平台:
C/C++
- /****************************************************************************
- * chxavselectsettingsview.cpp
- * ---------------------------
- *
- * Synopsis:
- *
- * Target:
- * Symbian OS
- *
- *
- * (c) 1995-2003 RealNetworks, Inc. Patents pending. All rights reserved.
- *
- *****************************************************************************/
- // Includes from this project...
- #include "chxavmisc.h"
- #include "chxavplayerui.h"
- #include "chxavsettingsview.h"
- #include "chxavselectsettingsview.h"
- #include "chxavselectsettingsviewwindow.h"
- #include "hxapihelp.h"
- #include "realplayer.hrh"
- #include "realplayer.mbg"
- #include "hxsym_debug.h"
- #include "chxavcleanupstack.h"
- ///////////////////////////////////
- //
- CHXAvSelectSettingsView::CHXAvSelectSettingsView(TInt idxView, CHXAvPlayerUI* playerUI)
- : CHXAvViewBase(idxView, playerUI)
- , m_idxCurrent(0)
- {
- }
- CHXAvSelectSettingsView::~CHXAvSelectSettingsView()
- {
- }
- ////////////////////////////////////////////////////////////
- //
- void CHXAvSelectSettingsView::ConstructL()
- {
- BaseConstructL(R_AVP_SELECT_SETTINGS_VIEW_INFO);
- }
- ///////////////////////////////////
- //
- void CHXAvSelectSettingsView::UpdateViewStateL()
- {
- m_spWindow->UpdateTopAndBottomL();
- }
- ///////////////////////////////////
- //
- CCoeControl* CHXAvSelectSettingsView::CreateViewWindowForActivatingViewL()
- {
- DPRINTF(SYMP_INFO, ("CHXAvSelectSettingsView::CreateViewWindowForActivatingViewL()n"));
- if( !m_spWindow )
- {
- m_spWindow = new (ELeave) CHXAvSelectSettingsViewWindow(this);
- m_spWindow->ConstructL(ClientRect(), m_idxCurrent);
- }
- return m_spWindow.raw_ptr();
- }
- ///////////////////////////////////
- //
- void CHXAvSelectSettingsView::FinishViewDeactivateL()
- {
- DPRINTF(SYMP_INFO, ("CHXAvSelectSettingsView::FinishViewDeactivateL()n"));
- m_spWindow = 0;
- }
- ////////////////////////////////////////////////////////////////
- //
- void CHXAvSelectSettingsView::LaunchSettingsViewL()
- {
- HX_ASSERT(m_spWindow);
- // prepare the settings view with the page to initially show
- CAknView* pView = m_playerUI->View(TUid::Uid(CHXAvPlayerUI::VID_SettingsView));
- HX_ASSERT(pView);
- CHXAvSettingsView* pSettingsView = static_cast<CHXAvSettingsView*>(pView);
- m_idxCurrent = m_spWindow->GetCurrentSelectionIndex();
- pSettingsView->SetActivePageIndexL(m_idxCurrent);
- // activate settings view
- m_playerUI->ActivateLocalViewL(TUid::Uid(CHXAvPlayerUI::VID_SettingsView));
- }
- ////////////////////////////////////////////////////////////////
- //
- void CHXAvSelectSettingsView::ResetCurrentIndex(TInt idx)
- {
- m_idxCurrent = idx;
- }
- ///////////////////////////////////
- //
- void
- CHXAvSelectSettingsView::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane)
- {
- if(R_AVP_SELECT_SETTINGS_MENU_PANE == aResourceId)
- {
- CHXAvMisc::InitHelpMenuItem(aMenuPane);
- }
- }
- ////////////////////////////////////////////////////////////////
- //
- // this view gets first crack at command; unknowns forwarded to appui
- //
- void CHXAvSelectSettingsView::HandleCommandL(TInt command)
- {
- DPRINTF(SYMP_INFO, ("CHXAvSelectSettingsView::SaveChangesL(): HandleCommandL(%d)n", command));
- switch(command)
- {
- case EOpenSettings:
- case EAknSoftkeyOk:
- LaunchSettingsViewL();
- break;
- default:
- AppUi()->HandleCommandL(command);
- break;
- }
- }