epoc32/include/e32ktran.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
permissions -rw-r--r--
Final list of Symbian^2 public API header files
     1 // Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 // e32\include\e32ktran.h
    15 // 
    16 //
    17 
    18 
    19 
    20 /**
    21  @file
    22  @internalTechnology
    23 */
    24 
    25 #ifndef __E32KTRAN_H__
    26 #define __E32KTRAN_H__
    27 #include <e32std.h>
    28 #include <e32keys.h>
    29 #include <e32base.h>
    30 //
    31 class TMaskedModifiers
    32 	{
    33 public:
    34 	TUint iMask;
    35 	TUint iValue;
    36 	};
    37 //
    38 enum TPattern
    39 	{
    40 	EAnyKey=0x00,
    41 	EAnyAlphaNumeric,
    42 	EAnyAlpha,
    43 	EAnyAlphaLowerCase,
    44 	EAnyAlphaUpperCase,
    45 	EAnyDecimalDigit,
    46 	EAnyDigitGivenRadix,
    47 	EAnyModifierKey,
    48 	EMatchKey=0x40,
    49 	EMatchKeyCaseInsens,
    50 	EMatchLeftOrRight
    51 	};
    52 //
    53 class TKeyCodePattern
    54 	{
    55 public:
    56 	TUint16 iKeyCode;
    57 	TInt8   iPattern;
    58 	TInt8   iFiller;
    59 	};
    60 //
    61 class TCaptureKey
    62 	{
    63 public:
    64 	TMaskedModifiers iModifiers;
    65 	TKeyCodePattern  iKeyCodePattern;
    66 	TUint iApp;
    67 	TUint iHandle;
    68 	};
    69 //
    70 class TKeyData
    71 	{
    72 public:
    73 	TInt  iModifiers;
    74 	TInt  iApp;
    75 	TInt  iHandle;
    76 	TBool iIsCaptureKey;
    77 	TUint iKeyCode;
    78 	};
    79 //
    80 class CCaptureKeys: public CBase
    81 	{
    82 public:
    83 	IMPORT_C CCaptureKeys();
    84 	IMPORT_C ~CCaptureKeys();
    85 	IMPORT_C void Construct();
    86 	IMPORT_C void AddCaptureKeyL(const TCaptureKey &aCaptureKey);
    87 	IMPORT_C void AddCaptureKeyL(const TCaptureKey &aCaptureKey, TUint8 aPriority);
    88 	IMPORT_C void SetCaptureKey(TUint32 aHandle, const TCaptureKey &aCaptureKey);
    89 	IMPORT_C void SetCaptureKey(TUint32 aHandle, const TCaptureKey &aCaptureKey, TUint8 aPriority);
    90 	IMPORT_C void CancelCaptureKey(TUint32 aHandle);
    91 	IMPORT_C void CancelAllCaptureKeys(TUint32 aApp);
    92 	IMPORT_C void ProcessCaptureKeys(TKeyData &aKeyData) const;
    93 protected:
    94 	void CheckCaptureKey(const TCaptureKey &aCaptureKey);
    95 	void removeCaptureKey(TUint index);
    96 protected:
    97 	RArray<TCaptureKey> iCKarray;
    98 	};
    99 //
   100 class CKeyTranslator: public CBase
   101 	{
   102 public:
   103 	IMPORT_C static CKeyTranslator *New();
   104 	virtual TInt GetModifierState()=0;
   105 	virtual void SetModifierState(TEventModifier aModifier,TModifierState aState)=0;
   106 	virtual TBool TranslateKey(TUint aScanCode,TBool aKeyUp,const CCaptureKeys &aCaptureKeys,TKeyData &aKeyData)=0;
   107     virtual void UpdateModifiers(TInt aModifiers)=0;
   108     virtual TInt ChangeKeyData(const TDesC& aLibraryName)=0;
   109 	};
   110 
   111 #endif