phoneapp/phoneuiutils/inc/cphonekeys.h
changeset 37 ba76fc04e6c2
child 51 f39ed5e045e0
equal deleted inserted replaced
36:2eacb6118286 37:ba76fc04e6c2
       
     1 /*
       
     2 * Copyright (c) 2005 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: 
       
    15 *     It defines class that contains static helper functions.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef CPHONEKEYS_H
       
    21 #define CPHONEKEYS_H
       
    22 
       
    23 // INCLUDES
       
    24 #include    <w32std.h>
       
    25 #include    "phoneconstants.h"
       
    26 
       
    27 // CONSTANTS
       
    28 
       
    29 // CLASS DECLARATION
       
    30 
       
    31 /**
       
    32 * It defines some helper functions.
       
    33 */
       
    34 class CPhoneKeys: public CBase
       
    35     {
       
    36     public: // New functions
       
    37 
       
    38         /**
       
    39         * Checks if the key is a number key.
       
    40         */
       
    41         IMPORT_C static TBool IsNumberKey(
       
    42             const TKeyEvent& aKeyEvent,
       
    43             TEventCode aType );
       
    44         
       
    45         /**
       
    46         * Checks if the key is a numeric key.
       
    47         */
       
    48         IMPORT_C static TBool IsNumericKey( 
       
    49             const TKeyEvent& aKeyEvent,
       
    50             TEventCode aType );
       
    51 
       
    52         /**
       
    53         * Checks if keyevent is escape.
       
    54         */
       
    55         IMPORT_C static TBool IsEscapeKey(
       
    56             const TKeyEvent& aKeyEvent,
       
    57             TEventCode aType );
       
    58 
       
    59         /**
       
    60         * Checks if keyevent is DTMF tone.
       
    61         */
       
    62         IMPORT_C static TBool IsDtmfTone(
       
    63             const TKeyEvent& aKeyEvent,
       
    64             TEventCode aType );
       
    65 
       
    66         /**
       
    67         * Checks if keyevent is Second "#" key, i.e, "##".
       
    68         */
       
    69         IMPORT_C static TBool IsSecondHashKey(
       
    70             const TDes& aText );
       
    71         
       
    72         /**
       
    73         * Checks if keyevent is "*" key or following via taps of
       
    74         */    
       
    75         IMPORT_C static TBool IsExtraChar(
       
    76             TInt aChar ); 
       
    77         
       
    78         /**
       
    79         * Validates number entry string.
       
    80         *
       
    81         * String is ok if it contains only characters from 
       
    82         * set { 0, .., 9, *, #, +, p, w, P, W }.
       
    83         *
       
    84         * @param aString string to be validated.
       
    85         * @return ETrue iff string is ok.
       
    86         */
       
    87         IMPORT_C static TBool Validate( const TDesC& aString );           
       
    88     };
       
    89 
       
    90 #endif      // CPHONEKEYS_H
       
    91             
       
    92 // End of File