⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 skiingappui.cpp

📁 series60 应用程序开发的源代码 series60 应用程序开发的源代码
💻 CPP
字号:
/**
* 
* @brief Definition of CSkiingAppUi
*
* Copyright (c) EMCC Software Ltd 2003
* @version 1.0
*/

// INCLUDE FILES

// Class include
#include "SkiingAppUi.h"

// System include
#include <aknquerydialog.h>
#include <Skiing.rsg>

// User includes
#include "SkiingContainer.h" // CSkiingContainer
#include "Skiing.hrh"

// ================= MEMBER FUNCTIONS =======================

/**
* Symbian OS 2nd phase constructor.  Constructs the application's container, 
* setting itself as the container's MOP parent, and adds it to the control 
* stack.
*/        
void CSkiingAppUi::ConstructL()
{
    BaseConstructL();
    iAppContainer = CSkiingContainer::NewL(ApplicationRect());
    iAppContainer->SetMopParent(this);   
    SetKeyBlockMode(ENoKeyBlock);
    AddToStackL(iAppContainer);
}

/**
* Destructor.
* Removes the application's container from the stack and deletes it.
*/    
CSkiingAppUi::~CSkiingAppUi()
{
    if (iAppContainer)
    {
        RemoveFromStack(iAppContainer);
        delete iAppContainer;
    }
}

/**
* From CEikAppUi, takes care of command handling.
*
* @param aCommand command to be handled
*/
void CSkiingAppUi::HandleCommandL(TInt aCommand)
{
    switch (aCommand)
    {
        case EAknSoftkeyBack:
        case EEikCmdExit:
        case EAknSoftkeyExit :
        {
            Exit();
            break;
        }
        case ESkiingStart:
            iAppContainer->StartDSA();
            break;

        case ESkiingPause:
        {
            iAppContainer->StopDSA();
            iGamePaused = ETrue;
            CAknQueryDialog* dlg = CAknQueryDialog::NewL();
            dlg->ExecuteLD(R_AKNEXQUERY_CONFIRMATION_QUERY);
            iAppContainer->StartDSA();
            iGamePaused = EFalse;
            break;
        }
        default:
            break;        
    }
}

/**
* From CEikAppUi, takes care of loss of focus
*
* @param aForeground ETrue if the app has just gained focus, EFalse otherwise
*/
void CSkiingAppUi::HandleForegroundEventL(TBool aForeground)
// This is necessary so that the application behaves itself just in case there's
// another application about that uses direct screen access
{
    if (aForeground)
    {
        if (!iGamePaused)
        {
            iAppContainer->StartDSA();
        }
        SetKeyBlockMode(ENoKeyBlock);
    }
    else
    {
        iAppContainer->StopDSA();
        SetKeyBlockMode(EDefaultBlockMode);
    }
}

/**
* From CEikAppUi, handles the emphasising or de-emphasising of a menu window
*
* @param aMenuControl The menu control.
* @param ETrue to emphasize the menu, EFalse otherwise.
*/
void CSkiingAppUi::SetEmphasis(CCoeControl* /*aMenuControl*/,TBool aEmphasis)
{
    if (aEmphasis)
    {
        iMenuDisplay = ETrue;
    }
    else
    {
        if (iMenuDisplay)
        {
            iMenuDisplay = EFalse;
            iAppContainer->StartDSA();
        }
    }
}

// End of File    

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -