www.pudn.com > symbianliulanqi.rar > BrCtlSampleAppSoftkeysObserver.cpp


/* 
* ============================================================================ 
*  Name        : BrCtlSampleAppSoftkeysObserver.cpp 
*  基于SYMBIAN,通过插件方式,实现浏览器 
* ============================================================================ 
*/ 
 
// INCLUDE FILES 
#include  
#include  
#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