S60 3rd Edition SDK for Symbian OS
Example Applications Guide

BrCtlSampleAppQueryDialog.cpp

00001 /*
00002 * ============================================================================
00003 *  Name        : BrCtlSampleAppQueryDialog.cpp
00004 *  Part of     : BrCtlSampleApp
00005 *  Interface   : Browser Control API
00006 *  Description : Display a Query Dialog
00007 *  Version     : 
00008 *
00009 *  Copyright (c) 2005-2006 Nokia Corporation.
00010 *  This material, including documentation and any related 
00011 *  computer programs, is protected by copyright controlled by 
00012 *  Nokia Corporation.
00013 * ============================================================================
00014 */
00015 
00016 // INCLUDE FILES
00017 
00018 #include <avkon.hrh>
00019 
00020 #include "BrCtlSampleAppQueryDialog.h"
00021 
00022 // ================= MEMBER FUNCTIONS =======================
00023 
00024 // C++ default constructor can NOT contain any code, that
00025 // might leave.
00026 //
00027 CBrCtlSampleAppQueryDialog::CBrCtlSampleAppQueryDialog( TDes& aDefInput, HBufC*& aRetBuf )
00028     : CAknTextQueryDialog( aDefInput )
00029     , iRetBuf( aRetBuf )
00030         {
00031         }
00032 
00033 // ---------------------------------------------------------
00034 // CBrCtlSampleAppQueryDialog::PreLayoutDynInitL
00035 // ---------------------------------------------------------
00036 //
00037 void  CBrCtlSampleAppQueryDialog::PreLayoutDynInitL()
00038         {
00039     CAknTextQueryDialog::PreLayoutDynInitL();
00040 
00041     MakeLeftSoftkeyVisible( ETrue );
00042     } 
00043 
00044 // ---------------------------------------------------------
00045 // CBrCtlSampleAppQueryDialog::OkToExitL
00046 // ---------------------------------------------------------
00047 //
00048 TBool CBrCtlSampleAppQueryDialog::OkToExitL( TInt aKeycode )
00049         {
00050         switch ( aKeycode )
00051                 {
00052                 case EAknSoftkeyOk:
00053                         {
00054             CAknQueryControl* control = QueryControl();
00055 
00056             __ASSERT_DEBUG( control, User::Panic( KNullDesC, KErrGeneral ) );
00057             
00058             iRetBuf = HBufC::NewL( control->GetTextLength() + 1);
00059             TPtr temp( iRetBuf->Des() );
00060                         control->GetText( temp );
00061             temp.ZeroTerminate();
00062                         }
00063                         // no break !!! same return value
00064                 case EAknSoftkeyCancel:
00065                         return ETrue;
00066                 default:
00067                         return EFalse;
00068                 }
00069     }
00070 
00071 // ---------------------------------------------------------
00072 // CBrCtlSampleAppQueryDialog::HandleQueryEditorStateEventL
00073 //
00074 // This code is base on AknQueryDialog.cpp
00075 // ---------------------------------------------------------
00076 //
00077 TBool CBrCtlSampleAppQueryDialog::HandleQueryEditorStateEventL(CAknQueryControl* /*aQueryControl*/, 
00078         TQueryControlEvent /*aEventType*/, TQueryValidationStatus /*aStatus*/)
00079     {
00080     return EFalse;
00081     }
00082 
00083 //  End of File
00084 

© Nokia 2006

Back to top