CVirtualKey Class Reference

class CVirtualKey : public CBase

CVirtualKey

Key on virtual key board. A virtual key is similar to the key in hard keyboard. It will report virtual key up/down event when pressed up/down with a TkeyEvent data

feplayoutcontrol.lib
Since
S60 V4.0

Inherits from

Public Member Functions
~CVirtualKey()
TBool Dimmed()
TUint DisplayCode()
TDesC *DisplayUnicode()
IMPORT_C voidHideKeyCtrl(TBool)
TInt HighlightBmpIndex()
TInt HighlightMaskBmpIndex()
TRect InnerRect()
IMPORT_C TVirtualKeyIrregularKeyTypeIrregualrKeyType()
TBool IsLatchKey()
TUint KeyCode()
const TDesC &KeyUnicodes()
const TDesC &KeyUnicodes(TVirtualKeyTextPos)
TBool Latched()
IMPORT_C CVirtualKey *NewL(TUint, TInt, const TRect &, const TRect &, TInt, TInt, TInt)
IMPORT_C CVirtualKey *NewL(const TDesC &, TInt, const TRect &, const TRect &, TInt, TInt, TInt)
IMPORT_C CVirtualKey *NewL(RPointerArray< HBufC > &, TInt, const TRect &)
const TRect &Rect()
TInt ScanCode()
voidSetDimmed(TBool)
voidSetDisplayCode(TUint)
IMPORT_C voidSetDisplayUnicodeL(const TDesC &)
voidSetInnerRect(const TRect &)
IMPORT_C voidSetIrregualrKeyType(TVirtualKeyIrregularKeyType)
voidSetKeyData(const TDesC &)
voidSetKeyScancode(TInt)
voidSetLatchKey(TBool)
IMPORT_C voidSetLatched(TBool)
IMPORT_C voidSetRect(const TRect &)
IMPORT_C voidSetUnicodesL(RPointerArray< HBufC > &)
TBool UnicodesListEmpty(TInt &)
Protected Member Functions
voidConstructL(const TDesC &)
voidConstructL(const RPointerArray< HBufC > &)
Private Member Functions
CVirtualKey(TUint, TInt, const TRect &, TInt, TInt)
CVirtualKey(TInt, const TRect &)
CVirtualKeyCtrl *CreateKeyCtrlL(CVirtualKey *, TBool)
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Private Attributes
TUint iCode
HBufC *iCodeData
TBool iDimmed
HBufC *iDisplayCodeData
TInt iHighlightBmpIndex
TInt iHighlightMaskBmpIndex
TVirtualKeyIrregularKeyType iIrregularKeyType
TBool iIsLatchKey
CVirtualKeyCtrl *iKeyCtrl
TBool iLatched
TRect iRect
TInt iReserver1
TInt iReserver2
TUint iScanCode
RPointerArray< HBufC >iUnicodesList
TRect innerRect

Constructor & Destructor Documentation

CVirtualKey(TUint, TInt, const TRect &, TInt, TInt)

CVirtualKey(TUintaCode,
TIntaScanCode,
const TRect &aRect,
TIntaHighlightBmpIdx,
TIntaHighlightMaskBmpId
)[private]

Default constructor

Since
S60 V4.0

Parameters

TUint aCodeThe code this key stands for
TInt aScanCodeThe scan code for this key
const TRect & aRectThe position of the key relative to keyboard
TInt aHighlightBmpIdxThe bitmap index for highlighging key background. Bitmap is stored in virtual key board.
TInt aHighlightMaskBmpId

CVirtualKey(TInt, const TRect &)

CVirtualKey(TIntaScanCode,
const TRect &aRect
)[private]

Parameters

TInt aScanCode
const TRect & aRect

~CVirtualKey()

IMPORT_C~CVirtualKey()[virtual]

Destructor

Since
S60 V4.0

Member Functions Documentation

ConstructL(const TDesC &)

voidConstructL(const TDesC &aCodeData)[protected]

2nd phase constructor

Since
S60 V4.0

Parameters

const TDesC & aCodeData

ConstructL(const RPointerArray< HBufC > &)

voidConstructL(const RPointerArray< HBufC > &aUnicodesList)[protected]

Parameters

