MMTPStorageMgr Class Reference

class MMTPStorageMgr

Defines the MTP data provider framework storage manager interface. The storage manager controls the allocation of physical and logical MTP StorageIDs, and their mapping to storage media, such as Symbian OS file system drives.

MTP StorageIDs are represented as unsigned 32-bit integers and are subdivided into two 16-bit fields. The most significant 16-bits represents the physical StorageID and the least significant 16-bits represents the StorageID of a logical partition of that physical storage.

Member Functions Documentation

AllocateLogicalStorageIdL(TUint, TDriveNumber, const CMTPStorageMetaData &)

TUint32 AllocateLogicalStorageIdL(TUintaDataProviderId,
TDriveNumberaDriveNumber,
const CMTPStorageMetaData &aStorage
)[pure virtual]
Creates a new logical MTP StorageID partition on the specified Symbian OS file system drive, to be owned and managed by the specified data provider. EStorageSystemType and EStorageSuid elements. The EStorageSystemType must match that of the corresponding physical MTP StorageID. If EStorageSystemType is specified as ESystemTypeDefaultFileSystem then EStorageSuid is validated as a fully formed file system folder path (e.g. "C:\Media") which must correspond to the specified file system drive.
leave
KErrAlreadyExists, if the storage SUID is already defined.
leave
KErrArgument if
EStorageSystemType is not ESystemTypeDefaultFileSystem, or if EStorageSuid is not a valid file system folder path, or does not match the specified drive.
leave
KErrNotFound if the specified drive does not exist.
leave
KErrPathNotFound, if
EStorageSystemType is ESystemTypeDefaultFileSystem and the path specified by EStorageSuid does not exist on the Symbian OS filesystem.
leave
One of the system wide error codes, if a processing failure occurs.

Parameters

TUint aDataProviderIdThe identifier of the data provider which will be responsible for the logical MTP StorageID.
TDriveNumber aDriveNumberThe Symbian OS file system drive on which the logical MTP StorageID partition is to be created.
const CMTPStorageMetaData & aStorageThe storage meta-data. This must minimally specify the

AllocateLogicalStorageIdL(TUint, TUint32, const CMTPStorageMetaData &)

TUint32 AllocateLogicalStorageIdL(TUintaDataProviderId,
TUint32aPhysicalStorageId,
const CMTPStorageMetaData &aStorage
)[pure virtual]
Creates a new logical MTP StorageID partition on the specified physical MTP StorageID, to be owned and managed by the specified data provider. EStorageSystemType and EStorageSuid elements. The EStorageSystemType must match that of the corresponding physical MTP StorageID. If EStorageSystemType is specified as ESystemTypeDefaultFileSystem then EStorageSuid is validated as a fully formed file system folder path (e.g. "C:\Media") which must correspond to the specified file system drive.
leave
KErrAlreadyExists, if the storage SUID is already defined.
leave
KErrArgument if
EStorageSystemType is not ESystemTypeDefaultFileSystem, or if EStorageSuid is not a valid file system folder path, or does not match the specified drive.
leave
KErrNotFound if the specified physical StorageID does not exist.
leave
KErrPathNotFound, if
EStorageSystemType is ESystemTypeDefaultFileSystem and the path specified by EStorageSuid does not exist on the Symbian OS filesystem.
leave
One of the system wide error codes, if a processing failure occurs.

Parameters

TUint aDataProviderIdThe identifier of the data provider which will be responsible for the logical MTP StorageID.
TUint32 aPhysicalStorageIdThe physical MTP StorageID on which the logical MTP StorageID partition is to be created.
const CMTPStorageMetaData & aStorageThe storage meta-data. This must minimally specify the

AllocatePhysicalStorageIdL(TUint, const CMTPStorageMetaData &)

TUint32 AllocatePhysicalStorageIdL(TUintaDataProviderId,
const CMTPStorageMetaData &aStorage
)[pure virtual]
Creates a new physical MTP StorageID to be owned and managed by the specified data provider.
leave
KErrAlreadyExists, if the storage SUID is already defined.
leave
One of the system wide error codes, if a processing failure occurs.

