contentstorage/casrv/cawidgetscanner/inc/cawidgetstoragehandler.h
changeset 60 f62f87b200ec
child 73 4bc7b118b3df
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 
       
    19 #ifndef C_WIDGETSTORAGEHANDLER_H
       
    20 #define C_WIDGETSTORAGEHANDLER_H
       
    21 
       
    22 class CCaStorageProxy;
       
    23 class CCaWidgetDescription;
       
    24 
       
    25 //  INCLUDES
       
    26 #include <e32base.h>
       
    27 #include "cawidgetdescription.h"
       
    28 #include "castorage_global.h"
       
    29 // CONSTANTS
       
    30 
       
    31 // FORWARD DECLARATIONS
       
    32 
       
    33 /**
       
    34  *  Widget Parser
       
    35  *
       
    36  *  @since Series Series60 5.x
       
    37  */
       
    38 class CCaWidgetStorageHandler : public CBase
       
    39     {
       
    40 public:
       
    41     CA_STORAGE_TEST_FRIEND_CLASS    (T_CaWidgetScanner)
       
    42 
       
    43 public:
       
    44     // Constructors and destructor
       
    45 
       
    46     /**
       
    47      * Two-phased constructor.
       
    48      */
       
    49     static CCaWidgetStorageHandler* NewL( CCaStorageProxy* aStorage, 
       
    50             RFs& aFs );
       
    51     static CCaWidgetStorageHandler* NewLC( CCaStorageProxy* aStorage, 
       
    52             RFs& aFs );
       
    53 
       
    54     /**
       
    55      * Destructor.
       
    56      */
       
    57     virtual ~CCaWidgetStorageHandler();
       
    58  
       
    59     /**
       
    60      * Synchronizes widgets
       
    61      * @param aWidgets widgets to synchronize
       
    62      */
       
    63     void SynchronizeL( const RWidgetArray& aWidgets ); 
       
    64 
       
    65     
       
    66 private:
       
    67 
       
    68     /**
       
    69      * Adds widget to storage.
       
    70      * @param aWidget widget to be added 
       
    71      */
       
    72     void AddL( const CCaWidgetDescription* aWidget ); 
       
    73 
       
    74     /**
       
    75      * Updates widget in storage.
       
    76      * @param aWidget widget to be updated 
       
    77      */
       
    78     void UpdateL( const CCaWidgetDescription* aWidget, TUint aEntryId ); 
       
    79     
       
    80     /**
       
    81      * Add/Updates widgets in DB
       
    82      * @param aWidgets widgets to add
       
    83      */
       
    84     void AddWidgetsL( const RWidgetArray& aWidgets );
       
    85  
       
    86     /**
       
    87      * Removes widgets from DB
       
    88      */
       
    89     void RemoveWidgetsL( ) ;
       
    90     
       
    91     /**
       
    92      * Fetch widgets from content storage
       
    93      */
       
    94     void FetchWidgetsL( ); 
       
    95 
       
    96     /**
       
    97      * Add widget to download collection
       
    98      * @param aEntry entry containing widget information
       
    99      */
       
   100     void AddWidgetToDownloadCollectionL( const CCaInnerEntry* aEntry );
       
   101     
       
   102     /**
       
   103      * Sets missing flag for an entry
       
   104      * @param aWidget widget
       
   105      */
       
   106     void SetMissingFlagL( const CCaWidgetDescription * aWidget ); 
       
   107 
       
   108 private:
       
   109 
       
   110     /**
       
   111      * C++ default constructor.
       
   112      */
       
   113     CCaWidgetStorageHandler( CCaStorageProxy* aStorage, RFs& aFs );
       
   114 
       
   115     /**
       
   116      * By default Symbian 2nd phase constructor is private.
       
   117      */
       
   118     void ConstructL( );
       
   119 
       
   120 private:
       
   121     // Data    
       
   122 
       
   123     /*
       
   124      * Content Storage. Not Own
       
   125      */
       
   126     CCaStorageProxy* iStorage;
       
   127     
       
   128     /*
       
   129      * File server. Not own
       
   130      */
       
   131     RFs iFs;
       
   132     
       
   133     /*
       
   134      * Widgets. Own.
       
   135      */
       
   136     RWidgetArray iWidgets;
       
   137     
       
   138     /*
       
   139      * Indexes updated during last add operation. Own.
       
   140      */
       
   141     RArray<TInt> iUpdatedIndexes;
       
   142     
       
   143     
       
   144     };
       
   145 
       
   146 #endif      // C_WIDGETSTORAGEHANDLER_H
       
   147 // End of File