menucontentsrv/srvinc/menusrvappscanner.h
branchRCL_3
changeset 78 1b207dd38b72
parent 0 79c6a41cd166
child 82 ace62b58f4b2
equal deleted inserted replaced
74:edd621764147 78:1b207dd38b72
    31 #include <driveinfo.h>
    31 #include <driveinfo.h>
    32 
    32 
    33 // FORWARD DECLARATION
    33 // FORWARD DECLARATION
    34 
    34 
    35 class CMenuEng;
    35 class CMenuEng;
    36 class TAppAtributes;
    36 class CMenuSrvAppAttributes;
    37 class CMenuSrvMmcHistory;
    37 class CMenuSrvMmcHistory;
    38 class CRepository;
    38 class CRepository;
    39 class CCenRepNotifyHandler;
    39 class CCenRepNotifyHandler;
    40 class RWidgetRegistryClientSession;
    40 class CMenuSrvEngUtils;
    41 
    41 
    42 /**
    42 /**
    43 * Application scanner.
    43 * Application scanner.
    44 * Using AppArc application information, keeps menu application
    44 * Using AppArc application information, keeps menu application
    45 * items ("menu:application") up-to-date.
    45 * items ("menu:application") up-to-date.
    76 
    76 
    77     /**
    77     /**
    78     * Two-phased constructor.
    78     * Two-phased constructor.
    79     * @param aEng Engine.
    79     * @param aEng Engine.
    80     */
    80     */
    81     static CMenuSrvAppScanner* NewL( CMenuEng& aEng );
    81     static CMenuSrvAppScanner* NewL(
    82 
    82             CMenuEng& aEng,
       
    83             CMenuSrvEngUtils& aSrvEngUtils );
    83 
    84 
    84 private:    // Constructors and destructor
    85 private:    // Constructors and destructor
    85 
    86 
    86     /**
    87     /**
    87     * Constructor.
    88     * Constructor.
    88     * @param aEng Engine.
    89     * @param aEng Engine.
    89     */
    90     */
    90     CMenuSrvAppScanner( CMenuEng& aEng );
    91     CMenuSrvAppScanner( CMenuEng& aEng, CMenuSrvEngUtils& aSrvEngUtils );
    91 
    92 
    92     /**
    93     /**
    93     * Second phased constructor.
    94     * Second phased constructor.
    94     */
    95     */
    95     void ConstructL();
    96     void ConstructL();
   164 
   165 
   165 private:    // new methods
   166 private:    // new methods
   166 
   167 
   167     /**
   168     /**
   168     */
   169     */
   169     void HandleLockDeleteFlagUpdateL( const TMenuItem& aItem,TInt aUid );
   170     void HandleLockDeleteFlagUpdateL(
       
   171             const TMenuItem& aItem, const CMenuSrvAppAttributes& aApaItem );
   170 
   172 
   171     /**
   173     /**
   172     * Updates application's missing attribute.
   174     * Updates application's missing attribute.
   173     * Add new menu item referring to this application.
   175     * Add new menu item referring to this application.
   174     * @param aItem menu item.
   176     * @param aItem menu item.
   180     * @param aItem menu item.
   182     * @param aItem menu item.
   181     * @param aUid Application's uid.
   183     * @param aUid Application's uid.
   182     * @param aApaItemHidden Application's hidden status from ApaLsSession.
   184     * @param aApaItemHidden Application's hidden status from ApaLsSession.
   183     */
   185     */
   184     void HandleHiddenFlagUpdateL(
   186     void HandleHiddenFlagUpdateL(
   185     		const TMenuItem & aItem,
   187             const TMenuItem & aItem,
   186     		TInt & aAppUid,
   188             const CMenuSrvAppAttributes& aApaItem );
   187     		TBool aApaItemHidden );
       
   188     /**
   189     /**
   189     * Updates native attribute.
   190     * Updates native attribute.
   190     * @param aItem menu item.
   191     * @param aItem menu item.
   191     * @param aUid Application's uid.
   192     * @param aUid Application's uid.
   192     */
   193     */
   193     void HandleNativeAttrUpdateL(
   194     void HandleNativeAttrUpdateL(
   194     		const TMenuItem& aItem,
   195             const TMenuItem& aItem,
   195     		TInt aUid );
   196             const CMenuSrvAppAttributes& aApaItem );
   196 
   197 
   197     /**
   198     /**
   198     * Updates mmc attribute.
   199     * Updates mmc attribute.
   199     * @param aItem menu item.
   200     * @param aItem menu item.
   200     * @param aUid Application's uid.
   201     * @param aUid Application's uid.
   201     * @param aMmcId MMC ID of currently inserted MMC, or 0.
   202     * @param aMmcId MMC ID of currently inserted MMC, or 0.
   202     */
   203     */
   203     void HandleMmcAttrUpdateL(
   204     void HandleMmcAttrUpdateL(
   204     		const TMenuItem& aItem,
   205             const TMenuItem& aItem,
   205     		TInt aUid,
   206             const CMenuSrvAppAttributes& aApaItem,
   206     		TUint aMmcId );
   207             TUint aMmcId );
   207 
   208 
   208 
   209     /**
   209     /**
   210     */
   210     */
   211     void GetCrItemsL( RPointerArray<CMenuSrvAppAttributes>& aArray );
   211     TBool IsInRomL( TInt aUid );
       
   212 
       
   213     /**
       
   214     */
       
   215     void GetCrItemsL( RArray<TAppAtributes>& aArray );
       
   216 
   212 
   217 
   213 
   218     /**
   214     /**
   219     */
   215     */
   220     void ParseUidsL( const TDesC& aHiddenApplications,
   216     void ParseUidsL( const TDesC& aHiddenApplications,
   221                                         RArray<TAppAtributes>& aArray );
   217                                         RPointerArray<CMenuSrvAppAttributes>& aArray );
   222     /**
       
   223     */
       
   224     void GetApaItemsL( RArray<TAppAtributes>& aArray );
       
   225 
   218 
   226     /**
   219     /**
   227     */
   220     */
   228     void SetHidden( const TDesC& aHiddenAppUid,
   221     void SetHidden( const TDesC& aHiddenAppUid,
   229                                 RArray<TAppAtributes>& aArray );
   222                                 RPointerArray<CMenuSrvAppAttributes>& aArray );
   230 
   223 
   231     /**
   224     /**
   232     */
   225     */
   233     void GetMcsAppItemsL( RArray<TMenuItem>& aArray);
   226     void GetMcsAppItemsL( RArray<TMenuItem>& aArray);
   234 
   227 
   243     * Add new menu item referring to this application.
   236     * Add new menu item referring to this application.
   244     * @param aUid Application capability.
   237     * @param aUid Application capability.
   245     * @param aCurrentMmcId MMC ID of currently inserted MMC, or 0.
   238     * @param aCurrentMmcId MMC ID of currently inserted MMC, or 0.
   246     */
   239     */
   247     void AddAppItemL(
   240     void AddAppItemL(
   248         TUint aUid,
   241             const CMenuSrvAppAttributes& aApaItem,
   249         TUint aCurrentMmcId );
   242             TUint aCurrentMmcId );
   250 
   243 
   251     TInt CreateInstallFolderL( TUint aUid );
   244     TInt CreateInstallFolderL( const CMenuSrvAppAttributes& aApaItem );
   252 
       
   253     /**
       
   254     * @param aAppUid application UID
       
   255     * @return TBool
       
   256     */
       
   257     TBool IsMidlet( const TUid aAppUid );
       
   258 
   245 
   259 
   246 
   260     /**
   247     /**
   261     * Find menu folder which has the specified "applicationgroup_name"
   248     * Find menu folder which has the specified "applicationgroup_name"
   262     * attribute. If no such folder exists, create.
   249     * attribute. If no such folder exists, create.
   293     * @param aItem menu item.
   280     * @param aItem menu item.
   294     * @param aFlag menu item's flag.
   281     * @param aFlag menu item's flag.
   295     * @param aEvent menu item's event for engine.
   282     * @param aEvent menu item's event for engine.
   296     */
   283     */
   297     void SetObjectFlagsL(
   284     void SetObjectFlagsL(
   298     		TBool aFlagValue,
   285             TBool aFlagValue,
   299     		const TMenuItem& aItem,
   286             const TMenuItem& aItem,
   300     		const TMenuItem::TFlags& aFlag,
   287             const TMenuItem::TFlags& aFlag,
   301     		const RMenuNotifier::TEvent& aEvent = RMenuNotifier::EItemAttributeChanged );
   288             const RMenuNotifier::TEvent& aEvent = RMenuNotifier::EItemAttributeChanged );
   302 
   289 
   303     /**
   290     /**
   304     * Check currently inserted MMC card, update and save MMC history.
   291     * Check currently inserted MMC card, update and save MMC history.
   305     * @return Current MMC id, or 0 if no MMC is inserted.
   292     * @return Current MMC id, or 0 if no MMC is inserted.
   306     */
   293     */
   316     * Check if file is on given default drive type.
   303     * Check if file is on given default drive type.
   317     * @param aFileName File name.
   304     * @param aFileName File name.
   318     * @return ETrue if aFileName is on given default drive type.
   305     * @return ETrue if aFileName is on given default drive type.
   319     */
   306     */
   320     TBool IsFileInDrive(
   307     TBool IsFileInDrive(
   321 			const TDesC& aFileName,
   308             const TDesC& aFileName,
   322 			const DriveInfo::TDefaultDrives& aDefaultDrive ) const;
   309             const DriveInfo::TDefaultDrives& aDefaultDrive ) const;
   323 
   310 
   324     /**
   311     /**
   325     * Check if application is installed on given drive type.
   312     * Check if application is installed on given drive type.
   326     * @param aUid app uid.
   313     * @param aUid app uid.
   327     * @param aDefaultDrive drive type.
   314     * @param aDefaultDrive drive type.
   328     * @return ETrue if app is installed on given drive type.
   315     * @return ETrue if app is installed on given drive type.
   329     */
   316     */
   330 	TBool IsAppInDrive(
   317     TBool IsAppInDrive(
   331 			const TUid aUid,
   318             const CMenuSrvAppAttributes& aApaItem,
   332 			const DriveInfo::TDefaultDrives& aDefaultDrive ) const;
   319             const DriveInfo::TDefaultDrives& aDefaultDrive ) const;
   333 
   320 
   334     /**
   321     /**
   335     * Check if application is installed on MMC.
   322     * Check if application is installed on MMC.
   336     * @param aUid app uid.
   323     * @param aUid app uid.
   337     * @return ETrue if app is installed on MMC.
   324     * @return ETrue if app is installed on MMC.
   338     */
   325     */
   339     TBool IsMmcApp( const TUid aUid ) const;
   326     TBool IsInMmc( const CMenuSrvAppAttributes& aApaItem ) const;
   340 
   327 
   341     /**
   328     /**
   342     * Check if application is installed on mass storage.
   329     * Check if application is installed on mass storage.
   343     * @param aUid app uid.
   330     * @param aUid app uid.
   344     * @return ETrue if app is installed on mass storage.
   331     * @return ETrue if app is installed on mass storage.
   345     */
   332     */
   346     TBool IsMassStorageApp( const TUid aUid ) const;
   333     TBool IsInMassStorage( const CMenuSrvAppAttributes& aApaItem ) const;
       
   334 
       
   335     /**
       
   336     * Check if application is installed on ROM.
       
   337     * @param aUid app uid.
       
   338     * @return ETrue if app is installed on ROM.
       
   339     */
       
   340     TBool IsInRomL( const CMenuSrvAppAttributes& aApaItem ) const;
   347 
   341 
   348     /**
   342     /**
   349     * Check if drive's status is EDriveInUse.
   343     * Check if drive's status is EDriveInUse.
   350     * @param aDefaultDrive default drive type.
   344     * @param aDefaultDrive default drive type.
   351     * @return ETrue if drive is in use.
   345     * @return ETrue if drive is in use.
   391     /**
   385     /**
   392     TODO
   386     TODO
   393     */
   387     */
   394     void UpdateApplicationItemL(
   388     void UpdateApplicationItemL(
   395     		RArray<TMenuItem>& aMcsItems,
   389     		RArray<TMenuItem>& aMcsItems,
   396             const TAppAtributes& aApaItem,
   390             const CMenuSrvAppAttributes& aApaItem,
   397             TUint aMmcId,
   391             TUint aMmcId,
   398             TBool isLegacy );
   392             TBool isLegacy );
   399 
   393 
   400     /**
   394     /**
   401     TODO
   395     TODO
   413     void UpdateLinkItemsL();
   407     void UpdateLinkItemsL();
   414 
   408 
   415 
   409 
   416 private:    // data
   410 private:    // data
   417 
   411 
   418     CMenuEng& iEng ; ///< Engine.
   412     CMenuEng& iEng; ///< Engine.
   419     RApaLsSession iApaLsSession; ///< AppArc session. Own.
   413     CMenuSrvEngUtils& iSrvEngUtils; ///< Server engine utils.
   420     CApaAppListNotifier* iNotifier; ///< Change notifier. Own.
   414     CApaAppListNotifier* iNotifier; ///< Change notifier. Own.
   421     CMenuSrvMmcHistory* iMmcHistory; ///< MMC history. Own.
   415     CMenuSrvMmcHistory* iMmcHistory; ///< MMC history. Own.
   422     RFs iFs; ///< File Server Session. Own.
   416     RFs iFs; ///< File Server Session. Own.
   423 	RWidgetRegistryClientSession iWidgetSession;///<Own.
       
   424 
   417 
   425     /*
   418     /*
   426     * Sat change notifier. Own
   419     * Sat change notifier. Own
   427     */
   420     */
   428     CMcsSatNotifier* iMcsSatNotifier;
   421     CMcsSatNotifier* iMcsSatNotifier;
   429 
   422 
   430     /*
   423     /*
   431     * Central repository session
   424     * Central repository session
   432     */
   425     */
   433 	CRepository* iCenRepSession;
   426     CRepository* iCenRepSession;
   434 
   427 
   435     /*
   428     /*
   436     * Central repository change handler for Hidden Apps
   429     * Central repository change handler for Hidden Apps
   437     */
   430     */
   438     CCenRepNotifyHandler* iCenRepNotifyHandlerHiddenApps;
   431     CCenRepNotifyHandler* iCenRepNotifyHandlerHiddenApps;
   453     CMcsFreeSpaceObserver* iFreeSpaceObserver;
   446     CMcsFreeSpaceObserver* iFreeSpaceObserver;
   454 
   447 
   455     TBool iOpStatus;
   448     TBool iOpStatus;
   456     };
   449     };
   457 
   450 
   458 
       
   459 class TAppAtributes
       
   460     {
       
   461 
       
   462 public:
       
   463     /*
       
   464     *
       
   465     */
       
   466     TAppAtributes ( TUint aUid, TBool aHidden /*,TBool aMissing*/);
       
   467 
       
   468     /*
       
   469     *
       
   470     */
       
   471     TUint GetUid() const;
       
   472 
       
   473     /*
       
   474     *
       
   475     */
       
   476     TBool IsHidden() const;
       
   477 
       
   478     /*
       
   479     *
       
   480     */
       
   481     void SetHidden( TBool aHidden );
       
   482 
       
   483     /*
       
   484     *
       
   485     */
       
   486     static TBool MatchItems(const TAppAtributes& item1,
       
   487                                         const TAppAtributes& item2);
       
   488 
       
   489 private:    // data
       
   490 
       
   491     TUint iUid;
       
   492     TBool iHidden;
       
   493     };
       
   494 
       
   495 #endif // __MENUSRVAPPSCANNER_H__
   451 #endif // __MENUSRVAPPSCANNER_H__