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 ( TUint aDataProviderId,
TDriveNumber aDriveNumber,
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 aDataProviderId The identifier of the data provider which will be responsible for the logical MTP StorageID.
TDriveNumber aDriveNumber The Symbian OS file system drive on which the logical MTP StorageID partition is to be created.
const CMTPStorageMetaData & aStorage The storage meta-data. This must minimally specify the

AllocateLogicalStorageIdL(TUint, TUint32, const CMTPStorageMetaData &)

TUint32 AllocateLogicalStorageIdL ( TUint aDataProviderId,
TUint32 aPhysicalStorageId,
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 aDataProviderId The identifier of the data provider which will be responsible for the logical MTP StorageID.
TUint32 aPhysicalStorageId The physical MTP StorageID on which the logical MTP StorageID partition is to be created.
const CMTPStorageMetaData & aStorage The storage meta-data. This must minimally specify the

AllocatePhysicalStorageIdL(TUint, const CMTPStorageMetaData &)

TUint32 AllocatePhysicalStorageIdL ( TUint aDataProviderId,
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 aDataProviderId The identifier of the data provider which will be responsible for the physical MTP StorageID.
const CMTPStorageMetaData & aStorage The storage meta-data.

DeallocateLogicalStorageId(TUint, TUint32)

TInt DeallocateLogicalStorageId ( TUint aDataProviderId,
TUint32 aLogicalStorageId
) [pure virtual]

Releases the specified fully formed logical MTP StorageID.

Parameters

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

DeallocateLogicalStorageIds(TUint, TUint32)

void DeallocateLogicalStorageIds ( TUint aDataProviderId,
TUint32 aPhysicalStorageId
) [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 aDataProviderId The identifier of the data provider which is responsible for the logical MTP StorageIDs.
TUint32 aPhysicalStorageId The physical MTP StorageID.

DeallocatePhysicalStorageId(TUint, TUint32)

TInt DeallocatePhysicalStorageId ( TUint aDataProviderId,
TUint32 aPhysicalStorageId
) [pure virtual]

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

Parameters

TUint aDataProviderId The identifier of the data provider which is responsible for the physical MTP StorageID.
TUint32 aPhysicalStorageId The 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 ( TUint32 aStorageId ) const [pure virtual]

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

Parameters

TUint32 aStorageId The physical or fully formed logical MTP StorageID.

FrameworkStorageId(TDriveNumber)

TInt32 FrameworkStorageId ( TDriveNumber aDriveNumber ) 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 aDriveNumber The drive number for which the corresponding logical MTP StorageID is required.

GetAvailableDrivesL(RArray< TDriveNumber > &)

void GetAvailableDrivesL ( 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 > & aDrives On succesful completion, the list of available Symbian OS file system drives.

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

void GetLogicalStoragesL ( 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 & aParams The query parameters.
RPointerArray < const CMTPStorageMetaData > & aStorages On succesful completion, the list of matching storage meta-data.

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

void GetPhysicalStoragesL ( 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 & aParams The query parameters.
RPointerArray < const CMTPStorageMetaData > & aStorages On succesful completion, the list of matching storage meta-data.

LogicalStorageId(TUint32)

TUint32 LogicalStorageId ( TUint32 aStorageId ) const [pure virtual]

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

Parameters

TUint32 aStorageId The 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 ( TDriveNumber aDriveNumber ) const [pure virtual]

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

Parameters

TDriveNumber aDriveNumber The Symbian OS drive number.

PhysicalStorageId(TUint32)

TUint32 PhysicalStorageId ( TUint32 aStorageId ) const [pure virtual]

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

Parameters

TUint32 aStorageId The MTP StorageID.

StorageId(TUint32, TUint32)

TUint32 StorageId ( TUint32 aPhysicalStorageId,
TUint32 aLogicalStorageId
) const [pure virtual]

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

Parameters

TUint32 aPhysicalStorageId The physical MTP StorageID. The least significant 16-bits are ignored.
TUint32 aLogicalStorageId The logical MTP StorageID. The most significant 16-bits are ignored.

StorageL(TUint32)

const CMTPStorageMetaData & StorageL ( TUint32 aStorageId ) 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 aStorageId The physical or fully formed logical MTP StorageID.

ValidStorageId(TUint32)

TBool ValidStorageId ( TUint32 aStorageId ) const [pure virtual]

Indicates if the specified StorageID is defined.

Parameters

TUint32 aStorageId The physical or fully formed logical MTP StorageID.

VolumeIdL(TUint, TUint32, const TDesC &)

CMTPTypeString * VolumeIdL ( TUint aDataProviderId,
TUint32 aStorageId,
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 aDataProviderId The identifier of the data provider.
TUint32 aStorageId The MTP StorageID associated with the volume identifier.
const TDesC & aVolumeIdSuffix The data provider supplied volume identifier string.