brctlsampleappsoftkeysobserver.cpp

来自「S60上实现嵌入式浏览器,可以在应用程序中嵌入浏览器,实现IE功能」· C++ 代码 · 共 85 行

CPP
85
字号
/*
* ============================================================================
*  Name        : BrCtlSampleAppSoftkeysObserver.cpp
*  Part of     : Browser Engine
*  Interface   : Browser Control API
*  Description : Handle soft key events
*  Version     : 
*
*  Copyright (c) 2005-2006 Nokia Corporation.
*  This material, including documentation and any related 
*  computer programs, is protected by copyright controlled by 
*  Nokia Corporation.
* ============================================================================
*/

// INCLUDE FILES
#include <eikbtgpc.h>
#include <BrCtlSampleApp.rsg>
#include "BrCtlSampleAppContainer.h"
#include "BrCtlSampleAppSoftkeysObserver.h"

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

// ---------------------------------------------------------
// CBrCtlSampleAppSoftkeysObserver::UpdateSoftkeyL
// ---------------------------------------------------------
//
void 
CBrCtlSampleAppSoftkeysObserver::UpdateSoftkeyL(TBrCtlKeySoftkey /*aKeySoftkey*/,
                                                const TDesC& /*aLabel*/,
                                                TUint32 /*aCommandId*/,
                                                TBrCtlSoftkeyChangeReason /*aBrCtlSoftkeyChangeReason*/) 
    {
    CBrCtlInterface* brCtl = iContainer->BrCtlInterface();

    TBrCtlDefs::TBrCtlElementType type = brCtl->FocusedElementType();

    CEikButtonGroupContainer* current = CEikButtonGroupContainer::Current();
    switch (type)
        {
        case TBrCtlDefs::EElementActivatedInputBox:
            current->SetCommandSetL( R_INPUT_ELEMENT_BUTTONS );
            break;
        
        default:
            current->SetCommandSetL( R_BROWSER_DEFAULT_BUTTONS );
            break;
        }
    current->DrawNow();
    }

// ---------------------------------------------------------
// CBrCtlSampleAppSoftkeysObserver::ConstructL
// ---------------------------------------------------------
//
void 
CBrCtlSampleAppSoftkeysObserver::ConstructL(CBrCtlSampleAppContainer* aContainer)
    {
    iContainer = aContainer;
    }

// ---------------------------------------------------------
// CBrCtlSampleAppSoftkeysObserver::~CBrCtlSampleAppSoftkeysObserver
// ---------------------------------------------------------
//
CBrCtlSampleAppSoftkeysObserver::~CBrCtlSampleAppSoftkeysObserver()
    {
    }

// ---------------------------------------------------------
// CBrCtlSampleAppSoftkeysObserver::NewL
// ---------------------------------------------------------
//
CBrCtlSampleAppSoftkeysObserver* CBrCtlSampleAppSoftkeysObserver::NewL(CBrCtlSampleAppContainer* aContainer)
    {
    CBrCtlSampleAppSoftkeysObserver* self = new(ELeave)CBrCtlSampleAppSoftkeysObserver;
    CleanupStack::PushL(self);
    self->ConstructL(aContainer);
    CleanupStack::Pop();
    return self;
    }

// End of File  

⌨️ 快捷键说明

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