Parameters

TUint aDataProviderIdThe identifier of the data provider which will be responsible for the physical MTP StorageID.
const CMTPStorageMetaData & aStorageThe storage meta-data.

DeallocateLogicalStorageId(TUint, TUint32)

TInt DeallocateLogicalStorageId(TUintaDataProviderId,
TUint32aLogicalStorageId
)[pure virtual]

Releases the specified fully formed logical MTP StorageID.

Parameters

TUint aDataProviderIdThe identifier of the data provider which is responsible for the logical MTP StorageID.
TUint32 aLogicalStorageIdThe fully formed logical MTP StorageID to be deallocated.

DeallocateLogicalStorageIds(TUint, TUint32)

voidDeallocateLogicalStorageIds(TUintaDataProviderId,
TUint32aPhysicalStorageId
)[pure virtual]

Releases all logical MTP StorageIDs which represent partitions of the specified physical MTP StorageID and which are owned by the specified data provider.

Parameters

TUint aDataProviderIdThe identifier of the data provider which is responsible for the logical MTP StorageIDs.
TUint32 aPhysicalStorageIdThe physical MTP StorageID.

DeallocatePhysicalStorageId(TUint, TUint32)

TInt DeallocatePhysicalStorageId(TUintaDataProviderId,
TUint32aPhysicalStorageId
)[pure virtual]

Releases the specified physical MTP StorageID, along with all associated logical storage partititions.

Parameters

TUint aDataProviderIdThe identifier of the data provider which is responsible for the physical MTP StorageID.
TUint32 aPhysicalStorageIdThe physical MTP StorageID to be released.

DefaultStorageId()

TUint32 DefaultStorageId()const [pure virtual]

Provides the default MTP StorageID, as determined by the value of the MTPFrameworkConfig::EDefaultStorageDrive framework configurability parameter. This may either be a physical or fully formed logical MTP StorageID, depending on the value of the MTPFrameworkConfig::ELogicalStorageIdsAllocationEnable framework configurability parameter.

DriveNumber(TUint32)

TInt DriveNumber(TUint32aStorageId)const [pure virtual]

Provides the Symbian OS drive number associated with the specified MTP StorageID.

Parameters

TUint32 aStorageIdThe physical or fully formed logical MTP StorageID.

FrameworkStorageId(TDriveNumber)

TInt32 FrameworkStorageId(TDriveNumberaDriveNumber)const [pure virtual]

Provides the fully formed MTP StorageID created by the MTP data provider framework on the specified Symbian OS drive. If the MTPFrameworkConfig::ELogicalStorageIdsAllocationEnable framework configurability parameter is set, then an MTP StorageID is created on each of the available Symbian OS file system drives as they become available. If not set then the creation of all logical MTP StorageIDs is deferred to the active data providers.

Parameters

TDriveNumber aDriveNumberThe drive number for which the corresponding logical MTP StorageID is required.

GetAvailableDrivesL(RArray< TDriveNumber > &)

voidGetAvailableDrivesL(RArray< TDriveNumber > &aDrives)const [pure virtual]
Provides an ordered list of the Symbian OS file system drives which are available for use as MTP storages. This comprises the sub-set of available Symbian OS file system drives which are left exposed by the the MTPFrameworkConfig::EExcludedStorageDrives framework configurability parameter.
leave
One of the system wide error codes, if a processing failure occurs.

Parameters

RArray< TDriveNumber > & aDrivesOn succesful completion, the list of available Symbian OS file system drives.

GetLogicalStoragesL(const TMTPStorageMgrQueryParams &, RPointerArray< const CMTPStorageMetaData > &)

voidGetLogicalStoragesL(const TMTPStorageMgrQueryParams &aParams,
RPointerArray< const CMTPStorageMetaData > &aStorages
)const [pure virtual]
Provides an ordered list of the storage meta-data for all available logical MTP StorageIDs which match the specified query criteria.
leave
One of the system wide error codes, if a processing failure occurs.

Parameters

