webengine/wmlengine/src/lmgr/src/Epoc32AccessKey.c
changeset 74 91031d3aab7d
parent 68 92a765b5b3e7
child 85 e358f2276d3f
equal deleted inserted replaced
68:92a765b5b3e7 74:91031d3aab7d
     1 /*
       
     2 * Copyright (c) 2000 - 2001 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 the License "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 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "nw_lmgr_epoc32accesskeyi.h"
       
    20 
       
    21 /* ------------------------------------------------------------------------- *
       
    22    class definition
       
    23  * ------------------------------------------------------------------------- */
       
    24 
       
    25 /* ------------------------------------------------------------------------- */
       
    26 const
       
    27 NW_LMgr_Epoc32AccessKey_Class_t NW_LMgr_Epoc32AccessKey_Class = {
       
    28   { /* NW_Object_Core          */
       
    29     /* super                   */ &NW_LMgr_AccessKey_Class,
       
    30     /* queryInterface          */ _NW_Object_Base_QueryInterface
       
    31   },
       
    32   { /* NW_Object_Base          */
       
    33     /* interfaceList           */ NULL
       
    34   },
       
    35   { /* NW_Object_Dynamic       */
       
    36     /* instanceSize            */ sizeof (NW_LMgr_Epoc32AccessKey_t),
       
    37     /* construct               */ _NW_LMgr_AccessKey_Construct,
       
    38     /* destruct                */ NULL
       
    39   },
       
    40   { /* NW_LMgr_AccessKey       */
       
    41     /* isValidForOptionsList   */ _NW_LMgr_Epoc32AccessKey_IsValidForOptionsList,
       
    42     /* isValidKeyPress         */ _NW_LMgr_Epoc32AccessKey_IsValidKeyPress
       
    43   },
       
    44   { /* NW_LMgr_Epoc32AccessKey  */
       
    45     /* unused                  */ 0
       
    46   }
       
    47 };
       
    48 
       
    49 /* ------------------------------------------------------------------------- */
       
    50 NW_Bool
       
    51 _NW_LMgr_Epoc32AccessKey_IsValidForOptionsList (NW_LMgr_AccessKey_t* accesskey,
       
    52                                      NW_Uint32 val)
       
    53 {
       
    54   /* avoid unreferenced formal parameter warnings */
       
    55   (void) accesskey;
       
    56 
       
    57   return _NW_LMgr_Epoc32AccessKey_IsValidKeyPress(accesskey, val);
       
    58 }
       
    59 
       
    60 /* ------------------------------------------------------------------------- */
       
    61 NW_Bool
       
    62 _NW_LMgr_Epoc32AccessKey_IsValidKeyPress (NW_LMgr_AccessKey_t* accesskey,
       
    63                                         NW_Uint32 val)
       
    64 {
       
    65   (void)val;
       
    66   (void)accesskey;
       
    67 
       
    68   if ((val >= '0') && (val <= '9')) {
       
    69     return NW_TRUE;
       
    70   }
       
    71   return NW_FALSE;
       
    72 }
       
    73 
       
    74 /* ------------------------------------------------------------------------- *
       
    75    convenience functions
       
    76  * ------------------------------------------------------------------------- */
       
    77 NW_LMgr_AccessKey_t*
       
    78 NW_LMgr_AccessKey_New()
       
    79 {
       
    80   return (NW_LMgr_AccessKey_t *)
       
    81     NW_Object_New (&NW_LMgr_Epoc32AccessKey_Class);
       
    82 }
       
    83 
       
    84