bluetoothengine/bthid/manager/inc/hidkeys.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:  Key types.
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __HIDKEYS_H
       
    20 #define __HIDKEYS_H
       
    21 
       
    22 #include <e32std.h>
       
    23 #include <e32svr.h>
       
    24 
       
    25 // CLASS DECLARATIONS
       
    26 
       
    27 /*!
       
    28  TLockKeys is used to represent the current state of the locking
       
    29  modifier keys, i.e. Caps Lock and Num Lock. 
       
    30  */
       
    31 
       
    32 class TLockKeys
       
    33     {
       
    34 public:
       
    35     inline TLockKeys();
       
    36     inline TLockKeys(TBool aCapsLock, TBool aNumLock);
       
    37 
       
    38     TBool iCapsLock; //!< ETrue if Caps Lock is active
       
    39     TBool iNumLock; //!< ETrue if Num Lock is active
       
    40     };
       
    41 
       
    42 /*!
       
    43  TTranslatedKey contains the details of a decoded HID key event.  It
       
    44  is returned (as part of a TDecodedKeyInfo object) from a call to
       
    45  RLayoutManager::KeyEvent().
       
    46  */
       
    47 
       
    48 class TTranslatedKey
       
    49     {
       
    50 public:
       
    51     inline TTranslatedKey();
       
    52     inline TTranslatedKey(TUint16 aUnicode, TInt aScanCode, TInt aHidKey,
       
    53             TInt aUsagePage, TBool aIsRepeatingKey);
       
    54 
       
    55     TUint16 iUnicode; //!< Symbian (Unicode) key code value (cf TKeyCode)
       
    56     TInt iScanCode; //!< Symbian raw scan code value (cf TStdScanCode)
       
    57     TInt iHidKey; //!< HID code for the key that caused this event
       
    58     TInt iUsagePage; //!< Usage page for the key that caused this event
       
    59     TBool iIsRepeatingKey; //!< ETrue if the key can repeat
       
    60     };
       
    61 
       
    62 /*!
       
    63  TDecodedKeyInfo contains the results of decoding a HID key event.  It is
       
    64  the output of a call to RLayoutManager::KeyEvent().  
       
    65  
       
    66  Note that the iScanCode member corresponds to the current key event
       
    67  as given in the arguments to RLayoutManager::KeyEvent(), whereas the
       
    68  iScanCode values in #iEvent correspond to the key event that caused
       
    69  the translated key press; this could be the previous event in the
       
    70  case of a dead key.
       
    71  */
       
    72 
       
    73 class TDecodedKeyInfo
       
    74     {
       
    75 public:
       
    76     inline TDecodedKeyInfo();
       
    77 
       
    78     TInt iCount; //!< Number of key press events (0, 1 or 2)
       
    79     TInt iScanCode; //!< Symbian raw scan code value
       
    80     TTranslatedKey iEvent[2]; //!< Translated key press data
       
    81     };
       
    82 
       
    83 // ----------------------------------------------------------------------
       
    84 
       
    85 inline TTranslatedKey::TTranslatedKey() :
       
    86     iUnicode(0), iScanCode(0), iHidKey(0), iUsagePage(0), iIsRepeatingKey(
       
    87             EFalse)
       
    88     {
       
    89     // nothing else to do
       
    90     }
       
    91 
       
    92 inline TTranslatedKey::TTranslatedKey(TUint16 aUnicode, TInt aScanCode,
       
    93         TInt aHidKey, TInt aUsagePage, TBool aIsRepeatingKey) :
       
    94     iUnicode(aUnicode), iScanCode(aScanCode), iHidKey(aHidKey), iUsagePage(
       
    95             aUsagePage), iIsRepeatingKey(aIsRepeatingKey)
       
    96     {
       
    97     // nothing else to do
       
    98     }
       
    99 
       
   100 inline TDecodedKeyInfo::TDecodedKeyInfo() :
       
   101     iCount(0), iScanCode(0)
       
   102     {
       
   103     // nothing else to do
       
   104     }
       
   105 
       
   106 // ----------------------------------------------------------------------
       
   107 
       
   108 inline TLockKeys::TLockKeys() :
       
   109     iCapsLock(EFalse), iNumLock(EFalse)
       
   110     {
       
   111     // nothing else to do
       
   112     }
       
   113 
       
   114 inline TLockKeys::TLockKeys(TBool aCapsLock, TBool aNumLock) :
       
   115     iCapsLock(aCapsLock), iNumLock(aNumLock)
       
   116     {
       
   117     // nothing else to do
       
   118     }
       
   119 
       
   120 #endif //HIDKEYS_H
       
   121 // End of File