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


/* 
* ============================================================================ 
*  Name        : BrCtlSampleAppQueryDialog.cpp 
*  基于SYMBIAN,通过插件方式,实现浏览器 
* ============================================================================ 
*/ 
 
// INCLUDE FILES 
 
#include  
 
#include "BrCtlSampleAppQueryDialog.h" 
 
// ================= MEMBER FUNCTIONS ======================= 
 
// C++ default constructor can NOT contain any code, that 
// might leave. 
// 
CBrCtlSampleAppQueryDialog::CBrCtlSampleAppQueryDialog( TDes& aDefInput, HBufC*& aRetBuf ) 
    : CAknTextQueryDialog( aDefInput ) 
    , iRetBuf( aRetBuf ) 
	{ 
	} 
 
// --------------------------------------------------------- 
// CBrCtlSampleAppQueryDialog::PreLayoutDynInitL 
// --------------------------------------------------------- 
// 
void  CBrCtlSampleAppQueryDialog::PreLayoutDynInitL() 
	{ 
    CAknTextQueryDialog::PreLayoutDynInitL(); 
 
    MakeLeftSoftkeyVisible( ETrue ); 
    }  
 
// --------------------------------------------------------- 
// CBrCtlSampleAppQueryDialog::OkToExitL 
// --------------------------------------------------------- 
// 
TBool CBrCtlSampleAppQueryDialog::OkToExitL( TInt aKeycode ) 
	{ 
	switch ( aKeycode ) 
		{ 
		case EAknSoftkeyOk: 
			{ 
            CAknQueryControl* control = QueryControl(); 
 
            __ASSERT_DEBUG( control, User::Panic( KNullDesC, KErrGeneral ) ); 
             
            iRetBuf = HBufC::NewL( control->GetTextLength() + 1); 
            TPtr temp( iRetBuf->Des() ); 
			control->GetText( temp ); 
            temp.ZeroTerminate(); 
			} 
			// no break !!! same return value 
		case EAknSoftkeyCancel: 
			return ETrue; 
		default: 
			return EFalse; 
		} 
    } 
 
// --------------------------------------------------------- 
// CBrCtlSampleAppQueryDialog::HandleQueryEditorStateEventL 
// 
// This code is base on AknQueryDialog.cpp 
// --------------------------------------------------------- 
// 
TBool CBrCtlSampleAppQueryDialog::HandleQueryEditorStateEventL(CAknQueryControl* /*aQueryControl*/,  
	TQueryControlEvent /*aEventType*/, TQueryValidationStatus /*aStatus*/) 
    { 
    return EFalse; 
    } 
 
//  End of File