confirmationnoteappui.cpp

来自「series60 应用程序开发的源代码 series60 应用程序开发的源代码」· C++ 代码 · 共 84 行

CPP
84
字号
/**
* 
* @brief Definition of CConfirmationNoteAppUi
*
* Copyright (c) EMCC Software Ltd 2003
* @version 1.0
*/

// INCLUDE FILES

// Class include
#include "ConfirmationNoteAppUi.h"

// User includes
#include <aknnotewrappers.h> // CAknConfirmationNote
#include <ConfirmationNote.rsg> // NOTE_TEXT
#include <stringloader.h> // StringLoader

// User includes
#include "ConfirmationNote.hrh" // commands
#include "ConfirmationNoteContainer.h" // CConfirmationNoteContainer

// ================= 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 CConfirmationNoteAppUi::ConstructL()
{
    BaseConstructL();
    iAppContainer = CConfirmationNoteContainer::NewL(ClientRect());
    iAppContainer->SetMopParent(this);
    AddToStackL(iAppContainer);
}

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

/**
* From CEikAppUi, takes care of command handling.
*
* @param aCommand command to be handled
*/
void CConfirmationNoteAppUi::HandleCommandL(TInt aCommand)
{
    switch (aCommand)
    {
        case EConfirmationNoteCmdSaveGame:
        {
            if (iAppContainer->SaveGameL())
            {
                HBufC* noteText;
                noteText = StringLoader::LoadLC(R_SAVED_GAME_NOTE_TEXT);
                CAknConfirmationNote* note = new(ELeave)CAknConfirmationNote();
                note->ExecuteLD(*noteText);
                CleanupStack::PopAndDestroy(noteText);
            }
        }
            break;
        case EAknSoftkeyBack:
        case EEikCmdExit:
        {
            Exit();
            break;
        }
        default:
            break;        
    }
}

// End of File    

⌨️ 快捷键说明

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