contentstorage/castorage/inc/castorage.h
changeset 60 f62f87b200ec
child 80 397d00875918
equal deleted inserted replaced
4:1a2a00e78665 60:f62f87b200ec
       
     1 /*
       
     2  * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
       
     3  * All rights reserved.
       
     4  * This component and the accompanying materials are made available
       
     5  * under the terms of "Eclipse Public License v1.0"
       
     6  * which accompanies this distribution, and is available
       
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8  *
       
     9  * Initial Contributors:
       
    10  * Nokia Corporation - initial contribution.
       
    11  *
       
    12  * Contributors:
       
    13  *
       
    14  * Description:
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef C_CASTORAGE_H
       
    19 #define C_CASTORAGE_H
       
    20 
       
    21 #include "caoperationparams.h"
       
    22 
       
    23 // FORWARD DECLARATIONS
       
    24 class CCaInnerQuery;
       
    25 class CCaInnerEntry;
       
    26 class CCaLocalizationEntry;
       
    27 /**
       
    28  *  @ingroup group_catorage.
       
    29  *  Interface for storage.
       
    30  */
       
    31 class CCaStorage: public CBase
       
    32     {
       
    33 public:
       
    34 
       
    35     /**
       
    36      * Localizes one entry attribute.
       
    37      *
       
    38      * @param aLocalization localization information about entry.
       
    39      */
       
    40     virtual void LocalizeEntryL( CCaLocalizationEntry& aLocalization ) = 0;
       
    41 
       
    42     /**
       
    43      * Fetches data from database
       
    44      *
       
    45      * @param aResultContainer container for localizations information.
       
    46      */
       
    47     virtual void GetLocalizationsL( RPointerArray<CCaLocalizationEntry>& aResultContainer ) = 0;
       
    48 
       
    49     /**
       
    50      * Fetches data from database.
       
    51      *
       
    52      * @param aQuery The query information to select specific entries.
       
    53      * @param aResultContainer The result list of entries .
       
    54      * for a specific select.
       
    55      */
       
    56     virtual void GetEntriesL( const CCaInnerQuery* aQuery,
       
    57             RPointerArray<CCaInnerEntry>& aResultContainer ) = 0;
       
    58 
       
    59     /**
       
    60      * Fetches data from database by ids.
       
    61      *
       
    62      * @param aQuery The query information to select specific entries.
       
    63      * @param aResultIdArray The result list of entries' ids.
       
    64      * for a specific select.
       
    65      */
       
    66     virtual void GetEntriesIdsL( const CCaInnerQuery* aQuery,
       
    67             RArray<TInt>& aResultIdArray ) = 0;
       
    68 
       
    69     /**
       
    70      * Fetches parent id from database by entry ids.
       
    71      *
       
    72      * @param aEntryIdArray list of enties ids.
       
    73      * @param aParentIdArray The result list of parents' ids
       
    74      * for a specific select.
       
    75      */
       
    76     virtual void GetParentsIdsL( const RArray<TInt>& aEntryIdArray,
       
    77             RArray<TInt>& aParentIdArray ) = 0;
       
    78 
       
    79     /**
       
    80      * Adds or Updates data & action to the storage.
       
    81      *
       
    82      * @param aEntry The entry data to be added or updated.
       
    83      */
       
    84     virtual void AddL( CCaInnerEntry* aEntry, TBool aUpdate = EFalse ) = 0;
       
    85 
       
    86     /**
       
    87      * Removes data item from storage.
       
    88      *
       
    89      * @param aEntryIds The entry ids to be removed.
       
    90      */
       
    91     virtual void RemoveL( const RArray<TInt>& aEntryIds ) = 0;
       
    92 
       
    93     /**
       
    94      * Organizes data within a group in the storage.
       
    95      *
       
    96      * @param aEntryIds Ids of entries to organize.
       
    97      * @param aParams Operation parameters to specify the organize type.
       
    98      */
       
    99     virtual void OrganizeL( const RArray<TInt>& aEntryIds,
       
   100             TCaOperationParams aParams ) = 0;
       
   101 
       
   102     /**
       
   103      * Stores touch data information in storage.
       
   104      *
       
   105      * @param aEntryId The entry id for which touch data should be stored.
       
   106      */
       
   107     virtual void TouchL( const TInt aEntryId ) = 0;
       
   108 
       
   109     /**
       
   110      * Get database property from db.
       
   111      *
       
   112      * @param aProperty The property to get.
       
   113      * @param aPropertyValue The value of property.
       
   114      */
       
   115     virtual void DbPropertyL( const TDesC& aProperty, TDes& aPropertyValue ) = 0;
       
   116 
       
   117     /**
       
   118      * Set property .
       
   119      *
       
   120      * @param aProperty The property to set.
       
   121      * @param aPropertyValue The value of property.
       
   122      */
       
   123     virtual void SetDBPropertyL( const TDesC& aProperty, const TDesC& aPropertyValue ) = 0;
       
   124 
       
   125     /**
       
   126      * Remove from localization table .
       
   127      *
       
   128      * @param aEntryId Entry Id to remove.
       
   129      */
       
   130     virtual void RemoveFromLocalizationL( const TInt aEntryId ) = 0;
       
   131 
       
   132     /**
       
   133      * Organizes data within a group in custom order.
       
   134      *
       
   135      * @param aEntryIds Ids of entries in custom order.
       
   136      * @param aGroupId Group to sort.
       
   137      */
       
   138     virtual void CustomSortL( const RArray<TInt>& aEntryIds,
       
   139             const TInt aGroupId ) = 0;
       
   140 
       
   141     /**
       
   142      * Loads data base from rom.
       
   143      */
       
   144     virtual void LoadDataBaseFromRomL() = 0;
       
   145 
       
   146     };
       
   147 
       
   148 #endif //C_CASTORAGE_H