const RPointerArray< HBufC > & aUnicodesList

CreateKeyCtrlL(CVirtualKey *, TBool)

CVirtualKeyCtrl *CreateKeyCtrlL(CVirtualKey *aKeyInfo,
TBoolaRawKeyFlag
)[private]

Create a key control

Since
S60 V5.0

Parameters

CVirtualKey * aKeyInfoThe virtual key information
TBool aRawKeyFlagFlag indicates whether a raw key is needed

Dimmed()

TBool Dimmed()const [inline]

Get the key dim status

Since
S60 V4.0

DisplayCode()

TUint DisplayCode()const [inline]

Get key display code

Since
S60 V4.0

DisplayUnicode()

TDesC *DisplayUnicode()const [inline]

HideKeyCtrl(TBool)

IMPORT_C voidHideKeyCtrl(TBoolaHide)

Parameters

TBool aHide

HighlightBmpIndex()

TInt HighlightBmpIndex()[inline]

Get key highlight image index

Since
S60 V4.0

HighlightMaskBmpIndex()

TInt HighlightMaskBmpIndex()[inline]

Get key highlight mask image index

Since
S60 V4.0

InnerRect()

TRect InnerRect()[inline]

IrregualrKeyType()

IMPORT_C TVirtualKeyIrregularKeyTypeIrregualrKeyType()

IsLatchKey()

TBool IsLatchKey()[inline]

test whether this key a latch key

Since
S60 V4.0

KeyCode()

TUint KeyCode()const [inline]

Get key code

Since
S60 V4.0

KeyUnicodes()

const TDesC &KeyUnicodes()const [inline]

Get key code data. Support for multi language

Since
S60 V4.0

KeyUnicodes(TVirtualKeyTextPos)

const TDesC &KeyUnicodes(TVirtualKeyTextPosaPos)const

Parameters

TVirtualKeyTextPos aPos

Latched()

TBool Latched()[inline]

get key latch state

Since
S60 V4.0

NewL(TUint, TInt, const TRect &, const TRect &, TInt, TInt, TInt)

IMPORT_C CVirtualKey *NewL(TUintaCode,
TIntaScanCode,
const TRect &aRect,
const TRect &aCharRect,
TIntaBaseLine,
TIntaHighlightBmpIdx = -1,
TIntaHighlightMaskBmpId = -1
)[static]

Factory function This is used for those languange whose character needs more unicodes.

Since
S60 V4.0

Parameters

TUint aCodeThe code this key stands for.
TInt aScanCodeThe scan code for this key
const TRect & aRectThe position of the key relative to keyboard
const TRect & aCharRectThe rect when key is drawn
TInt aBaseLineThe baseline for key drawing
TInt aHighlightBmpIdx = -1The bitmap index for highlighging key background. Bitmap is stored in virtual key board.
TInt aHighlightMaskBmpId = -1

NewL(const TDesC &, TInt, const TRect &, const TRect &, TInt, TInt, TInt)

IMPORT_C CVirtualKey *NewL(const TDesC &aCode,
TIntaScanCode,
const TRect &aRect,
const TRect &aCharRect,
TIntaBaseLine,
TIntaHighlightBmpIdx = -1,
TIntaHighlightMaskBmpId = -1
)[static]

Factory function This is used for those languange whose character needs more unicodes.

Since
S60 V4.0

Parameters

const TDesC & aCodeThe code this key stands for.
TInt aScanCodeThe scan code for this key
const TRect & aRectThe position of the key relative to keyboard
const TRect & aCharRectThe rect when key is drawn
TInt aBaseLineThe baseline for key drawing
TInt aHighlightBmpIdx = -1The bitmap index for highlighging key background. Bitmap is stored in virtual key board.
TInt aHighlightMaskBmpId = -1

NewL(RPointerArray< HBufC > &, TInt, const TRect &)

IMPORT_C CVirtualKey *NewL(RPointerArray< HBufC > &aUnicodesList,
TIntaScanCode,
const TRect &aRect
)[static]

Parameters

RPointerArray< HBufC > & aUnicodesList
TInt aScanCode
const TRect & aRect

Rect()

const TRect &Rect()const [inline]

Return key position

Since
S60 V4.0

ScanCode()

