mtpfws/mtpfw/inc/cmtpobjectmgr.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  @internalComponent
       
    19 */
       
    20 
       
    21 #ifndef CMTPOBJECTMGR_H
       
    22 #define CMTPOBJECTMGR_H
       
    23 
       
    24 #include <e32base.h>
       
    25 #include <mtp/mmtpobjectmgr.h>
       
    26 
       
    27 #include "mtpdebug.h"
       
    28 
       
    29 #include "cmtpobjectstore.h"
       
    30 
       
    31 class CMTPObjectStore;
       
    32 class RFs;
       
    33 class TMTPTypeUint32;
       
    34 class CMTPPuidMgr;
       
    35 class CMTPReferenceMgr;
       
    36 
       
    37 /** 
       
    38 Implements the MTP object manager interface.
       
    39 @internalComponent
       
    40  
       
    41 */
       
    42 class CMTPObjectMgr : 
       
    43     public CBase, 
       
    44     public MMTPObjectMgr
       
    45     {
       
    46 public:   
       
    47  
       
    48     static CMTPObjectMgr* NewL();
       
    49     ~CMTPObjectMgr();
       
    50 
       
    51 public:
       
    52 
       
    53     CMTPObjectStore& ObjectStore();
       
    54     void RestorePersistentObjectsL(TUint aDataProviderId);
       
    55     IMPORT_C void RemoveObjectsByStorageIdL(TUint32 aStorageId);
       
    56     void RemoveNonPersistentObjectsL(TUint aDataProviderId);
       
    57     void MarkNonPersistentObjectsL(TUint aDataProviderId ,TUint32 aStorageId);
       
    58     void MarkDPLoadedL(TUint aDataProviderId, TBool aFalg);
       
    59    
       
    60     void InsertPkgIDObjectL(TUint aDpId, TUint aPkgId);
       
    61        
       
    62     
       
    63 public: // From MMTPObjectMgr
       
    64 
       
    65     TUint CountL(const TMTPObjectMgrQueryParams& aParams) const;
       
    66 	void CommitReservedObjectHandleL(CMTPObjectMetaData& aObject);
       
    67     void GetObjectHandlesL(const TMTPObjectMgrQueryParams& aParams, RMTPObjectMgrQueryContext& aContext, RArray<TUint>& aHandles) const;
       
    68     void GetObjectSuidsL(const TMTPObjectMgrQueryParams& aParams, RMTPObjectMgrQueryContext& aContext, CDesCArray& aSuids) const;
       
    69 	TUint32 HandleL(const TDesC& aSuid) const;
       
    70     void InsertObjectL(CMTPObjectMetaData& aObject);
       
    71     void InsertDPIDObjectL(TUint aDpId, TUint aUid);
       
    72     void InsertObjectsL(RPointerArray<CMTPObjectMetaData>& aObjects);
       
    73     void ModifyObjectL(const CMTPObjectMetaData& aObject);
       
    74     TBool ObjectL(const TMTPTypeUint32& aHandle, CMTPObjectMetaData& aObject) const;
       
    75     TBool ObjectL(const TDesC& aSuid, CMTPObjectMetaData& aObject) const;
       
    76     TUint ObjectOwnerId(const TMTPTypeUint32& aHandle) const;
       
    77     TUint DPIDL(const TUint aUid, TBool& aFlag) const;    
       
    78 	TMTPTypeUint128 PuidL(TUint32 aHandle) const;
       
    79 	TMTPTypeUint128 PuidL(TInt64 aObjectUid) const;
       
    80 	TMTPTypeUint128 PuidL(const TDesC& aSuid) const;
       
    81     void RemoveObjectL(const TMTPTypeUint32& aHandle);
       
    82     void RemoveObjectL(const TDesC& aSuid);
       
    83     void RemoveObjectsL(const CDesCArray& aSuids);
       
    84     void RemoveObjectsL(TUint aDataProviderId);
       
    85 	void ReserveObjectHandleL(CMTPObjectMetaData& aObject, TUint64 aSpaceRequired);
       
    86 	void UnreserveObjectHandleL(const CMTPObjectMetaData& aObject);
       
    87 
       
    88     TAny* MtpDeltaDataMgr();
       
    89     
       
    90 private:
       
    91     
       
    92     CMTPObjectMgr();
       
    93     void ConstructL();
       
    94     
       
    95 private: // Owned
       
    96 
       
    97     /**
       
    98     FLOGGER debug trace member variable.
       
    99     */
       
   100     __FLOG_DECLARATION_MEMBER_MUTABLE;
       
   101 
       
   102     /**
       
   103     The object meta data store.
       
   104     */
       
   105     CMTPObjectStore*    iObjectStore;
       
   106     };
       
   107     
       
   108 #endif // CMTPOBJECTMGR_H