bluetoothengine/bthid/common/inc/layoututils.h
changeset 0 f63038272f30
equal deleted inserted replaced
-1:000000000000 0:f63038272f30
       
     1 /*
       
     2 * Copyright (c) 2008 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  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __LAYOUTUTILS_H__
       
    20 #define __LAYOUTUTILS_H__
       
    21 
       
    22 #include <e32base.h>
       
    23 #include "hidlayoutids.h"
       
    24 
       
    25 /*!
       
    26  Utility class providing static function for keyboard layout 
       
    27  code manipulation.
       
    28  */
       
    29 class CLayoutUtils : public CBase
       
    30     {
       
    31 public:
       
    32     /*!
       
    33      Return a position in the list of standard layout codes for a given
       
    34      layout.
       
    35      @param aLayoutId A Standard layout code.
       
    36      @result The index of the layout.
       
    37      */
       
    38     static TInt IndexFromStandardLayout(THidKeyboardLayoutId aLayoutId);
       
    39 
       
    40     /*!
       
    41      Return a position in the list of nokia layout codes for a given
       
    42      layout.
       
    43      @param aLayoutId A Nokia layout code.
       
    44      @result The index of the layout.
       
    45      */
       
    46     static TInt IndexFromNokiaLayout(THidKeyboardLayoutId aLayoutId);
       
    47 
       
    48     /*!
       
    49      Return a layout code for a given index in the list of standard layout
       
    50      codes.
       
    51      @param aIndex The index of the layout. 
       
    52      @result A Standard layout code.
       
    53      */
       
    54     static THidKeyboardLayoutId StandardLayoutFromIndex(TInt aIndex);
       
    55 
       
    56     /*!
       
    57      Return a layout code for a given index in the list of nokia layout
       
    58      codes.
       
    59      @param aIndex The index of the layout. 
       
    60      @result A Standard layout code.
       
    61      */
       
    62     static THidKeyboardLayoutId NokiaLayoutFromIndex(TInt aIndex);
       
    63 
       
    64     /*!
       
    65      Ensures a given layout is a valid standard layout. If it is not
       
    66      then a default standard value is given.
       
    67      @param aLayoutId A Standard layout code.
       
    68      */
       
    69     static void ValidateStandardLayout(THidKeyboardLayoutId& aLayoutId);
       
    70 
       
    71     /*!
       
    72      Ensures a given layout is a valid Nokia Su8 layout. If it is not
       
    73      then a default Nokia Su8 value is given.
       
    74      @param aLayoutId A Nokia Su8 layout code.
       
    75      */
       
    76     static void ValidateNokiaSU8Layout(THidKeyboardLayoutId& aLayoutId);
       
    77 
       
    78     /*!
       
    79      Identify the layout selected resource string for the given layout.
       
    80      @param aLayoutCode The layout code of the string to return.
       
    81      */
       
    82     static TInt LayoutConfirmationStringL(THidKeyboardLayoutId aLayoutCode);
       
    83 
       
    84     /*!
       
    85      Identify the initialed layout ID belongs to same group than the layout ID in CenRep
       
    86      @param aInitialLayoutCode the initialed layout ID.
       
    87      @param aLayoutCode the layout ID in CenRep.
       
    88      @return ETrue when IDs are in the same group ETrue, otherwise EFalse
       
    89      */
       
    90     static TBool SameCategory(THidKeyboardLayoutId aInitialLayoutCode,
       
    91             THidKeyboardLayoutId aLayoutCode);
       
    92     };
       
    93 
       
    94 #endif // __LAYOUTUTILS_H__