harvesterplugins/notes/inc/notesplugin.h
changeset 26 367228f82b66
parent 15 df6898e696c6
child 27 7a8855317cbd
equal deleted inserted replaced
24:1abfa342db42 26:367228f82b66
    36 
    36 
    37 #define KNotesDllUid 0x2001A9D8
    37 #define KNotesDllUid 0x2001A9D8
    38 
    38 
    39 class CNotesPlugin : public CIndexingPlugin, public MDelayedCallbackObserver, public MCalChangeCallBack2
    39 class CNotesPlugin : public CIndexingPlugin, public MDelayedCallbackObserver, public MCalChangeCallBack2
    40 {
    40 {
    41 public: // Constructors and destructor
    41 public: // Constructors and destructo
       
    42 
       
    43 	enum THarvesterState
       
    44         {
       
    45         EHarvesterIdleState,
       
    46         EHarvesterStartHarvest        
       
    47         };
       
    48     struct TRecord 
       
    49         {
       
    50         TCalLocalUid iLocalUid;
       
    51         TCPixActionType iActionType;
       
    52         };
    42     /*
    53     /*
    43      * NewL
    54      * NewL
    44      * @return instance of Notes plugin
    55      * @return instance of Notes plugin
    45      */
    56      */
    46 	static CNotesPlugin* NewL();
    57 	static CNotesPlugin* NewL();
    55 	virtual ~CNotesPlugin();
    66 	virtual ~CNotesPlugin();
    56 
    67 
    57 public: // From CIndexingPlugin
    68 public: // From CIndexingPlugin
    58 	void StartPluginL();
    69 	void StartPluginL();
    59 	void StartHarvestingL(const TDesC& aQualifiedBaseAppClass);
    70 	void StartHarvestingL(const TDesC& aQualifiedBaseAppClass);
       
    71     void PausePluginL();
       
    72     void ResumePluginL();
    60 	
    73 	
    61 public:	// From MCalChangeCallBack2
    74 public:	// From MCalChangeCallBack2
    62 	
    75 	
    63 	void CalChangeNotification( RArray< TCalChangeEntry >& aChangeItems );	
    76 	void CalChangeNotification( RArray< TCalChangeEntry >& aChangeItems );	
    64 	
    77 	
    88      * @param TTime& aStartTime   Start time for creating calendar views
   101      * @param TTime& aStartTime   Start time for creating calendar views
    89      * @param TTime& aEndTime  End time for creating calendar views   
   102      * @param TTime& aEndTime  End time for creating calendar views   
    90      * Leaves in case of errors.
   103      * Leaves in case of errors.
    91      */
   104      */
    92 	void InitTimeValuesL( TTime& aStartTime, TTime& aEndTime );
   105 	void InitTimeValuesL( TTime& aStartTime, TTime& aEndTime );
       
   106 	
       
   107 	void OverWriteOrAddToQueueL(const TCalLocalUid& aLocalUid, TCPixActionType aActionType);
       
   108 	        
       
   109 	void IndexQueuedItems();
    93 
   110 
    94 private: // Constructors
   111 private: // Constructors
    95 	
   112 	
    96 	/**
   113 	/**
    97 	 * Default C++ constructor.
   114 	 * Default C++ constructor.
   124 	RPointerArray<CCalInstance> iNotesInstanceArray;
   141 	RPointerArray<CCalInstance> iNotesInstanceArray;
   125 	
   142 	
   126 	//Notes count
   143 	//Notes count
   127 	TInt iNoteCount;
   144 	TInt iNoteCount;
   128 	
   145 	
       
   146 	//State of harvester either to pause/resume
       
   147     TBool iIndexState;    
       
   148     // Queue of documents to be indexed
       
   149     RArray<TRecord> iJobQueue;    
       
   150     //harvesting state
       
   151     THarvesterState iHarvestState;
       
   152 	
   129 	//for unit testing.
   153 	//for unit testing.
   130 	#ifdef HARVESTERPLUGINTESTER_FRIEND
   154 	#ifdef HARVESTERPLUGINTESTER_FRIEND
   131 	    friend class CHarvesterPluginTester;
   155 	    friend class CHarvesterPluginTester;
   132 	#endif	
   156 	#endif	
   133 	
   157