securitydialogs/SecUi/Src/SecUiCodeQueryControl.cpp
changeset 0 164170e6151a
child 26 aad866c37519
equal deleted inserted replaced
-1:000000000000 0:164170e6151a
       
     1 /*
       
     2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Provides editor clearing method for CodeQueryDialog
       
    15 *               and CodeRequestQueryDialog.
       
    16 *
       
    17 *
       
    18 */
       
    19 
       
    20 #include <aknQueryControl.h>
       
    21 #include <aknsoundsystem.h>
       
    22 #include <aknappui.h>
       
    23 #include <eikenv.h>
       
    24 #include <uikon/eiksrvui.h>
       
    25 #include <AknEcs.h>
       
    26 #include "SecUiCodeQueryControl.h"
       
    27 
       
    28 // ================= MEMBER FUNCTIONS =======================
       
    29 //
       
    30 // ----------------------------------------------------------
       
    31 // CCodeQueryControl::ResetEditor()
       
    32 // Empties editor
       
    33 // ----------------------------------------------------------
       
    34 //
       
    35 void CCodeQueryControl::ResetEditorL()
       
    36 	{
       
    37 	if (iPinEdwin)
       
    38 		{
       
    39 		// reset editor
       
    40 		iPinEdwin->Reset();
       
    41 		// handle event editor empty
       
    42 		HandleControlEventL(iPinEdwin,EEventStateChanged);
       
    43 		}
       
    44 		
       
    45 	if (iEcsDetector)
       
    46         {//Reset ECS buffer
       
    47         iEcsDetector->Reset();
       
    48         }
       
    49 	}
       
    50 //
       
    51 // ----------------------------------------------------------
       
    52 // CCodeQueryControl::PlaySound()
       
    53 // Plays a tone
       
    54 // ----------------------------------------------------------
       
    55 //
       
    56 void CCodeQueryControl::PlaySound(TInt aSid)
       
    57 	{ 
       
    58 	CAknKeySoundSystem* soundSystem;
       
    59 	if (iEikonEnv->AppUi())
       
    60 		{
       
    61 		soundSystem = static_cast<CAknAppUi*>(iEikonEnv->EikAppUi())->KeySounds();
       
    62 		soundSystem->PlaySound(aSid);
       
    63 		}
       
    64 	}
       
    65 //
       
    66 // ----------------------------------------------------------
       
    67 // CCodeQueryControl::IsEmergencyNumber()
       
    68 // Checks if the characters in the input field are emergency numbers.
       
    69 // ----------------------------------------------------------
       
    70 //
       
    71 TBool CCodeQueryControl::IsEmergencyNumber()
       
    72 {
       
    73     TBool returnvalue = EFalse;
       
    74     if (iEcsDetector)
       
    75         {
       
    76             #if defined(_DEBUG)
       
    77             RDebug::Print(_L("(SECUI)CCodeQueryControl::IsEmergencyNumber() ecs OK"));
       
    78             #endif
       
    79         if(iEcsDetector->State()== CAknEcsDetector::ECompleteMatch)
       
    80             {
       
    81             #if defined(_DEBUG)
       
    82             RDebug::Print(_L("(SECUI)CCodeQueryControl::IsEmergencyNumber() Complete match"));
       
    83             #endif
       
    84             returnvalue = ETrue;
       
    85             }
       
    86         }
       
    87     return returnvalue;
       
    88 }
       
    89 //
       
    90 // ----------------------------------------------------------
       
    91 // CCodeQueryControl::IsEmergencyNumber()
       
    92 // Checks if the characters in the input field are emergency numbers.
       
    93 // ----------------------------------------------------------
       
    94 //
       
    95 TBool CCodeQueryControl::IsEmergencyCallSupportOn()
       
    96 {
       
    97 	TBool returnvalue = EFalse;
       
    98     if (iEcsDetector)
       
    99     	{
       
   100     		returnvalue = ETrue;
       
   101     	}
       
   102   return returnvalue;
       
   103 }
       
   104 // End of file
       
   105