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

📄 tcpipmultihomingexappui.cpp

📁 symbian 第二版
💻 CPP
字号:
/**
*
* @brief Definition of CTcpipMultiHomingExAppUi
*
* Copyright (c) EMCC Software Ltd 2003
* @version 1.0
*/

// INCLUDE FILES

// Class include
#include "TcpipMultiHomingExAppUi.h"

#include <aknglobalnote.h>

// User includes
#include "TcpipMultiHomingExContainer.h"     // CTcpipMultiHomingExContainer
#include "TcpipMultiHomingExEngine.h"         // CTcpipMultiHomingExEngine
#include "TcpipMultiHomingEx.hrh"
#include "TcpipMultiHomingEx.pan"

// CONSTANTS

_LIT(KNewLine, "\n");
const TInt KMaxErrCodeLength = 10;

// ================= 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 CTcpipMultiHomingExAppUi::ConstructL()
{
    BaseConstructL();
    iAppContainer = CTcpipMultiHomingExContainer::NewL(ClientRect());
    iAppContainer->SetMopParent(this);
    AddToStackL(iAppContainer);
    iEngine = CTcpipMultiHomingExEngine::NewL(*this);
}

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

/**
* From CEikAppUi, takes care of command handling.
*
* @param aCommand command to be handled
*/
void CTcpipMultiHomingExAppUi::HandleCommandL(TInt aCommand)
{
    switch (aCommand)
    {
        case ETcpipMultiHomingExampleCmdReadTime:
        {
            iEngine->ConnectL();
            break;
        }
        case EAknSoftkeyExit:
        case EAknSoftkeyBack:
        case EEikCmdExit:
        {
            Exit();
            break;
        }
        default:
            break;
    }
}

void CTcpipMultiHomingExAppUi::ErrorL(const TDesC& aErrMessage, TInt aErrCode)
{

    HBufC* errorTitleCode = HBufC::NewLC(aErrMessage.Length() + KNewLine().Length() + KMaxErrCodeLength);
    TPtr ptr = errorTitleCode->Des();
    ptr.Append(aErrMessage);
    ptr.Append(KNewLine);
    ptr.AppendNum(aErrCode);

    CAknGlobalNote* globalNote = CAknGlobalNote::NewLC();
    globalNote->ShowNoteL(EAknGlobalErrorNote, *errorTitleCode);
    CleanupStack::PopAndDestroy(globalNote);
    CleanupStack::PopAndDestroy(errorTitleCode);
}

void CTcpipMultiHomingExAppUi::ResponseReceivedL(const TDesC& aMessage)
{
    CAknGlobalNote* globalNote = CAknGlobalNote::NewLC();
    globalNote->ShowNoteL(EAknGlobalInformationNote, aMessage);
    CleanupStack::PopAndDestroy(globalNote);
}

void CTcpipMultiHomingExAppUi::SetStatus(const TDesC& aStatus)
{
    // Update contents of status window
    TRAPD(err, iAppContainer->UpdateLabelL(aStatus));
    // Ignore error
}

// End of File

⌨️ 快捷键说明

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