diff -r c48470be1ba7 -r adbe7d5ba2f5 videocollection/mpxmyvideoscollection/inc/vcxmyvideosmdsdb.h --- a/videocollection/mpxmyvideoscollection/inc/vcxmyvideosmdsdb.h Fri Jun 11 13:39:54 2010 +0300 +++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideosmdsdb.h Wed Jun 23 18:14:16 2010 +0300 @@ -61,10 +61,11 @@ /** * Handler function for database events. * - * @param aEvent Event type. - * @param aId Array of IDs in database. + * @param aEvent Event type. + * @param aId Array of IDs in database. + * @param aEventsLeft How many events are still coming. */ - virtual void HandleMyVideosDbEvent( TMPXChangeEventType aEvent, RArray& aId ) = 0; + virtual void HandleMyVideosDbEvent( TMPXChangeEventType aEvent, RArray& aId, TInt aEventsLeft ) = 0; /** * Handler function for video list fetching events. This callback is called as a response @@ -275,6 +276,14 @@ ERemoveAlbums }; + class TEvent + { + public: + + TUint32 iMdsId; + TInt iEventType; + }; + /** * Two-phased constructor. * @param aObserver The db change observer. @@ -356,6 +365,11 @@ */ CMPXMedia* CreateVideoL( TUint32 aId, TBool aFullDetails = ETrue ); + /** + * Called by iEventProcessor. + */ + static TInt ProcessEvents( TAny* aPtr ); + protected: // from MMdESessionObserver @@ -548,6 +562,11 @@ */ CMdESession& MdsSessionL(); + /** + * Called by ProcessEvents. + */ + TInt DoProcessEvents(); + public: /** @@ -767,6 +786,15 @@ */ CVcxMdsShutdownMonitor* iMdsShutdownMonitor; + /** + * Used for handling events on background. + */ + CIdle* iEventProcessor; + + /** + * Incoming events are stored here and "slowly" fed to observer. + */ + RArray iEvents; }; #endif // VCXMYVIDEOSMDSDB_H