harvester/harvesterserver/inc/cblacklistdb.h
changeset 0 671dee74050a
child 7 a5fbfefd615f
equal deleted inserted replaced
-1:000000000000 0:671dee74050a
       
     1 /*
       
     2 * Copyright (c) 2010 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:  This component is to store the details of blacklisted plugins
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CBLACKLISTDB_H
       
    20 #define CBLACKLISTDB_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <f32file.h>
       
    24 #include <D32DBMS.H>
       
    25 
       
    26 class CBlacklistDb : public CBase
       
    27     {
       
    28 public :
       
    29     /*
       
    30     * Construction
       
    31     * @return instance of Blacklist database
       
    32     */
       
    33     static CBlacklistDb* NewL();
       
    34     
       
    35     /*
       
    36     * Construction
       
    37     * @return instance of Blacklist database
       
    38     */
       
    39     static CBlacklistDb* NewLC();
       
    40     //Destructor
       
    41     ~CBlacklistDb();
       
    42     
       
    43 private :
       
    44     /*
       
    45     * Default constructor
       
    46     */
       
    47     CBlacklistDb();
       
    48     
       
    49     /*
       
    50      * Second phase constructor
       
    51      */
       
    52     void ConstructL();
       
    53     
       
    54 public :
       
    55     /*
       
    56      * @description Adds the given details of a plugin to the Blacklist DB.
       
    57      * @param aPluginUid Uid of the plugin
       
    58      * @param aVersion version of the plugin
       
    59 	 * @return sysmbian error code
       
    60      * Leaves in case of errors.
       
    61      */    
       
    62     TInt  AddL( TInt32 aPluginUid , TInt aVersion );
       
    63     
       
    64     /*
       
    65     * @description Removes the given details of a plugin from the Blacklist DB.
       
    66     * @param aPluginUid Uid of the plugin
       
    67     * Leaves in case of errors.
       
    68     */ 
       
    69     void  Remove( TInt32 aPluginUid );
       
    70 	
       
    71 	/*
       
    72     * @description Updates the details of a plugin in the Blacklist DB.
       
    73     * @param aPluginUid Uid of the plugin
       
    74 	* @param aVersion version of the plugin
       
    75 	* @return sysmbian error code
       
    76     * Leaves in case of errors.
       
    77     */
       
    78 	TInt UpdateL( TInt32 aPluginUid , TInt aVersion );
       
    79     
       
    80     /*
       
    81      * @description Checks wether the plugin details are exists in the database or not.
       
    82      * If the plugin Uid is found in the database and the version number passed is higher 
       
    83      * than the version number stored in database, then this method will return EFalse.
       
    84      * Assuming always a higher version is passed if there is any change in the 
       
    85      * version number of plugin.
       
    86      * @param aPluginUid Uid of the plugin
       
    87      * @param aVersion version of the plugin
       
    88      * @return ETrue if details exists else returns EFalse
       
    89      * Leaves in case of errors.
       
    90      */	
       
    91     TBool FindWithVersionL(TInt32 aPluginUid , TInt aVersion);
       
    92 	
       
    93 	/*
       
    94     * @description Checks if the plugin uid is present in the database.
       
    95     * @param aPluginUid Uid of the plugin
       
    96     * Leaves in case of errors.
       
    97     */
       
    98 	TBool FindL(TInt32 aPluginUid);
       
    99     
       
   100 private :
       
   101     /*
       
   102     * @description Creates the Blacklist database.
       
   103     * Leaves in case of errors.
       
   104     */
       
   105     void CreateDBL();
       
   106     
       
   107 	/*
       
   108     * @description Creates Column set for database.
       
   109 	* @return CDbColSet database column set
       
   110     * Leaves in case of errors.
       
   111     */
       
   112     CDbColSet* CreateColumnSetLC();
       
   113 private:    
       
   114     /*
       
   115      * A handle to a file server session.Owned
       
   116      */
       
   117     RFs iFs;
       
   118     /*
       
   119      * Database to maintain the details of Blacklisted plugin.Owned
       
   120      */
       
   121     RDbNamedDatabase  iDatabase;
       
   122     /**
       
   123      * Flag for, whether database has been opened
       
   124      */
       
   125     TBool iOpened;
       
   126     };
       
   127 
       
   128 #endif /* CBLACKLISTDB_H */
       
   129