mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/csendobject.h
branchRCL_3
changeset 28 f56ec6ce2732
parent 14 05b0d2323768
equal deleted inserted replaced
23:4740b34b83ce 28:f56ec6ce2732
   185     * @return ETrue if yes, otherwise EFalse
   185     * @return ETrue if yes, otherwise EFalse
   186     */
   186     */
   187     TBool IsTooLarge( TUint64 aObjectSize ) const;
   187     TBool IsTooLarge( TUint64 aObjectSize ) const;
   188 
   188 
   189     /**
   189     /**
   190     * Check if we can store the file on the storage
       
   191     * @return ETrue if yes, otherwise EFalse
       
   192     */
       
   193     TBool CanStoreFileL( TUint32 aStorageId, TInt64 aObjectSize ) const;
       
   194 
       
   195     /**
       
   196     * Get the full path name of the object to be saved
   190     * Get the full path name of the object to be saved
   197     * @param aFileName, on entry, contains the file name of the object,
   191     * @param aFileName, on entry, contains the file name of the object,
   198     * on return, contains the full path name of the object to be saved
   192     * on return, contains the full path name of the object to be saved
   199     */
   193     */
   200     TBool GetFullPathNameL( const TDesC& aFileName );
   194     TBool GetFullPathNameL( const TDesC& aFileName );
   206     TBool ExistsL( const TDesC& aName ) const;
   200     TBool ExistsL( const TDesC& aName ) const;
   207 
   201 
   208     /**
   202     /**
   209     * Reserve object information before SendObject
   203     * Reserve object information before SendObject
   210     */
   204     */
   211     void ReserveObjectL();
   205     TInt ReserveObjectL();
   212 
   206 
   213     /**
   207     /**
   214     * Set protection status of object which could be read/write-only
   208     * Set protection status of object which could be read/write-only
   215     */
   209     */
   216     void SetProtectionStatus();
   210     void SetProtectionStatus();
   225     * Add file information into database in response phase of SendObject
   219     * Add file information into database in response phase of SendObject
   226     */
   220     */
   227     void AddMediaToStoreL();
   221     void AddMediaToStoreL();
   228 
   222 
   229     /**
   223     /**
   230     * delete the file, which transfer incompletely
   224     * Rollback functions
   231     */
   225     */
   232     void Rollback();
   226     void Rollback();
   233 
   227 
       
   228     void UnreserveObjectL();
       
   229     void RemoveObjectFromDbL();
       
   230     void RemoveObjectFromFs();
   234 
   231 
   235 private:
   232 private:
   236     enum TMTPSendingObjectState
   233     enum TMTPSendingObjectState
   237         {
   234         {
   238         EObjectNone,
   235         EObjectNone,
   242         ESendObjectInProgress,
   239         ESendObjectInProgress,
   243         ESendObjectSucceed,
   240         ESendObjectSucceed,
   244         ESendObjectFail
   241         ESendObjectFail
   245         };
   242         };
   246 
   243 
       
   244     typedef void ( CSendObject::*TMmMtpRollbackAction )();
       
   245 
   247 private:
   246 private:
   248     RFs& iFs;
   247     RFs& iFs;
   249     MMTPObjectMgr& iObjectMgr;
   248     MMTPObjectMgr& iObjectMgr;
   250     MMmMtpDpConfig& iDpConfig;
   249     MMmMtpDpConfig& iDpConfig;
   251 
   250 
   280     HBufC* iParentSuid;
   279     HBufC* iParentSuid;
   281 
   280 
   282     // params which is needed for reserve handle
   281     // params which is needed for reserve handle
   283     TMTPTypeRequest iExpectedSendObjectRequest;
   282     TMTPTypeRequest iExpectedSendObjectRequest;
   284 
   283 
   285     TBool iNoRollback;
   284     RArray<TMmMtpRollbackAction> iRollbackList;
   286 
   285 
   287     TUint32 iPreviousTransactionID;
   286     TUint32 iPreviousTransactionID;
   288     TUint32 iPreviousOperation;
   287     TUint32 iPreviousOperation;
   289 
   288 
   290     };
   289     };