mmappcomponents/harvester/filehandler/inc/mpxharvesterdbmanager.h
changeset 27 cbb1bfb7ebfb
parent 25 d881023c13eb
child 40 4a1905d205a2
equal deleted inserted replaced
25:d881023c13eb 27:cbb1bfb7ebfb
    52     * Open All databases
    52     * Open All databases
    53     */
    53     */
    54     TInt OpenAllDatabasesL();
    54     TInt OpenAllDatabasesL();
    55 
    55 
    56     /**
    56     /**
    57     * Reopen a particular database
    57     * Open a particular database
    58     * (For MMC events)
       
    59     * @param TDriveNumber aDrive
    58     * @param TDriveNumber aDrive
    60     */
    59     */
    61     void OpenDatabaseL( TDriveNumber aDrive );
    60     void OpenDatabaseL( TDriveNumber aDrive );
    62 
    61 
    63     /**
    62     /**
    64     * Close all databases
    63     * Close all databases
    65     */
    64     */
    66     void CloseAllDatabase();
    65     void CloseAllDatabases();
       
    66     
       
    67     /**
       
    68     * Close all databases on mass storage drives
       
    69     */
       
    70     void CloseMassStorageDatabases();
    67 
    71 
    68     /**
    72     /**
    69     * Close a particular DB
    73     * Close a particular DB
    70     * (For MMC events)
       
    71     * @param TDriveNumber the Drive
    74     * @param TDriveNumber the Drive
    72     */
    75     */
    73     void CloseDatabase( TDriveNumber aDrive );
    76     void CloseDatabase( TDriveNumber aDrive );
       
    77     
    74 
    78 
    75     /**
    79     /**
    76     * Get a particular database
    80     * Get a particular database
    77     * @param TDriveNumber the Drive
    81     * @param TDriveNumber the Drive
    78     */
    82     */
    79     CMPXHarvesterDB& GetDatabaseL( TDriveNumber aDrive );
    83     CMPXHarvesterDB& GetDatabaseL( TDriveNumber aDrive );
    80 
    84 	
    81     /**
    85 	/**
    82      * Remove a particular database from the array
    86     * Abruptly close a particular DB without trying to access it
    83      * @param TDriveNumber the Drive
    87     * To be used when drive is no more accessible
    84      */
    88     * @param TDriveNumber the Drive
    85     void RemoveDatabaseL( TDriveNumber aDrive );
    89     */
       
    90     void DropDatabase( TDriveNumber aDrive );
       
    91     
       
    92     /**
       
    93      * Return whether database is open on the specified drive
       
    94      */
       
    95     TBool DatabaseIsOpen( TDriveNumber aDrive );
       
    96 
    86 
    97 
    87     /**
    98     /**
    88     * Return the number of databases
    99     * Return the number of databases
    89     * @return number of databases
   100     * @return number of databases
    90     */
   101     */
   150      */
   161      */
   151     void EnsureRamSpaceL();
   162     void EnsureRamSpaceL();
   152 #endif //__RAMDISK_PERF_ENABLE
   163 #endif //__RAMDISK_PERF_ENABLE
   153 
   164 
   154 private: // new functions
   165 private: // new functions
       
   166 	
       
   167 	 /**
       
   168 	  * Find database index in the internal table
       
   169 	  * Return KErrNotFound if not found
       
   170 	  */
       
   171    TInt FindDatabaseIndex ( TDriveNumber aDrive );
       
   172    
       
   173 	 /**
       
   174 	  * Return whether drive exists and is local
       
   175 	  */
       
   176    TBool IsLocalDrive( TDriveNumber aDrive );
       
   177 
   155     
   178     
   156 #ifdef __RAMDISK_PERF_ENABLE
   179 #ifdef __RAMDISK_PERF_ENABLE
   157     /**
   180     /**
   158     * Find available RAMDISK
   181     * Find available RAMDISK
   159     */
   182     */
   172     void DoCopyDBToRamL(TDriveUnit aDriveUnit);
   195     void DoCopyDBToRamL(TDriveUnit aDriveUnit);
   173     
   196     
   174     /**
   197     /**
   175     * Copy database from RAM disk
   198     * Copy database from RAM disk
   176     */
   199     */
   177     void DoCopyDBFromRamL(TDriveUnit aDriveUnit); 
   200     TInt DoCopyDBFromRam(TDriveUnit aDriveUnit); 
   178 
   201 
   179     /**
   202     /**
   180     * To block a disk space so that it can gurantee for a write back from RAM disk
   203     * To block a disk space so that it can gurantee for a write back from RAM disk
   181     *
   204     *
   182     * @return KErrNone if the dummy file is created successfully
   205     * @return KErrNone if the dummy file is created successfully
   191     TInt64 CalculateInitalDummyDBSizeL( TVolumeInfo aVol, TInt aOrigDbSize );
   214     TInt64 CalculateInitalDummyDBSizeL( TVolumeInfo aVol, TInt aOrigDbSize );
   192 
   215 
   193     /**
   216     /**
   194     * Remove dummy file
   217     * Remove dummy file
   195     *
   218     *
   196     * @return TInt index to the database handler
   219     * @param aDrive Drive
   197     */
   220     */
   198     void RemoveDummyFile( TInt aIndex );
   221     void RemoveDummyFile( TDriveNumber aDrive );
   199     
   222     
   200     /**
   223     /**
   201      * Update the database from ram drive.
   224      * Update the database from ram drive.
   202      */
   225      */
   203     //void DoUpdateDBFromRamL( TDriveUnit aDriveUnit );
   226     //void DoUpdateDBFromRamL( TDriveUnit aDriveUnit );