const TMTPStorageMgrQueryParams & aParamsThe query parameters.
RPointerArray< const CMTPStorageMetaData > & aStoragesOn succesful completion, the list of matching storage meta-data.

GetPhysicalStoragesL(const TMTPStorageMgrQueryParams &, RPointerArray< const CMTPStorageMetaData > &)

voidGetPhysicalStoragesL(const TMTPStorageMgrQueryParams &aParams,
RPointerArray< const CMTPStorageMetaData > &aStorages
)const [pure virtual]
Provides an ordered list of the storage meta-data for all available physical MTP StorageIDs which match the specified query criteria.
leave
One of the system wide error codes, if a processing failure occurs.

Parameters

const TMTPStorageMgrQueryParams & aParamsThe query parameters.
RPointerArray< const CMTPStorageMetaData > & aStoragesOn succesful completion, the list of matching storage meta-data.

LogicalStorageId(TUint32)

TUint32 LogicalStorageId(TUint32aStorageId)const [pure virtual]

Provides the logical StorageID component (i.e. the least significant 16-bits) of the specified 32-bit MTP StorageID.

Parameters

TUint32 aStorageIdThe MTP StorageID.

LogicalStorageId(const TDesC &)

TInt32 LogicalStorageId(const TDesC &aStorageSuid)const [pure virtual]

Provides the the fully formed 32-bit logical StorageID associated with the specified storage System Unique IDentifier (SUID).

Parameters

const TDesC & aStorageSuid

PhysicalStorageId(TDriveNumber)

TInt32 PhysicalStorageId(TDriveNumberaDriveNumber)const [pure virtual]

Provides the physical MTP StorageID associated with the specified Symbian OS drive number.

Parameters

TDriveNumber aDriveNumberThe Symbian OS drive number.

PhysicalStorageId(TUint32)

TUint32 PhysicalStorageId(TUint32aStorageId)const [pure virtual]

Provides the physical StorageID component (i.e. the most significant 16-bits) of the specified 32-bit MTP StorageID.

Parameters

TUint32 aStorageIdThe MTP StorageID.

StorageId(TUint32, TUint32)

TUint32 StorageId(TUint32aPhysicalStorageId,
TUint32aLogicalStorageId
)const [pure virtual]

Constructs a fully formed 32-bit MTP StorageID from the specified physical and logical MTP StorageIDs.

Parameters

TUint32 aPhysicalStorageIdThe physical MTP StorageID. The least significant 16-bits are ignored.
TUint32 aLogicalStorageIdThe logical MTP StorageID. The most significant 16-bits are ignored.

StorageL(TUint32)

const CMTPStorageMetaData &StorageL(TUint32aStorageId)const [pure virtual]
Provides the storage meta-data for the specified logical MTP StorageID.
leave
KErrNotFound if the specified StorageID does not exist.
leave
One of the system wide error codes, if a processing failure occurs.

Parameters

TUint32 aStorageIdThe physical or fully formed logical MTP StorageID.

ValidStorageId(TUint32)

TBool ValidStorageId(TUint32aStorageId)const [pure virtual]

Indicates if the specified StorageID is defined.

Parameters

TUint32 aStorageIdThe physical or fully formed logical MTP StorageID.

VolumeIdL(TUint, TUint32, const TDesC &)

CMTPTypeString *VolumeIdL(TUintaDataProviderId,
TUint32aStorageId,
const TDesC &aVolumeIdSuffix
)const [pure virtual]
Generates an MTP volume identifier string of which the leading 128 characters are guaranteed to be unique amongst all storages presented to a conected MTP initiator.
leave
KErrAccessDenied if the specified data provider is not the owner of the specified StorageID.
leave
KErrNotFound if the specified MTP StorageID does not exist.
leave
One of the system wide error codes, if a processing failure occurs.

Parameters

TUint aDataProviderIdThe identifier of the data provider.
TUint32 aStorageIdThe MTP StorageID associated with the volume identifier.
const TDesC & aVolumeIdSuffixThe data provider supplied volume identifier string.