contentstorage/castorage/inc/casqlitestorage.h
changeset 127 7b66bc3c6dc9
parent 107 b34d53f6acdf
equal deleted inserted replaced
126:efda7c0771b9 127:7b66bc3c6dc9
    64     //from CCpStorage
    64     //from CCpStorage
    65     /**
    65     /**
    66      * Loads data base from rom.
    66      * Loads data base from rom.
    67      */
    67      */
    68     void LoadDataBaseFromRomL();
    68     void LoadDataBaseFromRomL();
    69     
    69 
    70     //from CCpStorage
    70     //from CCpStorage
    71     /**
    71     /**
    72      * Saves a copy of database to private.
    72      * Saves a copy of database to private.
    73      */
    73      */
    74     void SaveDatabaseL();
    74     void SaveDatabaseL();
    75 
    75 
    76     //from CCpStorage
       
    77     /**
       
    78      * Restores a copy of database from backup to private.
       
    79      */
       
    80     void RestoreDatabaseL();
       
    81 
       
    82     /**
    76     /**
    83      * Localizes one entry attribute.
    77      * Localizes one entry attribute.
    84      *
    78      *
    85      * @param aLocalization Localization information.
    79      * @param aLocalization Localization information.
    86      */
    80      */
    90      * Adds or updates localization row in the localization table
    84      * Adds or updates localization row in the localization table
    91      *
    85      *
    92      * @param aLocalization localization information about entry.
    86      * @param aLocalization localization information about entry.
    93      */
    87      */
    94     void AddLocalizationL( const CCaLocalizationEntry& aLocalization );
    88     void AddLocalizationL( const CCaLocalizationEntry& aLocalization );
    95     
    89 
    96     /**
    90     /**
    97      * Checks if entry already exists in localization table
    91      * Checks if entry already exists in localization table
    98      *
    92      *
    99      * @param aLocalization localization information about entry.
    93      * @param aLocalization localization information about entry.
   100      */
    94      */
   104      * Updates localization row in the localization table
    98      * Updates localization row in the localization table
   105      *
    99      *
   106      * @param aLocalization localization information about entry.
   100      * @param aLocalization localization information about entry.
   107      * @param aStatement SQL statement
   101      * @param aStatement SQL statement
   108      */
   102      */
   109     void ExecuteLocalizationStatementL(const CCaLocalizationEntry& aLocalization, 
   103     void ExecuteLocalizationStatementL(const CCaLocalizationEntry& aLocalization,
   110             const TDesC& aStatement);
   104             const TDesC& aStatement);
   111    
   105 
   112     /**
   106     /**
   113      * Fetches data from database.
   107      * Fetches data from database.
   114      *
   108      *
   115      * @param aMap Filtering and sorting criteria
   109      * @param aMap Filtering and sorting criteria
   116      */
   110      */
   139      * Fetches parent id from database by entry ids.
   133      * Fetches parent id from database by entry ids.
   140      *
   134      *
   141      * @param aEntryIdArray List of enties ids.
   135      * @param aEntryIdArray List of enties ids.
   142      * @param aParentIdArray The result list of parents
   136      * @param aParentIdArray The result list of parents
   143      * ids for a specific select.
   137      * ids for a specific select.
   144      * @param aCheckParentsParent falg if set to true then 
   138      * @param aCheckParentsParent falg if set to true then
   145      * search also for parent of the parent 
   139      * search also for parent of the parent
   146      */
   140      */
   147     void GetParentsIdsL( const RArray<TInt>& aEntryIdArray,
   141     void GetParentsIdsL( const RArray<TInt>& aEntryIdArray,
   148             RArray<TInt>& aParentIdArray, 
   142             RArray<TInt>& aParentIdArray,
   149             TBool aCheckParentsParent = ETrue );
   143             TBool aCheckParentsParent = ETrue );
   150 
   144 
   151     /**
   145     /**
   152      * Adds or Updates data & action to database.
   146      * Adds or Updates data & action to database.
   153      * @param aEntry Map Containing data item.
   147      * @param aEntry Map Containing data item.
   169      */
   163      */
   170     void OrganizeL( const RArray<TInt>& aEntryIds,
   164     void OrganizeL( const RArray<TInt>& aEntryIds,
   171             TCaOperationParams aParams );
   165             TCaOperationParams aParams );
   172 
   166 
   173     /**
   167     /**
   174      * Add ifno launch to db.
   168      * Change flag used for removable entries
   175      * @param aEntryId.
   169      * @param aEntryId.
   176      * @param aRemovable.
   170      * @param aRemovable.
   177      */
   171      */
   178     void TouchL( const TInt aEntryId, TBool aRemovable );
   172     void TouchL( const TInt aEntryId, TBool aRemovable );
   179 
   173 
   220     /**
   214     /**
   221      * C++ default constructor.
   215      * C++ default constructor.
   222      */
   216      */
   223     CCaSqLiteStorage();
   217     CCaSqLiteStorage();
   224 
   218 
       
   219     void GetDownloadedApplicationsArrayL(
       
   220             RArray<TInt>& aResultArray );
       
   221 
       
   222     void GetDownloadedApplicationsArrayL(
       
   223             RPointerArray<CCaInnerEntry>& aResultArray );
       
   224 
       
   225     void SetDownloadedApplicationsArrayL(
       
   226             RPointerArray<CCaInnerEntry>& aResultArray );
       
   227 
       
   228     /**
       
   229      * Restores a copy of database from backup to private.
       
   230      */
       
   231     void RestoreDatabaseL();
       
   232 
       
   233 
       
   234     TInt GetCollectionDownloadIdL();
       
   235 
   225     TInt CreatePrivateDirPath( TFileName& aPrivatePath,
   236     TInt CreatePrivateDirPath( TFileName& aPrivatePath,
   226             const TDesC& aDrive, const TDesC& aDbName );
   237             const TDesC& aDrive, const TDesC& aDbName );
   227 
   238 
   228     void ExecuteStatementL( const TDesC& aStatement );
   239     void ExecuteStatementL( const TDesC& aStatement );
   229 
   240 
   233     void ExecuteRemoveL( const RArray<TInt>& aEntryIds );
   244     void ExecuteRemoveL( const RArray<TInt>& aEntryIds );
   234 
   245 
   235     void ExecuteRemoveFromLocalizationL( const TInt aEntryId );
   246     void ExecuteRemoveFromLocalizationL( const TInt aEntryId );
   236 
   247 
   237     void ExecuteOrganizeL( const RArray<TInt>& aEntryIds,
   248     void ExecuteOrganizeL( const RArray<TInt>& aEntryIds,
       
   249             TCaOperationParams aParams );
       
   250 
       
   251     void ExecuteOrganizeL( const RPointerArray<CCaInnerEntry> & aResultArray,
   238             TCaOperationParams aParams );
   252             TCaOperationParams aParams );
   239 
   253 
   240     void ExecuteTouchL( const TInt aEntryId, TBool aRemovable );
   254     void ExecuteTouchL( const TInt aEntryId, TBool aRemovable );
   241 
   255 
   242     void ExecuteDbPropertyL( const TDesC& aProperty, TDes& aPropertyValue );
   256     void ExecuteDbPropertyL( const TDesC& aProperty, TDes& aPropertyValue );
   246 
   260 
   247     void ExecuteCustomSortL( const RArray<TInt>& aEntryIds,
   261     void ExecuteCustomSortL( const RArray<TInt>& aEntryIds,
   248             const TInt aGroupId,
   262             const TInt aGroupId,
   249             RPointerArray<CCaSqlQuery>& aSqlQuery );
   263             RPointerArray<CCaSqlQuery>& aSqlQuery );
   250 
   264 
   251     void RemoveOldEntriesFromLaunchTableL( TInt aDays );
       
   252 
       
   253     void VerifyOrganizeParamsL( const RArray<TInt>& aEntryIds,
   265     void VerifyOrganizeParamsL( const RArray<TInt>& aEntryIds,
   254             TCaOperationParams aParams );
   266             TCaOperationParams aParams );
   255 
   267 
   256     /**
   268     /**
   257      * Sets entries in proper order
   269      * Sets entries in proper order
   281 
   293 
   282     /**
   294     /**
   283      * Private path on C-drive.
   295      * Private path on C-drive.
   284      */
   296      */
   285     TFileName iPrivatePathCDrive;
   297     TFileName iPrivatePathCDrive;
   286     
   298 
   287     /**
   299     /**
   288      * Private path on C-drive for backup db.
   300      * Private path on C-drive for backup db.
   289      */
   301      */
   290     TFileName iPrivatePathCDriveDbBackup;
   302     TFileName iPrivatePathCDriveDbBackup;
   291 
   303 
   292     /**
   304     /**
   293      * RFs session.
   305      * RFs session.
   294      */
   306      */
   295     RFs iRfs;
   307     RFs iRfs;
   296 
   308 
       
   309     /**
       
   310      * Id of downloaded collection.
       
   311      */
       
   312     TInt iCollectionDownloadId;
       
   313 
   297     };
   314     };
   298 
   315 
   299 #endif //C_CASTORAGE_ENGINE_H
   316 #endif //C_CASTORAGE_ENGINE_H