contentstorage/casrv/caappscanner/inc/casrvappscanner.h
changeset 104 9b022b1f357c
parent 103 b99b84bcd2d1
child 109 e0aa398e6810
equal deleted inserted replaced
103:b99b84bcd2d1 104:9b022b1f357c
    54  *   (== missing menu items whose MMC card has not been seen for long).
    54  *   (== missing menu items whose MMC card has not been seen for long).
    55  * - Observing AppArc (and MMC, etc etc) to keep the menu data up
    55  * - Observing AppArc (and MMC, etc etc) to keep the menu data up
    56  *   to date continuously.
    56  *   to date continuously.
    57  */
    57  */
    58 
    58 
    59 NONSHARABLE_CLASS( CCaSrvAppScanner ):
    59 NONSHARABLE_CLASS( CCaSrvAppScanner ) : public CActive
    60     public CActive,
       
    61     public MCaInstallListener,
       
    62     public MApaAppListServObserver
       
    63     {
    60     {
    64 
    61 
    65 public:
    62 public:
    66     // Constructor
    63     // Constructor
    67 
    64 
    76      * @param aUtils storage utils.
    73      * @param aUtils storage utils.
    77      */
    74      */
    78     static CCaSrvAppScanner* NewL( CCaStorageProxy& aCaStorageProxy,
    75     static CCaSrvAppScanner* NewL( CCaStorageProxy& aCaStorageProxy,
    79             CCaSrvEngUtils& aUtils );
    76             CCaSrvEngUtils& aUtils );
    80 
    77 
    81 public:
       
    82     // from MCaInstallListener
       
    83 
       
    84     /**
       
    85      * Handle Install Event.
       
    86      * @since S60 v5.0
       
    87      * @param aUid installed/uninstalled app uid.
       
    88      */
       
    89     void HandleInstallNotifyL( TInt aUid );
       
    90 
       
    91 private:
    78 private:
    92     // Constructors and destructor
    79     // Constructors and destructor
    93 
    80 
    94     /**
    81     /**
    95      * Constructor.
    82      * Constructor.
   103      * Second phased constructor.
    90      * Second phased constructor.
   104      */
    91      */
   105     void ConstructL();
    92     void ConstructL();
   106 
    93 
   107 private:
    94 private:
   108 
       
   109     /**
       
   110      * Notifies storage about change for aAppUid.
       
   111      * @param aAppUid application uid.
       
   112      */
       
   113     void NotifyL( TInt aAppUid );
       
   114 
       
   115     /**
       
   116      * Notifies storage about change for aPackageEntry related app.
       
   117      * @param aPackageEntry application package entry.
       
   118      */
       
   119     void NotifyL( Swi::RSisRegistryEntry& aPackageEntry );
       
   120 
       
   121 private:
       
   122     // from CActive
    95     // from CActive
   123 
    96 
   124     /**
    97     /**
   125      * Request completed, schedule engine operation.
    98      * Request completed, schedule engine operation.
   126      */
    99      */
   136      * @param aError Error code.
   109      * @param aError Error code.
   137      */
   110      */
   138     TInt RunError( TInt aError );
   111     TInt RunError( TInt aError );
   139 
   112 
   140 private:
   113 private:
   141     // from MApaAppListServObserver
       
   142 
       
   143     void HandleAppListEvent( TInt aEvent );
       
   144 
       
   145 private:
       
   146     // new methods
   114     // new methods
   147 
   115 
   148     /**
   116     /**
   149      * Gets collectionId of download collection.
   117      * Gets collectionId of download collection.
   150      * @result id of download collection.
   118      * @result id of download collection.
   151      */
   119      */
   152     TInt GetCollectionDownloadIdL();
   120     TInt GetCollectionDownloadIdL();
   153     
       
   154     //TODO temporary sollution for fake uninstall progres notification
       
   155     void ClearUninstallFlagL();
       
   156 
   121 
   157     /**
   122     /**
   158      * Gets collectionId of all collection.
   123      * Gets collectionId of all collection.
   159      * @result id of all collection.
   124      * @result id of all collection.
   160      */
   125      */
   197      * Updates application's removable and visible flags.
   162      * Updates application's removable and visible flags.
   198      * @param aItem menu item.
   163      * @param aItem menu item.
   199      * @return ETrue if flags were updated.
   164      * @return ETrue if flags were updated.
   200      */
   165      */
   201     TBool HandleRemovableVisibleFlagsUpdateL( CCaInnerEntry* aItem );
   166     TBool HandleRemovableVisibleFlagsUpdateL( CCaInnerEntry* aItem );
       
   167 
       
   168     /**
       
   169      * Removes application unninstall flag.
       
   170      * @param aItem menu item.
       
   171      * @return ETrue if flags were updated.
       
   172      */
       
   173     TBool RemoveUninstallFlagL( CCaInnerEntry* aItem );
   202 
   174 
   203     /**
   175     /**
   204      * Updates application's missing and visible flags.
   176      * Updates application's missing and visible flags.
   205      * @param aItem menu item.
   177      * @param aItem menu item.
   206      * @return ETrue if flags were updated.
   178      * @return ETrue if flags were updated.
   283     /**
   255     /**
   284      * New application is found, no menu item refers to it.
   256      * New application is found, no menu item refers to it.
   285      * Add new menu item referring to this application.
   257      * Add new menu item referring to this application.
   286      * @param aUid Application capability.
   258      * @param aUid Application capability.
   287      * @param aCurrentMmcId MMC ID of currently inserted MMC, or 0.
   259      * @param aCurrentMmcId MMC ID of currently inserted MMC, or 0.
   288      */
   260      * @return added item id
   289     void AddAppEntryL( TUint aUid, TUint aCurrentMmcId );
   261      */
   290 
   262     TInt AddAppEntryL( TUint aUid, TUint aCurrentMmcId );
   291     /**
       
   292      * Removes given uid from iInstalledPackages.
       
   293      * @param aUid Application uid.
       
   294      */
       
   295     void RemoveFromInstalledPackages( TUint aUid );
       
   296 
   263 
   297     /**
   264     /**
   298      * Set information from TApaAppInfo to entry.
   265      * Set information from TApaAppInfo to entry.
   299      * @param aEntry CCaInnerEntry with application.
   266      * @param aEntry CCaInnerEntry with application.
   300      * @return ETrue if app info was updatedd
   267      * @return ETrue if app info was updatedd
   384 
   351 
   385     /**
   352     /**
   386      * Update entry from storage.
   353      * Update entry from storage.
   387      * @param aEntry application entry.
   354      * @param aEntry application entry.
   388      * @param aMmcId unique mmc id.
   355      * @param aMmcId unique mmc id.
   389      */
   356      * @param aAlwaysUpdate item always should be updated.
   390     void UpdateAppEntryL( CCaInnerEntry* aEntry, TUint aMmcId );
   357      */
       
   358     void UpdateAppEntryL( CCaInnerEntry* aEntry,
       
   359             TUint aMmcId,
       
   360             TBool aAlwaysUpdate = EFalse );
   391 
   361 
   392     /**
   362     /**
   393      * Get all applications from storage and visible from apparc
   363      * Get all applications from storage and visible from apparc
   394      * and update if necessary.
   364      * and update if necessary.
   395      */
   365      */
   396     void UpdateApplicationEntriesL();
   366     void UpdateApplicationEntriesL();
   397 
   367 
   398     /**
   368     /**
   399      * Notifys storage about updated apps.
       
   400      */
       
   401     void InstallationNotifyL();
       
   402 
       
   403     /**
       
   404      * Make not empty collections with not hidden apps visible.
   369      * Make not empty collections with not hidden apps visible.
   405      */
   370      */
   406     void MakeNotEmptyCollectionsVisibleL();
   371     void MakeNotEmptyCollectionsVisibleL();
   407 
   372 
   408     /**
   373     /**
   409      * Make collection visible if has visible entry.
   374      * Make collection visible if has visible entry.
   410      * @param aEntry application entry.
   375      * @param aEntry application entry.
   411      */
   376      */
   412     void MakeCollectionVisibleIfHasVisibleEntryL( CCaInnerEntry* aEntry );
   377     void MakeCollectionVisibleIfHasVisibleEntryL( CCaInnerEntry* aEntry );
   413     
   378 
   414     /**
   379     /**
   415      * Adds or updates component id attribute in entry based on SCR provided data
   380      * Adds or updates component id attribute in entry based on SCR provided data
   416      * @param aEntry entry being updated with component id attribute.
   381      * @param aEntry entry being updated with component id attribute.
   417      * @return ETrue when component id attribute of the entry has been added or changed.
   382      * @return ETrue when component id attribute of the entry has been added or changed.
   418      */
   383      */
   419     TBool UpdateComponentIdL( CCaInnerEntry& aEntry ) const;
   384     TBool UpdateComponentIdL( CCaInnerEntry& aEntry ) const;
   420 
   385 
   421     /**
       
   422      * Schedule appscanner run.
       
   423      * Self complete active object.
       
   424      */
       
   425     void ScheduleScan();
       
   426 
       
   427 private:
   386 private:
   428     // data
   387     // data
   429 
   388 
   430     RApaLsSession iApaLsSession; ///< AppArc session. Own.
   389     RApaLsSession iApaLsSession; ///< AppArc session. Own.
   431     CApaAppListNotifier* iNotifier; ///< Change notifier. Own.
       
   432     CCaInstallNotifier* iInstallNotifier; ///< Install notifier. Own.
       
   433     CCaSrvMmcHistory* iMmcHistory; ///< MMC history. Own.
   390     CCaSrvMmcHistory* iMmcHistory; ///< MMC history. Own.
   434     RFs iFs; ///< File Server Session. Own.
   391     RFs iFs; ///< File Server Session. Own.
   435     Usif::RSoftwareComponentRegistry iSoftwareRegistry;
   392     Usif::RSoftwareComponentRegistry iSoftwareRegistry;
   436 
   393 
   437     CCaStorageProxy& iCaStorageProxy; ///< Not own
   394     CCaStorageProxy& iCaStorageProxy; ///< Not own
   438     CCaSrvEngUtils& iSrvEngUtils; ///< Not own
   395     CCaSrvEngUtils& iSrvEngUtils; ///< Not own
   439     RArray<TInt> iInstalledPackages; ///< Own.
       
   440 
   396 
   441     TInt iCollectionDownloadId;
   397     TInt iCollectionDownloadId;
   442     TInt iAllCollectionId;
   398     TInt iAllCollectionId;
       
   399 
   443 CA_STORAGE_TEST_FRIEND_CLASS    (T_casrvAppScaner)
   400 CA_STORAGE_TEST_FRIEND_CLASS    (T_casrvAppScaner)
   444 
   401 
   445     };
   402     };
   446 
   403 
   447 #endif /* CASRVAPPSCANNER_H_ */
   404 #endif /* CASRVAPPSCANNER_H_ */