contentstorage/casrv/cawidgetscanner/inc/cawidgetstoragehandler.h
changeset 103 b99b84bcd2d1
parent 83 156f692b1687
child 109 e0aa398e6810
equal deleted inserted replaced
83:156f692b1687 103:b99b84bcd2d1
     1 /*
     1 /*
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
     2  * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3  * All rights reserved.
     4 * This component and the accompanying materials are made available
     4  * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5  * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6  * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     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  *
     8  *
    16 */
     9  * Initial Contributors:
    17 
    10  * Nokia Corporation - initial contribution.
       
    11  *
       
    12  * Contributors:
       
    13  *
       
    14  * Description:
       
    15  *
       
    16  */
    18 
    17 
    19 #ifndef C_WIDGETSTORAGEHANDLER_H
    18 #ifndef C_WIDGETSTORAGEHANDLER_H
    20 #define C_WIDGETSTORAGEHANDLER_H
    19 #define C_WIDGETSTORAGEHANDLER_H
    21 
    20 
    22 class CCaStorageProxy;
    21 class CCaStorageProxy;
    23 class CCaWidgetDescription;
    22 class CCaWidgetDescription;
       
    23 class CCaWidgetScannerParser;
    24 
    24 
    25 //  INCLUDES
    25 //  INCLUDES
    26 #include <e32base.h>
    26 #include <e32base.h>
    27 #include <usif/scr/scr.h>
    27 #include <usif/scr/scr.h>
    28 #include "cawidgetdescription.h"
    28 #include "cawidgetdescription.h"
    38  *  @since Series Series60 5.x
    38  *  @since Series Series60 5.x
    39  */
    39  */
    40 class CCaWidgetStorageHandler : public CBase
    40 class CCaWidgetStorageHandler : public CBase
    41     {
    41     {
    42 public:
    42 public:
    43     CA_STORAGE_TEST_FRIEND_CLASS    (T_CaWidgetScanner)
    43 CA_STORAGE_TEST_FRIEND_CLASS (T_CaWidgetScanner)
    44 
    44 
    45 public:
    45 public:
    46     // Constructors and destructor
    46     // Constructors and destructor
    47 
    47 
    48     /**
    48     /**
    57      * Destructor.
    57      * Destructor.
    58      */
    58      */
    59     virtual ~CCaWidgetStorageHandler();
    59     virtual ~CCaWidgetStorageHandler();
    60 
    60 
    61     /**
    61     /**
    62      * Synchronizes widgets
    62      * SynchronizeL - synchronizes widgets on device with database
    63      * @param aWidgets widgets to synchronize
       
    64      */
    63      */
    65     void SynchronizeL( const RWidgetArray& aWidgets );
    64     void SynchronizeL();
    66 
       
    67 
    65 
    68 private:
    66 private:
    69 
    67 
    70     /**
    68     /**
    71      * Adds widget to storage.
    69      * Adds widget to storage.
    74     void AddL( const CCaWidgetDescription* aWidget );
    72     void AddL( const CCaWidgetDescription* aWidget );
    75 
    73 
    76     /**
    74     /**
    77      * Updates widget in storage.
    75      * Updates widget in storage.
    78      * @param aWidget widget to be updated
    76      * @param aWidget widget to be updated
       
    77      * @param aEntryId entry of widget in db
    79      */
    78      */
    80     void UpdateL( const CCaWidgetDescription* aWidget, TUint aEntryId );
    79     void UpdateL( const CCaWidgetDescription* aWidget, TUint aEntryId );
    81 
    80 
    82     /**
    81     /**
    83      * Add/Updates widgets in DB
    82      * Add/Updates widgets in DB
    86     void AddWidgetsL( const RWidgetArray& aWidgets );
    85     void AddWidgetsL( const RWidgetArray& aWidgets );
    87 
    86 
    88     /**
    87     /**
    89      * Removes widgets from DB
    88      * Removes widgets from DB
    90      */
    89      */
    91     void RemoveWidgetsL( ) ;
    90     void RemoveWidgetsL();
    92 
    91 
    93     /**
    92     /**
    94      * Fetch widgets from content storage
    93      * Fetch widgets from content storage
    95      */
    94      */
    96     void FetchWidgetsL( );
    95     void FetchWidgetsL();
    97 
    96 
    98     /**
    97     /**
    99      * Add widget to download collection
    98      * Add widget to download collection
   100      * @param aEntry entry containing widget information
    99      * @param aEntry entry containing widget information
   101      */
   100      */
   110     /**
   109     /**
   111      * Clear missing flag for an entry.
   110      * Clear missing flag for an entry.
   112      * @param aWidget widget.
   111      * @param aWidget widget.
   113      */
   112      */
   114     void ClearVisibleFlagL( const CCaWidgetDescription* aWidget );
   113     void ClearVisibleFlagL( const CCaWidgetDescription* aWidget );
   115     
   114 
   116     /**
   115     /**
   117     * Set localizations for widget in db
   116      * Set localizations for widget in db
   118     * @param aWidget widget.
   117      * @param aWidget widget.
   119     * @param aEntryId of widget.
   118      * @param aEntryId of widget.
   120     */    
   119      */
   121     void SetLocalizationsL( const CCaWidgetDescription* aWidget,
   120     void SetLocalizationsL( const CCaWidgetDescription* aWidget, TInt aEntryId );
   122             TInt aEntryId );
       
   123 
   121 
   124 private:
   122 private:
   125 
   123 
   126     /**
   124     /**
   127      * C++ default constructor.
   125      * C++ default constructor.
   129     CCaWidgetStorageHandler( CCaStorageProxy* aStorage, RFs& aFs );
   127     CCaWidgetStorageHandler( CCaStorageProxy* aStorage, RFs& aFs );
   130 
   128 
   131     /**
   129     /**
   132      * By default Symbian 2nd phase constructor is private.
   130      * By default Symbian 2nd phase constructor is private.
   133      */
   131      */
   134     void ConstructL( );
   132     void ConstructL();
   135 
   133 
   136     /**
   134     /**
   137      * Check if mass storage is not in use.
   135      * Check if mass storage is not in use.
   138      * @return true if mass storage is not in use.
   136      * @return true if mass storage is not in use.
   139      */
   137      */
   143      * Adds or updates component id attribute in entry based on SCR provided data
   141      * Adds or updates component id attribute in entry based on SCR provided data
   144      * @param aPackageUid uid of the package which the widget represented by aEntry
   142      * @param aPackageUid uid of the package which the widget represented by aEntry
   145      * is delivered with
   143      * is delivered with
   146      * @param aEntry widget entry being updated with component id attribute.
   144      * @param aEntry widget entry being updated with component id attribute.
   147      */
   145      */
   148     void UpdateComponentIdL( const TDesC& aManifestFilePathName, 
   146     void UpdateComponentIdL( const TDesC& aManifestFilePathName,
   149         CCaInnerEntry& aEntry ) const;
   147             CCaInnerEntry& aEntry ) const;
   150 
       
   151 
   148 
   152 private:
   149 private:
   153     // Data
   150     // Data
   154 
   151 
   155     /*
   152     /*
   165     /*
   162     /*
   166      * Widgets. Own.
   163      * Widgets. Own.
   167      */
   164      */
   168     RWidgetArray iWidgets;
   165     RWidgetArray iWidgets;
   169 
   166 
   170     /*
   167     /**
   171      * Indexes updated during last add operation. Own.
   168      * Pointer to a parser object. Own
   172      */
   169      */
   173     RArray<TInt> iUpdatedIndexes;
   170     CCaWidgetScannerParser* iParser;
   174     
       
   175 
   171 
   176     Usif::RSoftwareComponentRegistry iSoftwareRegistry;
   172     Usif::RSoftwareComponentRegistry iSoftwareRegistry;
   177     };
   173     };
   178 
   174 
   179 #endif      // C_WIDGETSTORAGEHANDLER_H
   175 #endif      // C_WIDGETSTORAGEHANDLER_H