TReportTranslator Class Reference

class TReportTranslator

HID report translator

Allows a device driver to extract data items from a device report, based on the results of the report descriptor parser stage (at device connection)

generichid.lib
Since
S60 v5.0
Public Member Functions
TReportTranslator(const TDesC8 &, const CField *)
IMPORT_C TIntCount()
IMPORT_C TIntGetUsageId(TInt &, TInt)
IMPORT_C TIntGetValue(TInt &, TInt, TInt)
IMPORT_C TIntRawValueL(TInt)
IMPORT_C TIntUsageIdL(TInt)
IMPORT_C TIntValueL(TInt, TInt)
Private Attributes
const TDesC8 &iData
const CField *iField

Constructor & Destructor Documentation

TReportTranslator(const TDesC8 &, const CField *)

IMPORT_CTReportTranslator(const TDesC8 &aData,
const CField *aField
)

Constructor.

Since
S60 v5.0

Parameters

const TDesC8 & aDataData to be extracted
const CField * aFieldHID field

Member Functions Documentation

Count()

IMPORT_C TIntCount()const

Gets the number of controls in the field.

Since
S60 v5.0

GetUsageId(TInt &, TInt)

IMPORT_C TIntGetUsageId(TInt &aUsageId,
TIntaIndex
)const

Gets the usage ID at a given index in an array field. For variable fields, if the logical value of the control at the given index is non- zero, returns the usage ID of the control, otherwise returns zero.

Since
S60 v5.0

Parameters

TInt & aUsageIdReference to variable to receive the usage ID.
TInt aIndexIndex in the array to read.

GetValue(TInt &, TInt, TInt)

IMPORT_C TIntGetValue(TInt &aValue,
TIntaUsageId,
TIntaControlOffset = 0
)const

For variable fields, reads the logical value of the control with the given usage ID. For arrays, searches for the usage ID and gives the value as ETrue if found and EFalse if not.

Since
S60 v5.0

Parameters

TInt & aValueReference to variable to receive the value read from the field.
TInt aUsageIdUsage ID of the control to read.
TInt aControlOffset = 0Which control to read when more than one have the same usage ID.

RawValueL(TInt)

IMPORT_C TIntRawValueL(TIntaIndex)const

Gets the logical value at a given index in a field. Leaves if an error occurs.

Since
S60 v5.0

Parameters

TInt aIndexIndex in the field to read.

UsageIdL(TInt)

IMPORT_C TIntUsageIdL(TIntaIndex)const

Alternate version of the above method for convenience. Returns the usage ID directly and leaves if an error occurs.

Since
S60 v5.0

Parameters

TInt aIndexIndex in the array to read.

ValueL(TInt, TInt)

IMPORT_C TIntValueL(TIntaUsageId,
TIntaControlOffset = 0
)const

Alternate version of the above method for convenience. Returns the value read directly and leaves if an error occurs.

Since
S60 v5.0

Parameters

TInt aUsageIdUsage ID of the control to read.
TInt aControlOffset = 0Which control to read when more than one have the same usage ID.

Member Data Documentation

const TDesC8 & iData

const TDesC8 &iData[private]

Data to be extracted

const CField * iField

const CField *iField[private]

HID field Not own.