harvesterplugins/applications/inc/applicationsplugin.h
changeset 26 367228f82b66
parent 16 e918432ddd92
child 27 7a8855317cbd
equal deleted inserted replaced
24:1abfa342db42 26:367228f82b66
    23 #include <common.h>
    23 #include <common.h>
    24 #include <apgcli.h> //RApaLsSession
    24 #include <apgcli.h> //RApaLsSession
    25 #include <apgnotif.h> //Notification
    25 #include <apgnotif.h> //Notification
    26 //#include <WidgetRegistryClient.h>
    26 //#include <WidgetRegistryClient.h>
    27 #include "delayedcallback.h"
    27 #include "delayedcallback.h"
       
    28 #if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )
       
    29 #include <widgetregistryclient.h>
       
    30 #else
       
    31 #include <usif/scr/scr.h>
       
    32 #endif
       
    33 #include <javaregistryincludes.h>
    28 
    34 
    29 class CCPixIndexer;
    35 class CCPixIndexer;
    30 class CRepository;
    36 class CRepository;
       
    37 class TAppRegInfo;
    31 /**
    38 /**
    32  * Applications plugin class. Harvests applictions(exes), widgets and java apps.
    39  * Applications plugin class. Harvests applictions(exes), widgets and java apps.
    33  * 
    40  * 
    34  * Implements CIndexingPlugin, DelayedCallbackObserver & AppListServerObserver.
    41  * Implements CIndexingPlugin, DelayedCallbackObserver & AppListServerObserver.
    35  * 
    42  * 
    36  */
    43  */
    37 class CApplicationsPlugin : public CIndexingPlugin, public MDelayedCallbackObserver, public MApaAppListServObserver
    44 class CApplicationsPlugin : public CIndexingPlugin, public MDelayedCallbackObserver, public MApaAppListServObserver
    38 {
    45 {
    39 public: // Constructors and destructor
    46 public:
    40 	static CApplicationsPlugin* NewL();
    47     enum THarvesterState
    41 	static CApplicationsPlugin* NewLC();
    48         {
    42 	virtual ~CApplicationsPlugin();
    49         EHarvesterIdleState,
       
    50         EHarvesterStartHarvest        
       
    51         };
       
    52     
       
    53     // Constructors and destructor
       
    54     static CApplicationsPlugin* NewL();
       
    55     static CApplicationsPlugin* NewLC();
       
    56     virtual ~CApplicationsPlugin();
    43 
    57 
    44 public: // From CIndexingPlugin
    58 public: // From CIndexingPlugin
    45 	virtual void StartPluginL();
    59 	virtual void StartPluginL();
    46 	virtual void StartHarvestingL(const TDesC& aQualifiedBaseAppClass);
    60 	virtual void StartHarvestingL(const TDesC& aQualifiedBaseAppClass);
       
    61 	void PausePluginL();
       
    62 	void ResumePluginL();
    47 	
    63 	
    48 public: // From MDelayedCallbackObserver
    64 public: // From MDelayedCallbackObserver
    49     void DelayedCallbackL(TInt aCode);
    65     void DelayedCallbackL(TInt aCode);
    50     void DelayedError(TInt aErrorCode);
    66     void DelayedError(TInt aErrorCode);
    51 
    67 
    56 	CApplicationsPlugin();
    72 	CApplicationsPlugin();
    57 	void ConstructL();
    73 	void ConstructL();
    58 	
    74 	
    59     /*
    75     /*
    60      * @description Add, update or delete application document with info in TApaAppInfo based on aActionType.
    76      * @description Add, update or delete application document with info in TApaAppInfo based on aActionType.
    61      * @param aAppInfo: got via RApaLsSession::GetNextApp().
    77      * @param aAppInfo: got via GetNextApp().
    62      * @param aActionType: add, update or delete.
    78      * @param aActionType: add, update or delete.
    63      * @return void
    79      * @return void
    64      * Leaves in case of error.
    80      * Leaves in case of error.
    65      */
    81      */
    66 	void CreateApplicationsIndexItemL( TApaAppInfo& aAppInfo, TCPixActionType aActionType );
    82     void CreateApplicationsIndexItemL(RPointerArray<Usif::TAppRegInfo>& aAppInfo, TCPixActionType aActionType);
    67 	
    83 
    68     /*
    84     /*
    69      * @description Adds necessary document fields to aDocument for widget with Uid aUid.
    85      * @description Adds necessary document fields to aDocument for widget with Uid aUid.
    70      * @param aDocument search document. Not owned.
    86      * @param aDocument search document. Not owned.
    71      * @param aUid: Uid of the widget.
    87      * @param aUid: Uid of the widget.
    72      * @return void
    88      * @return void
    82 	TBool IsAppHiddenL(TUid aUid);
    98 	TBool IsAppHiddenL(TUid aUid);
    83 	
    99 	
    84 private:
   100 private:
    85 	CDelayedCallback* iAsynchronizer;  //Owned.	
   101 	CDelayedCallback* iAsynchronizer;  //Owned.	
    86     CCPixIndexer* iIndexer; // CPix database. Owned.
   102     CCPixIndexer* iIndexer; // CPix database. Owned.
    87     RApaLsSession iApplicationServerSession; //to get application info.
   103     //RApaLsSession iApplicationServerSession; //to get application info.
       
   104     Usif::RSoftwareComponentRegistry iScrSession;
       
   105     Usif::RApplicationInfoView iScrView;
    88     CApaAppListNotifier* iNotifier; //Owned.
   106     CApaAppListNotifier* iNotifier; //Owned.
    89     //RWidgetRegistryClientSession iWidgetRegistry; //to get widget info.
   107     //State of harvester either to pause/resume
    90     CRepository* iHiddenApplicationsRepository;
   108     TBool iIndexState;
       
   109     //harvesting state
       
   110     THarvesterState iHarvestState;    
    91 
   111 
    92 #ifdef __PERFORMANCE_DATA
   112 #ifdef __PERFORMANCE_DATA
    93     TTime iStartTime;
   113     TTime iStartTime;
    94     TTime iCompleteTime;
   114     TTime iCompleteTime;
    95     void UpdatePerformaceDataL();
   115     void UpdatePerformaceDataL();