brctlsampleappsoftkeysobserver.cpp

来自「基于SYMBIAN手机智能操作系统,通过插件」· C++ 代码 · 共 77 行

CPP
77
字号
/*
* ============================================================================
*  Name        : BrCtlSampleAppSoftkeysObserver.cpp
*  基于SYMBIAN,通过插件方式,实现浏览器
* ============================================================================
*/

// 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 + -
显示快捷键?