os/kernelhwsrv/kernel/eka/include/e32ktran.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of the License "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
// e32\include\e32ktran.h
sl@0
    15
// 
sl@0
    16
// WARNING: This file contains some APIs which are internal and are subject
sl@0
    17
//          to change without notice. Such APIs should therefore not be used
sl@0
    18
//          outside the Kernel and Hardware Services package.
sl@0
    19
//
sl@0
    20
sl@0
    21
/**
sl@0
    22
 @file
sl@0
    23
 @internalTechnology
sl@0
    24
*/
sl@0
    25
sl@0
    26
#ifndef __E32KTRAN_H__
sl@0
    27
#define __E32KTRAN_H__
sl@0
    28
#include <e32std.h>
sl@0
    29
#include <e32keys.h>
sl@0
    30
#include <e32base.h>
sl@0
    31
//
sl@0
    32
class TMaskedModifiers
sl@0
    33
	{
sl@0
    34
public:
sl@0
    35
	TUint iMask;
sl@0
    36
	TUint iValue;
sl@0
    37
	};
sl@0
    38
//
sl@0
    39
enum TPattern
sl@0
    40
	{
sl@0
    41
	EAnyKey=0x00,
sl@0
    42
	EAnyAlphaNumeric,
sl@0
    43
	EAnyAlpha,
sl@0
    44
	EAnyAlphaLowerCase,
sl@0
    45
	EAnyAlphaUpperCase,
sl@0
    46
	EAnyDecimalDigit,
sl@0
    47
	EAnyDigitGivenRadix,
sl@0
    48
	EAnyModifierKey,
sl@0
    49
	EMatchKey=0x40,
sl@0
    50
	EMatchKeyCaseInsens,
sl@0
    51
	EMatchLeftOrRight
sl@0
    52
	};
sl@0
    53
//
sl@0
    54
class TKeyCodePattern
sl@0
    55
	{
sl@0
    56
public:
sl@0
    57
	TUint16 iKeyCode;
sl@0
    58
	TInt8   iPattern;
sl@0
    59
	TInt8   iFiller;
sl@0
    60
	};
sl@0
    61
//
sl@0
    62
class TCaptureKey
sl@0
    63
	{
sl@0
    64
public:
sl@0
    65
	TMaskedModifiers iModifiers;
sl@0
    66
	TKeyCodePattern  iKeyCodePattern;
sl@0
    67
	TUint iApp;
sl@0
    68
	TUint iHandle;
sl@0
    69
	};
sl@0
    70
//
sl@0
    71
class TKeyData
sl@0
    72
	{
sl@0
    73
public:
sl@0
    74
	TInt  iModifiers;
sl@0
    75
	TInt  iApp;
sl@0
    76
	TInt  iHandle;
sl@0
    77
	TBool iIsCaptureKey;
sl@0
    78
	TUint iKeyCode;
sl@0
    79
	};
sl@0
    80
//
sl@0
    81
class CCaptureKeys: public CBase
sl@0
    82
	{
sl@0
    83
public:
sl@0
    84
	IMPORT_C CCaptureKeys();
sl@0
    85
	IMPORT_C ~CCaptureKeys();
sl@0
    86
	IMPORT_C void Construct();
sl@0
    87
	IMPORT_C void AddCaptureKeyL(const TCaptureKey &aCaptureKey);
sl@0
    88
	IMPORT_C void AddCaptureKeyL(const TCaptureKey &aCaptureKey, TUint8 aPriority);
sl@0
    89
	IMPORT_C void SetCaptureKey(TUint32 aHandle, const TCaptureKey &aCaptureKey);
sl@0
    90
	IMPORT_C void SetCaptureKey(TUint32 aHandle, const TCaptureKey &aCaptureKey, TUint8 aPriority);
sl@0
    91
	IMPORT_C void CancelCaptureKey(TUint32 aHandle);
sl@0
    92
	IMPORT_C void CancelAllCaptureKeys(TUint32 aApp);
sl@0
    93
	IMPORT_C void ProcessCaptureKeys(TKeyData &aKeyData) const;
sl@0
    94
protected:
sl@0
    95
	void CheckCaptureKey(const TCaptureKey &aCaptureKey);
sl@0
    96
	void removeCaptureKey(TUint index);
sl@0
    97
protected:
sl@0
    98
	RArray<TCaptureKey> iCKarray;
sl@0
    99
	};
sl@0
   100
//
sl@0
   101
class CKeyTranslator: public CBase
sl@0
   102
	{
sl@0
   103
public:
sl@0
   104
	IMPORT_C static CKeyTranslator *New();
sl@0
   105
	virtual TInt GetModifierState()=0;
sl@0
   106
	virtual void SetModifierState(TEventModifier aModifier,TModifierState aState)=0;
sl@0
   107
	virtual TBool TranslateKey(TUint aScanCode,TBool aKeyUp,const CCaptureKeys &aCaptureKeys,TKeyData &aKeyData)=0;
sl@0
   108
    virtual void UpdateModifiers(TInt aModifiers)=0;
sl@0
   109
    virtual TInt ChangeKeyData(const TDesC& aLibraryName)=0;
sl@0
   110
	};
sl@0
   111
sl@0
   112
#endif
sl@0
   113