S60UIExampleHighScoreView.cpp
上传用户:laixiong
上传日期:2007-03-11
资源大小:2994k
文件大小:4k
源码类别:
Symbian
开发平台:
C/C++
- // Copyright (c) 2006 Nokia Corporation.
- #include "S60UIExampleHighScoreContainer.h"
- #include "S60UIExampleHighScoreView.h"
- #include "S60UIExample.hrh"
- #include <S60UIExample.rsg>
- #include <aknviewappui.h>
- // -----------------------------------------------------------------------------
- // CS60UIExampleHighScoreView::NewL()
- // Two-phased constructor.
- // -----------------------------------------------------------------------------
- //
- CS60UIExampleHighScoreView* CS60UIExampleHighScoreView::NewL(CS60UIExampleModel& aModel)
- {
- CS60UIExampleHighScoreView* self =
- new (ELeave) CS60UIExampleHighScoreView(aModel);
- CleanupStack::PushL (self);
- self->ConstructL();
- CleanupStack::Pop();
- return self;
- }
- // -----------------------------------------------------------------------------
- // CS60UIExampleHighScoreView::ConstructL()
- // Symbian 2nd phase constructor can leave.
- // -----------------------------------------------------------------------------
- //
- void CS60UIExampleHighScoreView::ConstructL()
- {
- BaseConstructL (R_S60UIEXAMPLE_HIGHSCORE_VIEW);
- }
- // -----------------------------------------------------------------------------
- // CS60UIExampleHighScoreView::CS60UIExampleHighScoreView()
- // C++ default constructor can NOT contain any code, that might leave.
- // -----------------------------------------------------------------------------
- //
- CS60UIExampleHighScoreView::CS60UIExampleHighScoreView(
- CS60UIExampleModel& aModel)
- : iModel(aModel)
- {
- }
- // -----------------------------------------------------------------------------
- // CS60UIExampleSettingsView::~CS60UIExampleSettingsView()
- // Destructor.
- // -----------------------------------------------------------------------------
- //
- CS60UIExampleHighScoreView::~CS60UIExampleHighScoreView()
- {
- delete iContainer;
- }
- // -----------------------------------------------------------------------------
- // TUid CS60UIExampleHighScoreView::Id()
- // Returns the View Id.
- // -----------------------------------------------------------------------------
- //
- TUid CS60UIExampleHighScoreView::Id() const
- {
- return TUid::Uid (ES60UIExampleHighScoreViewId);
- }
- // -----------------------------------------------------------------------------
- // CS60UIExampleHighScoreView::HandleCommandL()
- // Handles the commands.
- // -----------------------------------------------------------------------------
- //
- void CS60UIExampleHighScoreView::HandleCommandL (TInt aCommand)
- {
- switch (aCommand)
- {
- case EAknSoftkeyOk:
- {
- AppUi()->ActivateLocalViewL (TUid::Uid (ES60UIExampleInitialViewId));
- break;
- }
- case EAknSoftkeyCancel:
- {
- AppUi()->ActivateLocalViewL (TUid::Uid (ES60UIExampleInitialViewId));
- break;
- }
- default:
- AppUi()->HandleCommandL (aCommand);
- }
- }
- // -----------------------------------------------------------------------------
- // CS60UIExampleHighScoreView::DoActivateL()
- // Creates the Container class object.
- // -----------------------------------------------------------------------------
- //
- void CS60UIExampleHighScoreView::DoActivateL (
- const TVwsViewId& /*aPrevViewId*/,
- TUid /*aCustomMessageId*/,
- const TDesC8& /*aCustomMessage*/)
- {
- if (!iContainer)
- {
- iContainer =
- CS60UIExampleHighScoreContainer::NewL(ClientRect(), iModel);
- iContainer->SetMopParent(this);
- AppUi()->AddToStackL(*this, iContainer);
- }
- }
- // -----------------------------------------------------------------------------
- // CS60UIExampleHighScoreView::DoDeactivate()
- // Deletes the Container class object.
- // -----------------------------------------------------------------------------
- //
- void CS60UIExampleHighScoreView::DoDeactivate()
- {
- if (iContainer)
- {
- // Remove HighScoreView's container from control Stack
- AppUi()->RemoveFromStack(iContainer);
- delete iContainer;
- iContainer = NULL;
- }
- }
- // End of File