contentstorage/castorage/inc/casqlitestorage.h
changeset 86 e492551a0d54
parent 85 7feec50967db
child 88 7f0462e8c3da
equal deleted inserted replaced
85:7feec50967db 86:e492551a0d54
    16  */
    16  */
    17 
    17 
    18 #ifndef C_CASTORAGE_ENGINE_H
    18 #ifndef C_CASTORAGE_ENGINE_H
    19 #define C_CASTORAGE_ENGINE_H
    19 #define C_CASTORAGE_ENGINE_H
    20 
    20 
       
    21 #include <BAUTILS.H>
    21 #include <e32cons.h>
    22 #include <e32cons.h>
    22 #include <sqldb.h>
    23 #include <sqldb.h>
    23 #include "castorage.h"
    24 #include "castorage.h"
    24 #include "castorage_global.h"
    25 #include "castorage_global.h"
    25 CA_STORAGE_TEST_CLASS(CCAStorageTest)
    26 CA_STORAGE_TEST_CLASS(CCAStorageTest)
    59      * Destructor.
    60      * Destructor.
    60      */
    61      */
    61     ~CCaSqLiteStorage();
    62     ~CCaSqLiteStorage();
    62 
    63 
    63     //from CCpStorage
    64     //from CCpStorage
       
    65     /**
       
    66      * Loads data base from rom.
       
    67      */
       
    68     void LoadDataBaseFromRomL();
    64 
    69 
    65     /**
    70     /**
    66      * Localizes one entry attribute.
    71      * Localizes one entry attribute.
    67      *
    72      *
    68      * @param aLocalization Localization information.
    73      * @param aLocalization Localization information.
    72     /**
    77     /**
    73      * Fetches data from database.
    78      * Fetches data from database.
    74      *
    79      *
    75      * @param aMap Filtering and sorting criteria
    80      * @param aMap Filtering and sorting criteria
    76      */
    81      */
    77     void GetLocalizationsL( RPointerArray<CCaLocalizationEntry>& aResultContainer );
    82     void GetLocalizationsL(
       
    83             RPointerArray<CCaLocalizationEntry>& aResultContainer );
    78 
    84 
    79     /**
    85     /**
    80      * Fetches data from database.
    86      * Fetches data from database.
    81      *
    87      *
    82      * @param aQuery .
    88      * @param aQuery .
    83      * @param aResultContainer Target for results.
    89      * @param aResultContainer Target for results.
    84      */
    90      */
    85     void GetEntriesL( const CCaInnerQuery* aQuery, 
    91     void GetEntriesL( const CCaInnerQuery* aQuery,
    86             RPointerArray<CCaInnerEntry>& aResultContainer );
    92             RPointerArray<CCaInnerEntry>& aResultContainer );
    87 
    93 
    88     /**
    94     /**
    89      * Fetches entry ids from database.
    95      * Fetches entry ids from database.
    90      *
    96      *
   129     /**
   135     /**
   130      * Add ifno launch to db.
   136      * Add ifno launch to db.
   131      * @param aEntryId.
   137      * @param aEntryId.
   132      */
   138      */
   133     void TouchL( const TInt aEntryId );
   139     void TouchL( const TInt aEntryId );
   134     
   140 
   135     /**
   141     /**
   136      * Get database property from db.
   142      * Get database property from db.
   137      *
   143      *
   138      * @param aProperty The property to get.
   144      * @param aProperty The property to get.
   139      * @param aPropertyValue The value of property.
   145      * @param aPropertyValue The value of property.
   140      */
   146      */
   141     void DbPropertyL( const TDesC& aProperty, TDes& aPropertyValue );
   147     void DbPropertyL( const TDesC& aProperty, TDes& aPropertyValue );
   142     
   148 
   143     /**
   149     /**
   144      * Set property .
   150      * Set property .
   145      *
   151      *
   146      * @param aProperty The property to set.
   152      * @param aProperty The property to set.
   147      * @param aPropertyValue The value of property.
   153      * @param aPropertyValue The value of property.
   148      */
   154      */
   149     void SetDBPropertyL( const TDesC& aProperty, const TDesC& aPropertyValue );
   155     void SetDBPropertyL( const TDesC& aProperty,
       
   156         const TDesC& aPropertyValue );
   150 
   157 
   151     /**
   158     /**
   152      * Remove from localization table .
   159      * Remove from localization table .
   153      *
   160      *
   154      * @param aEntryId Entry Id to remove.
   161      * @param aEntryId Entry Id to remove.
   155      */
   162      */
   156     void RemoveFromLocalizationL( const TInt aEntryId );
   163     void RemoveFromLocalizationL( const TInt aEntryId );
   157     
   164 
   158     /**
   165     /**
   159      * Organizes data within a group in custom order.
   166      * Organizes data within a group in custom order.
   160      *
   167      *
   161      * @param aEntryIds Ids of entries in custom order.
   168      * @param aEntryIds Ids of entries in custom order.
   162      * @param aGroupId Group to sort.
   169      * @param aGroupId Group to sort.
   164     void CustomSortL( const RArray<TInt>& aEntryIds, const TInt aGroupId );
   171     void CustomSortL( const RArray<TInt>& aEntryIds, const TInt aGroupId );
   165 
   172 
   166 private:
   173 private:
   167 
   174 
   168     /**
   175     /**
   169      * Perform the second phase construction of a CCpStorageEngine 
   176      * Perform the second phase construction of a CCpStorageEngine
   170      * object.
   177      * object.
   171      */
   178      */
   172     void ConstructL();
   179     void ConstructL();
   173 
   180 
   174     /**
   181     /**
   175      * C++ default constructor.
   182      * C++ default constructor.
   176      */
   183      */
   177     CCaSqLiteStorage();
   184     CCaSqLiteStorage();
   178 
   185 
   179     TInt CreatePrivateDirPath( TFileName& aPrivatePath,
   186     TInt CreatePrivateDirPath( TFileName& aPrivatePath,
   180         const TDesC& aDrive, const TDesC& aDbName, RFs& aFsSession );
   187             const TDesC& aDrive, const TDesC& aDbName );
   181         
   188 
   182     void ExecuteStatementL( const TDesC& aStatement );
   189     void ExecuteStatementL( const TDesC& aStatement );
   183     
   190 
   184     void ExecuteAddL( CCaInnerEntry* aEntry,
   191     void ExecuteAddL( CCaInnerEntry* aEntry,
   185             RPointerArray<CCaSqlQuery>& sqlQuery );
   192             RPointerArray<CCaSqlQuery>& sqlQuery );
   186             
   193 
   187     void ExecuteRemoveL( const RArray<TInt>& aEntryIds );
   194     void ExecuteRemoveL( const RArray<TInt>& aEntryIds );
   188     
   195 
   189     void ExecuteRemoveFromLocalizationL( const TInt aEntryId );
   196     void ExecuteRemoveFromLocalizationL( const TInt aEntryId );
   190     
   197 
   191     void ExecuteOrganizeL( const RArray<TInt>& aEntryIds,
   198     void ExecuteOrganizeL( const RArray<TInt>& aEntryIds,
   192             TCaOperationParams aParams );
   199             TCaOperationParams aParams );
   193             
   200 
   194     void ExecuteTouchL( const TInt aEntryId );
   201     void ExecuteTouchL( const TInt aEntryId );
   195     
   202 
   196     void ExecuteDbPropertyL( const TDesC& aProperty, TDes& aPropertyValue );
   203     void ExecuteDbPropertyL( const TDesC& aProperty, TDes& aPropertyValue );
   197     
   204 
   198     void ExecuteSetDbPropertyL( const TDesC& aProperty, const TDesC& aPropertyValue );
   205     void ExecuteSetDbPropertyL( const TDesC& aProperty,
   199     
   206             const TDesC& aPropertyValue );
   200     void ExecuteCustomSortL( const RArray<TInt>& aEntryIds, const TInt aGroupId,
   207 
       
   208     void ExecuteCustomSortL( const RArray<TInt>& aEntryIds,
       
   209             const TInt aGroupId,
   201             RPointerArray<CCaSqlQuery>& aSqlQuery );
   210             RPointerArray<CCaSqlQuery>& aSqlQuery );
   202     
   211 
   203     void RemoveOldEntriesFromLaunchTableL( TInt aDays );
   212     void RemoveOldEntriesFromLaunchTableL( TInt aDays );
   204     
   213 
   205     void VerifyOrganizeParamsL( const RArray<TInt>& aEntryIds,
   214     void VerifyOrganizeParamsL( const RArray<TInt>& aEntryIds,
   206             TCaOperationParams aParams );
   215             TCaOperationParams aParams );
   207 
   216 
   208     /**
   217     /**
   209      * Sets entries in proper order
   218      * Sets entries in proper order
   219      * Database.
   228      * Database.
   220      * Own.
   229      * Own.
   221      */
   230      */
   222     RSqlDatabase iSqlDb;
   231     RSqlDatabase iSqlDb;
   223 
   232 
       
   233     /**
       
   234      * Path to data base in private path on C-drive.
       
   235      */
       
   236     TFileName iPrivatePathCDriveDb;
       
   237 
       
   238     /**
       
   239      * Path to data base in private path on Z-drive.
       
   240      */
       
   241     TFileName iPrivatePathZDriveDb;
       
   242 
       
   243     /**
       
   244      * Private path on C-drive.
       
   245      */
       
   246     TFileName iPrivatePathCDrive;
       
   247 
       
   248     /**
       
   249      * RFs session.
       
   250      */
       
   251     RFs iRfs;
       
   252 
   224     };
   253     };
   225 
   254 
   226 #endif //C_CASTORAGE_ENGINE_H
   255 #endif //C_CASTORAGE_ENGINE_H