videocollection/mpxmyvideoscollection/inc/vcxmyvideosmdsdb.h
branchRCL_3
changeset 18 baf439b22ddd
parent 16 67eb01668b0e
--- a/videocollection/mpxmyvideoscollection/inc/vcxmyvideosmdsdb.h	Wed Jun 09 09:44:23 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideosmdsdb.h	Mon Jun 21 15:43:03 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<TUint32>& aId ) = 0;
+        virtual void HandleMyVideosDbEvent( TMPXChangeEventType aEvent, RArray<TUint32>& 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<TEvent> iEvents;
     };
 
 #endif // VCXMYVIDEOSMDSDB_H