CDeviceTypeInformation Class Reference

class CDeviceTypeInformation : public CBase

This class is used to hold the device type information attributes and provides member functions to return the attribute values. These values are strings of UTF-16 characters and no format must be assumed or implied as it varies from one device manufacturer to the next. Please note that this information does not identify a unique device but identifies the type of device.

An instance of this class cannot be created by user code. If device type information attributes are required then the user should use SysUtil::GetDeviceTypeInfoL which will return a pointer to an instance of this class. This instance will contain a full set of device type information attributes that have been provisioned by the device creator. For details of how these are provisioned see 'XXX xxx' document in the OS Developer Library.

For standard device type information attributes (attributes which are common to all device creators) named functions have been provided. These functions also offer the advantage of a default value being provided when an attribute has not been provisioned by the device creator. If a default value has been retrieved KDefaultValue will be returned.

Callers who do not care about whether a default value is retrieved or not can use the API as follows:

	TPtrC16 modelNamePtrC;
	User::LeaveIfError( deviceTypeInfo->GetModelName(modelNamePtrC) );

Where callers wish to avoid the default value it can be tested for as follows:

	TPtrC16 modelNamePtrC;
	if (User::LeaveIfError( deviceTypeInfo->GetModelName(modelNamePtrC)) == CDeviceTypeInformation::KDefaultValue)
		{
		// We have a default attribute value, do something else
		...
		}
	else
		{
		// We have a device creator supplied attribute value.
		...
		}

In addition to named functions, two additional generic functions are provided that can be used to retrieve any additional device type information attributes which may be provided by a device creator. These functions can also be used to retrieve the standard attributes; however, it is recommended that the named functions be used instead.

Any code which owns an instance of this class has the responsibility of destroying it. This may be achieved by calling delete on the pointer or using the CleanupStack.

Inherits from

  • CDeviceTypeInformation

Constructor & Destructor Documentation

CDeviceTypeInformation()

CDeviceTypeInformation()[private]

~CDeviceTypeInformation()

IMPORT_C~CDeviceTypeInformation()

Member Functions Documentation

ConstructL()

voidConstructL()[private]

GetAttribute(const TUid &, TPtrC16 &)

IMPORT_C TIntGetAttribute(const TUid &aAttributeUid,
TPtrC16 &aValue
)const

Parameters

const TUid & aAttributeUid
TPtrC16 & aValue

GetDefaultDeviceName(TPtrC16 &)

IMPORT_C TIntGetDefaultDeviceName(TPtrC16 &aValue)const

Parameters

TPtrC16 & aValue

GetManufacturerName(TPtrC16 &)

IMPORT_C TIntGetManufacturerName(TPtrC16 &aValue)const

Parameters

TPtrC16 & aValue

GetModelCode(TPtrC16 &)

IMPORT_C TIntGetModelCode(TPtrC16 &aValue)const

Parameters

TPtrC16 & aValue

GetModelName(TPtrC16 &)

IMPORT_C TIntGetModelName(TPtrC16 &aValue)const

Parameters

TPtrC16 & aValue

GetOSVersion(TPtrC16 &)

IMPORT_C TIntGetOSVersion(TPtrC16 &aValue)const

Parameters

TPtrC16 & aValue

GetOSVersion(TUint16 &, TUint16 &)

IMPORT_C TIntGetOSVersion(TUint16 &aMajor,
TUint16 &aMinor
)const

Parameters

TUint16 & aMajor
TUint16 & aMinor

GetRevisionID(TPtrC16 &)

IMPORT_C TIntGetRevisionID(TPtrC16 &aValue)const

Parameters

TPtrC16 & aValue

GetUIPlatformName(TPtrC16 &)

IMPORT_C TIntGetUIPlatformName(TPtrC16 &aValue)const

Parameters

TPtrC16 & aValue

GetUIPlatformVersion(TPtrC16 &)

IMPORT_C TIntGetUIPlatformVersion(TPtrC16 &aValue)const

Parameters

TPtrC16 & aValue

GetUIPlatformVersion(TUint16 &, TUint16 &)

IMPORT_C TIntGetUIPlatformVersion(TUint16 &aMajor,
TUint16 &aMinor
)const

Parameters

TUint16 & aMajor
TUint16 & aMinor

NewL()

CDeviceTypeInformation *NewL()[static]

Member Data Documentation

const TInt KDefaultValue

const TIntKDefaultValue[static]

This const is a value returned from calls to the named CDeviceTypeInformation APIs. It indicates to the caller that the returned device type information attribute, stored in CDeviceTypeInformation, is a default value. This occurs when the device creator does not provision the attribute value.

const TInt KMaxAttributeLength

const TIntKMaxAttributeLength[static]

The maximum length of a device attribute string value.

TImpl * iImpl

TImpl *iImpl[private]