mtpfws/mtpfw/dataproviders/dataproviderapi/interface/mmtpobjectmgr.h
changeset 0 d0791faffa3f
equal deleted inserted replaced
-1:000000000000 0:d0791faffa3f
       
     1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 /**
       
    17  @file
       
    18  @publishedPartner
       
    19  @released
       
    20 */
       
    21 
       
    22 #ifndef MMTPOBJECTMGR_H
       
    23 #define MMTPOBJECTMGR_H
       
    24 
       
    25 #include <badesca.h>
       
    26 #include <e32cmn.h>
       
    27 #include <e32def.h>
       
    28 #include <mtp/mtpobjectmgrquerytypes.h>
       
    29 #include <mtp/tmtptypeuint128.h>
       
    30 
       
    31 class CMTPObjectMetaData;
       
    32 class CMTPTypeArray;
       
    33 class TMTPTypeUint32;
       
    34 
       
    35 /** 
       
    36 Defines the MTP data provider framework object store enumeration manager 
       
    37 interface.
       
    38 @publishedPartner
       
    39 @released
       
    40 */
       
    41 class MMTPObjectMgr
       
    42     {
       
    43 public:
       
    44     
       
    45     /**
       
    46     Provides a count of the number of object meta data records present 
       
    47     in the MTP data object enumeration store. This query can be targeted 
       
    48     at specific storage media and/or object data formats, or can be used 
       
    49     to query all MTP data objects on the device.
       
    50     @param aParams The query parameters.
       
    51     @return A count of the number of object meta data records.
       
    52     @leave One of the system wide error codes, if a processing failure occurs.
       
    53     */
       
    54     virtual TUint CountL(const TMTPObjectMgrQueryParams& aParams) const = 0;
       
    55 	
       
    56 	/**
       
    57 	Commits into MTP data object enumeration store the object handle and 
       
    58 	storage space previously reserved for the specified object. This is 
       
    59 	typically used when either an MTP SendObjectInfo/SendObject, or 
       
    60 	SendObjectPropList/SendObject operation sequence has completed 
       
    61 	successfully.
       
    62     @param aObject The MTP data object information record to be commited.
       
    63     @leave One of the system wide error codes, if a processing failure occurs.
       
    64     @see ReserveObjectHandleL
       
    65 	*/
       
    66 	virtual void CommitReservedObjectHandleL(CMTPObjectMetaData& aObject) = 0;
       
    67     
       
    68     /**
       
    69     Provides an array of object handles present in the MTP data object 
       
    70     enumeration store. This query can be targeted at specific storage media 
       
    71     and/or object data formats, or can be used to query all MTP data objects 
       
    72     on the device. 
       
    73     
       
    74     Depending on the query parameter specified, this query may incur significant 
       
    75     RAM consumption, and so is intended to be called repeatedly in order to 
       
    76     retrieve all matching SUID data. On completion, @see aContext can be used
       
    77     to determine if there is more data to be retrieved.
       
    78     
       
    79     If there are no object handles which match the specified parameters then a 
       
    80     zero length SUID array is provided. 
       
    81     
       
    82     @param aParams The query parameters.
       
    83     @param aContext The query context data. On completion this data indicates 
       
    84     if there are additional object handle data to retrieve.
       
    85     @param aHandles The MTP object handles array buffer to be populated.
       
    86     @leave One of the system wide error codes, if a processing failure occurs.
       
    87     @leave One of the system wide error codes, if a processing failure occurs.
       
    88     */
       
    89     virtual void GetObjectHandlesL(const TMTPObjectMgrQueryParams& aParams, RMTPObjectMgrQueryContext& aContext, RArray<TUint>& aHandles) const = 0;
       
    90     
       
    91     /**
       
    92     Provides an array of object SUIDs present in the MTP data object 
       
    93     enumeration store. This query can be targeted at specific storage media 
       
    94     and/or object data formats, or can be used to query all MTP data objects 
       
    95     on the device. 
       
    96     
       
    97     Depending on the query parameter specified, this query may incur significant 
       
    98     RAM consumption, and so is intended to be called repeatedly in order to 
       
    99     retrieve all matching object SUID data. On completion, @see aContext can be used
       
   100     to determine if there is more data to be retrieved.
       
   101     
       
   102     If there are no object handles which match the specified parameters then a 
       
   103     zero length SUID array is provided. 
       
   104     
       
   105     @param aParams The query parameters.
       
   106     @param aContext The query context data. On completion this data indicates 
       
   107     if there are additional SUID data to retrieve.
       
   108     @param aSuids The object SUIDs array buffer to be populated.
       
   109     @leave One of the system wide error codes, if a processing failure occurs.
       
   110     */
       
   111     virtual void GetObjectSuidsL(const TMTPObjectMgrQueryParams& aParams, RMTPObjectMgrQueryContext& aContext, CDesCArray& aSuids) const = 0;
       
   112 	
       
   113 
       
   114 	
       
   115 	/**
       
   116 	Provides the MTP object handle of the object with the specified specified 
       
   117 	System Unique Identifier (SUID).
       
   118     @param aSuid The object SUID.
       
   119     @return The MTP object handle.
       
   120     @leave One of the system wide error codes, if a processing failure occurs.
       
   121 	*/
       
   122 	virtual TUint32 HandleL(const TDesC& aSuid) const = 0;
       
   123 
       
   124     /**
       
   125     Inserts a single object information record into the MTP data object 
       
   126     enumeration store. A unique MTP object handle is assigned to the 
       
   127     data object.
       
   128     @param aObject The MTP data object information record to be inserted.
       
   129     @leave KErrAlreadyExists, if an object with the specified MTP object SUID
       
   130     already exists in the MTP data object enumeration store.
       
   131     @leave One of the system wide error codes, if a processing failure occurs.
       
   132     */
       
   133     virtual void InsertObjectL(CMTPObjectMetaData& aObject) = 0;
       
   134 
       
   135     /**
       
   136     Inserts multiple object meta data records in the MTP data object 
       
   137     enumeration store. A unique MTP object handle is assigned to each of the 
       
   138     data objects. 
       
   139     @param aObjects The MTP data object meta data records to be inserted.
       
   140     @leave KErrAlreadyExists, if an object with the one of the specified MTP 
       
   141     object SUIDs already exists in the MTP data object enumeration store.
       
   142     already exists in the MTP data object enumeration store.
       
   143     @leave One of the system wide error codes, if a processing failure occurs.
       
   144     */
       
   145     virtual void InsertObjectsL(RPointerArray<CMTPObjectMetaData>& aObjects) = 0;
       
   146 	
       
   147     /**
       
   148     Modifies the specified MTP data object's object information record. 
       
   149     @param aObject The modified MTP data object information record values.
       
   150     */
       
   151     virtual void ModifyObjectL(const CMTPObjectMetaData& aObject) = 0;
       
   152     
       
   153     /**
       
   154     Provides either the object information record associated with the 
       
   155     associated MTP object handle, or provides an indication that the specified
       
   156     object handle does not exist. 
       
   157     @param aHandle The MTP object handle associated with the object information 
       
   158     record to be provided.
       
   159     @param aObject On exit, the object information record of the requested object. 
       
   160     @return ETrue if the specified object handle exists, otherwise EFalse.
       
   161     @leave One of the system wide error codes, if a processing failure occurs.
       
   162     */
       
   163     virtual TBool ObjectL(const TMTPTypeUint32& aHandle, CMTPObjectMetaData& aObject) const = 0;
       
   164 
       
   165     /**
       
   166     Provides the object information record associated with the associated MTP
       
   167     object SUID, or provides an indication that the specified object handle 
       
   168     does not exist. 
       
   169     @param aSuid The MTP object SUID associated with the object information 
       
   170     record to be provided.
       
   171     @param aObject On exit, the object information record of the requested object. 
       
   172     @return ETrue if the specified object handle exists, otherwise EFalse.
       
   173     @leave One of the system wide error codes, if a processing failure occurs.
       
   174     */
       
   175     virtual TBool ObjectL(const TDesC& aSuid, CMTPObjectMetaData& aObject) const = 0;
       
   176 
       
   177 
       
   178     /**
       
   179     Provides the ID of the data provider responsible for the specified MTP 
       
   180     data object.
       
   181     @param aHandle The MTP object handle.
       
   182     @return The responsible data provider ID.
       
   183     */
       
   184     virtual TUint ObjectOwnerId(const TMTPTypeUint32& aHandle) const = 0;
       
   185 	
       
   186 
       
   187 	
       
   188 	/**
       
   189 	Provides the Persistent Unique Identifier (PUID) of the object with the 
       
   190 	specified MTP object handle.
       
   191     @param aHandle The MTP object handle.
       
   192     @return The object PUID.
       
   193     @leave One of the system wide error codes, if a processing failure occurs.
       
   194 	*/
       
   195 	virtual TMTPTypeUint128 PuidL(TUint32 aHandle) const = 0;
       
   196 	
       
   197 	/**
       
   198 	Provides the Persistent Unique Identifier (PUID) of the object with the 
       
   199 	specified internal object unique ID.
       
   200     @param aObjectUid The internal object unique ID.
       
   201     @return The object PUID.
       
   202     @leave One of the system wide error codes, if a processing failure occurs.
       
   203 	*/
       
   204 	virtual TMTPTypeUint128 PuidL(TInt64 aObjectUid) const = 0;
       
   205 	
       
   206 	/**
       
   207 	Provides the Persistent Unique Identifier (PUID) of the object with the 
       
   208 	specified System Unique Identifier (SUID).
       
   209     @param aSuid The object SUID.
       
   210     @return The object PUID.
       
   211     @leave One of the system wide error codes, if a processing failure occurs.
       
   212 	*/
       
   213 	virtual TMTPTypeUint128 PuidL(const TDesC& aSuid) const = 0;
       
   214     
       
   215     /**
       
   216     Removes the object information record associated with the specified MTP 
       
   217     object handle from the MTP data object enumeration store.
       
   218     @param aHandle The MTP object handle associated with the object information 
       
   219     record to be removed.
       
   220     @leave One of the system wide error codes, if a processing failure occurs.
       
   221     */
       
   222     virtual void RemoveObjectL(const TMTPTypeUint32& aHandle) = 0;
       
   223     
       
   224     /**
       
   225     Removes the object information record associated with the specified object
       
   226     SUID from the MTP data object enumeration store.
       
   227     @param aSuid The object SUID associated with the object information 
       
   228     record to be removed.
       
   229     @leave One of the system wide error codes, if a processing failure occurs.
       
   230     */
       
   231     virtual void RemoveObjectL(const TDesC& aSuid) = 0;
       
   232 
       
   233     /**
       
   234     Removes multiple object meta data records from the MTP data object 
       
   235     enumeration store.
       
   236     @param aSuids The array of object SUIDs associated with the object 
       
   237     meta data records to be removed.
       
   238     @leave One of the system wide error codes, if a processing failure occurs.
       
   239     */
       
   240     virtual void RemoveObjectsL(const CDesCArray& aSuids) = 0;
       
   241 
       
   242     /**
       
   243     Removes from the MTP data object enumeration store all object meta data 
       
   244     records owned by the specified data provider.
       
   245     @param aDataProviderId The ID of the data provider owning the object 
       
   246     meta data records to be deleted.
       
   247     @leave One of the system wide error codes, if a processing failure occurs.
       
   248     */
       
   249     virtual void RemoveObjectsL(TUint aDataProviderId) = 0;
       
   250 	
       
   251 	/**
       
   252 	Reserves space for and assigns an object handle to the object described
       
   253 	by the specified object information record. This is typically used when
       
   254 	processing MTP SendObjectInfo or SendObjectPropList operations.
       
   255 	@param aObject The object information record of the object. On 
       
   256 	successful completion this is updated with the assigned object handle.
       
   257 	@param aSpaceRequired The storage space to be reserved for the object.
       
   258 	@leave KErrTooBig, if aSpaceRequired exceeds the available capacity of the 
       
   259 	storage. 
       
   260 	@leave KErrOverflow, if an object handle cannot be assigned.
       
   261     @leave One of the system wide error codes, if a processing failure occurs.
       
   262     @see CommitReservedObjectL
       
   263     @see UnReserveObjectHandleL
       
   264 	*/
       
   265 	virtual void ReserveObjectHandleL(CMTPObjectMetaData& aObject, TUint64 aSpaceRequired) = 0;
       
   266 	
       
   267 	/**
       
   268 	Releases the object handle and storage space previously reserved for the 
       
   269 	specified object. This is typically used when either an MTP 
       
   270 	SendObjectInfo/SendObject, or SendObjectPropList/SendObject operation 
       
   271 	sequence has not completed successfully.
       
   272 	@param aObject The MTP data object information record of the object.
       
   273     @leave One of the system wide error codes, if a processing failure occurs.
       
   274     @see ReserveObjectHandleL
       
   275 	*/
       
   276 	virtual void UnreserveObjectHandleL(const CMTPObjectMetaData& aObject) = 0;
       
   277 	/**
       
   278 	Get MtpDeltaDataMgr
       
   279 	*/
       
   280 	virtual TAny* MtpDeltaDataMgr()
       
   281 	   	{
       
   282 	   	return NULL;
       
   283 	   	};
       
   284     };
       
   285     
       
   286 #endif // MMTPOBJECTMGR_H