mpxplugins/serviceplugins/collectionplugins/inc/mpxdbmanager.h
branchRCL_3
changeset 14 c54d95799c80
parent 9 13afc0e517bd
child 15 a1247965635c
equal deleted inserted replaced
13:c8156a91d13c 14:c54d95799c80
   338         /**
   338         /**
   339         * To block a diskspace so that it can gurantee for a write back from RAM disk
   339         * To block a diskspace so that it can gurantee for a write back from RAM disk
   340         *
   340         *
   341         * @return ETrue if the dummy file is created successfully, EFalse otherwise
   341         * @return ETrue if the dummy file is created successfully, EFalse otherwise
   342         */
   342         */
   343         TBool BlockDiskSpace( TDriveUnit aDrive, TInt aOrigDbSize, TBool aIsMTPInUse = EFalse );
   343         TBool BlockDiskSpace( TInt aIndex, TBool aIsMTPInUse = EFalse );
   344         
   344         
   345         /**
   345         /**
   346         * To copy db from regular drive to RAM
   346         * To copy db from regular drive to RAM
   347         *
   347         *
   348         * @return ETrue if succeed 
   348         * @return ETrue if succeed 
   349         * @leave KErrDiskFull if there is any difficulty copying files
   349         * 
   350         */
   350         * No-operation if fails
   351         TBool DoCopyDBToRamL( TDriveUnit aDrive, TBool aIsMTPInUse );
   351         */
       
   352         TBool DoCopyDBToRam( TInt aIndex, TBool aIsMTPInUse );
   352 
   353 
   353         /**
   354         /**
   354         * To copy db back regular drive from RAM
   355         * To copy db back regular drive from RAM
   355         *
   356         *
   356         */
   357         */
   357         void DoCopyDBFromRamL( TInt aIndex );
   358         void DoCopyDBFromRam( TInt aIndex );
   358     
   359     
   359         /**
   360         /**
   360         * To replace dummy file with new content
   361         * To replace dummy file with new content
   361         * Writes over previous dummy file without freeing disk space
   362         * Writes over previous dummy file without freeing disk space
   362         */
   363         */
   397         *
   398         *
   398         * @return TInt index to the database handler
   399         * @return TInt index to the database handler
   399         */
   400         */
   400         void RemoveDummyFile( TInt index );
   401         void RemoveDummyFile( TInt index );
   401 
   402 
   402         
   403         /**
   403 
       
   404 /**
       
   405         * Check if disksapce is enough to operatte. If not, it leaves with KErrDiskFull
   404         * Check if disksapce is enough to operatte. If not, it leaves with KErrDiskFull
   406         *
   405         *
   407         */
   406         */
   408         void EnsureDiskSpaceL(TInt aDrive) ;
   407         void EnsureDiskSpaceL(TInt aDrive) ;
   409         
   408         
   414         
   413         
   415         /** 
   414         /** 
   416          * Commit transaction, leaves on error
   415          * Commit transaction, leaves on error
   417          */
   416          */
   418         void DoCommitL();
   417         void DoCommitL();
       
   418 
       
   419         /**
       
   420         * Create full path and filename on a specified drive unit.
       
   421         * @param aDrive identifies the drive unit
       
   422         */
       
   423         HBufC* CreateFullFilenameL(TDriveUnit aDrive);
   419 
   424 
   420     protected:  // Types
   425     protected:  // Types
   421 
   426 
   422         typedef struct
   427         typedef struct
   423             {
   428             {
   447         * @param aCorrupt specifies whether the database is corrupted or not
   452         * @param aCorrupt specifies whether the database is corrupted or not
   448         */
   453         */
   449         void CreateTablesL(RSqlDatabase& aDatabase, TBool aCorrupt);
   454         void CreateTablesL(RSqlDatabase& aDatabase, TBool aCorrupt);
   450 
   455 
   451         /**
   456         /**
   452         * Opens a specified database.
   457         * Opens root database at C-drive.
   453         * @param aDrive identifies the drive unit of the database to open
   458         */
   454         */
   459         void OpenRootDatabaseL();
   455         void OpenDatabaseL(TDriveUnit aDrive);
       
   456 
   460 
   457         /**
   461         /**
   458         * Creates a specified database.
   462         * Creates a specified database.
   459         * @param aDrive identifies the drive unit of the database to create
   463         * @param aDrive identifies the drive unit of the database to create
   460         */
   464         */
   461         void CreateDatabaseL(TDriveUnit aDrive);
   465         void CreateDatabaseL(TDriveUnit aDrive);
   462 
   466 
   463         /**
   467         /**
   464         * Attached a specified database.
   468         * Attached a specified database.
   465         * @param aDrive identifies the drive unit of the database to attach
   469         * @param aIndex  Index to iDatabaseHandles
   466         */
   470         */
   467         void AttachDatabaseL(TDriveUnit aDrive);
   471         void AttachDatabaseL(TInt aIndex);
   468 
   472 
   469         /**
   473         /**
   470         * Detach a specified database.
   474         * Detach a specified database.
   471         * @param aDrive identifies the drive unit of the database to detach
   475         * @param aIndex  Index to iDatabaseHandles
   472         */
   476         */
   473         void DetachDatabaseL(TDriveUnit aDrive);
   477         void DetachDatabaseL(TInt aIndex);
       
   478 
       
   479         /**
       
   480         * Open database
       
   481         * @param aIndex Index to iDatabaseHandles
       
   482         */
       
   483         void OpenDatabaseAtIndexL( TInt aIndex );
       
   484         
       
   485         /**
       
   486         * Close database
       
   487         * @param aIndex Index to iDatabaseHandles
       
   488         */
       
   489         void CloseDatabaseAtIndexL(TInt aIndex);
   474 
   490 
   475         /**
   491         /**
   476         * Create filename on a specified drive unit.
   492         * Create filename on a specified drive unit.
   477         * @param aDrive identifies the drive unit
   493         * @param aDrive identifies the drive unit
   478         */
   494         */