TInt ScanCode()const [inline]

Get key scancode

Since
S60 V4.0

SetDimmed(TBool)

voidSetDimmed(TBoolaFlag)[inline]

Dim a key

Since
S60 V4.0

Parameters

TBool aFlagThe dim status

SetDisplayCode(TUint)

voidSetDisplayCode(TUintaCode)[inline]

Set key display code

Since
S60 V4.0

Parameters

TUint aCodeThe display code

SetDisplayUnicodeL(const TDesC &)

IMPORT_C voidSetDisplayUnicodeL(const TDesC &aDspUnicode)

Set keyboard to key

Since
S60 V4.0

Parameters

const TDesC & aDspUnicode

SetInnerRect(const TRect &)

voidSetInnerRect(const TRect &aRect)[inline]

Parameters

const TRect & aRect

SetIrregualrKeyType(TVirtualKeyIrregularKeyType)

IMPORT_C voidSetIrregualrKeyType(TVirtualKeyIrregularKeyTypeaKeyType)

Parameters

TVirtualKeyIrregularKeyType aKeyType

SetKeyData(const TDesC &)

voidSetKeyData(const TDesC &aKeyData)[inline]

Parameters

const TDesC & aKeyData

SetKeyScancode(TInt)

voidSetKeyScancode(TIntaScancode)[inline]

Parameters

TInt aScancode

SetLatchKey(TBool)

voidSetLatchKey(TBoolaFlag)[inline]

set key to be a latch key

Since
S60 V4.0

Parameters

TBool aFlagThe key latch style flag. ETrue if set to latch key.

SetLatched(TBool)

IMPORT_C voidSetLatched(TBoolaFlag)

set key latch state

Since
S60 V4.0

Parameters

TBool aFlag

SetRect(const TRect &)

IMPORT_C voidSetRect(const TRect &aRect)

Set key position

Since
S60 V4.0

Parameters

const TRect & aRect

SetUnicodesL(RPointerArray< HBufC > &)

IMPORT_C voidSetUnicodesL(RPointerArray< HBufC > &aUnicodesList)

Parameters

RPointerArray< HBufC > & aUnicodesList

UnicodesListEmpty(TInt &)

TBool UnicodesListEmpty(TInt &aIdx)

Parameters

TInt & aIdx

Member Data Documentation

TUint iCode

TUint iCode[private]

Key event attribute for this key

HBufC * iCodeData

HBufC *iCodeData[private]

unicode data for the key. By default it only contains the key code. But for some languages, a character may need several unicodes.

TBool iDimmed

TBool iDimmed[private]

HBufC * iDisplayCodeData

HBufC *iDisplayCodeData[private]

Unicode data for the key display. Some special character need additional unicode to display. It's different than its unicode.

TInt iHighlightBmpIndex

TInt iHighlightBmpIndex[private]

The hight light bitmap index for this key. Bitmap is owned by keyboard High light bitmap is used when key does not have background bitmap itself, pressed/highlight effect is down by show the highlight bitmap then draws text on top of the bitmap. See DrawIndication.

The assumption is that when this index is >= 0 , then fading effect is not used. Key pressing effect is then implemented by bitmap.

TInt iHighlightMaskBmpIndex

TInt iHighlightMaskBmpIndex[private]

The hight light mask bitmap index for this key

TVirtualKeyIrregularKeyType iIrregularKeyType

TVirtualKeyIrregularKeyType iIrregularKeyType[private]

TBool iIsLatchKey

TBool iIsLatchKey[private]

CVirtualKeyCtrl * iKeyCtrl

CVirtualKeyCtrl *iKeyCtrl[private]

Keyboard which contains the key Key control created for this key information by key board

TBool iLatched

TBool iLatched[private]

TRect iRect

TRect iRect[private]

The position relative to the keyboard. Not relative to the layout. This is the valid region when pointer event effected to this key.

TInt iReserver1

TInt iReserver1[private]

Reserve item

TInt iReserver2

TInt iReserver2[private]

Reserve item

TUint iScanCode

TUint iScanCode[private]

RPointerArray< HBufC > iUnicodesList

RPointerArray< HBufC >iUnicodesList[private]

TRect innerRect

TRect innerRect[private]