videocollection/hgmyvideos/src/vcxhgmyvideosvideodetailsdialog.cpp
branchRCL_3
changeset 9 5294c000a26d
parent 8 ce5ada96ab30
--- a/videocollection/hgmyvideos/src/vcxhgmyvideosvideodetailsdialog.cpp	Fri Mar 12 15:43:00 2010 +0200
+++ b/videocollection/hgmyvideos/src/vcxhgmyvideosvideodetailsdialog.cpp	Mon Mar 15 12:40:47 2010 +0200
@@ -19,10 +19,8 @@
 
 // INCLUDE FILES
 #include <aknmessagequerydialog.h>
-#include <mpxmedia.h>
 #include <mpxmediageneraldefs.h>
 #include <vcxmyvideosdefs.h>
-#include <StringLoader.h>
 #include <vcxhgmyvideos.rsg>
 #include "vcxhgmyvideosvideodetailsdialog.h"
 #include <MPFileDetailsDialog.h>
@@ -34,20 +32,104 @@
 // ============================ MEMBER FUNCTIONS =============================
 
 // ---------------------------------------------------------------------------
-// TVcxHgMyVideosVideoDetailsDialog::TVcxHgMyVideosVideoDetailsDialog()
+// CVcxHgMyVideosVideoDetailsDialog::CVcxHgMyVideosVideoDetailsDialog()
+// ---------------------------------------------------------------------------
+//
+CVcxHgMyVideosVideoDetailsDialog::CVcxHgMyVideosVideoDetailsDialog()
+    {
+    
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxHgMyVideosVideoDetailsDialog::CVcxHgMyVideosVideoDetailsDialog()
 // ---------------------------------------------------------------------------
 //
-TVcxHgMyVideosVideoDetailsDialog::TVcxHgMyVideosVideoDetailsDialog()
+CVcxHgMyVideosVideoDetailsDialog::~CVcxHgMyVideosVideoDetailsDialog()
+    {
+    if ( iDetailsAo->IsActive() )
+        {
+        iDetailsAo->Cancel();
+        }
+    delete iDetailsAo;
+    delete iDetailsMedia;
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoDetailsDialog::NewL
+//
+// -----------------------------------------------------------------------------
+//
+CVcxHgMyVideosVideoDetailsDialog* CVcxHgMyVideosVideoDetailsDialog::NewL()
     {
+    CVcxHgMyVideosVideoDetailsDialog* self =
+            new (ELeave) CVcxHgMyVideosVideoDetailsDialog();
+	CleanupStack::PushL( self );		
+    self->ConstructL();
+	CleanupStack::Pop( self );
+    return self;        
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoDetailsDialog::ConstructL
+//
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoDetailsDialog::ConstructL()
+    {
+    iDetailsAo = CIdle::NewL( CActive::EPriorityStandard );
     }
 
 // ---------------------------------------------------------------------------
-// TVcxHgMyVideosVideoDetailsDialog::ShowVideoDetailsDialogL()
+// CVcxHgMyVideosVideoDetailsDialog::ShowVideoDetailsDialogL()
 // ---------------------------------------------------------------------------
 //
-void TVcxHgMyVideosVideoDetailsDialog::ShowVideoDetailsDialogL( const CMPXMedia& aMedia )
+void CVcxHgMyVideosVideoDetailsDialog::ShowVideoDetailsDialogL( const CMPXMedia& aMedia )
+    {
+    if ( iDetailsMedia )
+        {
+        delete iDetailsMedia;
+        iDetailsMedia = NULL;
+        }
+    iDetailsMedia = CMPXMedia::NewL( aMedia );
+    
+    ActivateDetailsActiveObject();
+    }
+
+// -----------------------------------------------------------------------------
+// CVcxHgMyVideosVideoDetailsDialog::ActivateDetailsActiveObject
+// -----------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoDetailsDialog::ActivateDetailsActiveObject()
     {
-    CFileDetailsPluginIF* fdPlugin = CFileDetailsPluginIF::NewL();
-    fdPlugin->ShowFileDetails( aMedia );
-    delete fdPlugin;
+    if ( !iDetailsAo->IsActive() )
+        {
+        iDetailsAo->Start( TCallBack( CVcxHgMyVideosVideoDetailsDialog::ShowDetailsL, this ) );
+        }
     }
+
+// -------------------------------------------------------------------------------------------------
+//   CVcxHgMyVideosVideoDetailsDialog::ShowDetailsL
+// -------------------------------------------------------------------------------------------------
+//
+TInt CVcxHgMyVideosVideoDetailsDialog::ShowDetailsL( TAny* aPtr )
+{
+    static_cast<CVcxHgMyVideosVideoDetailsDialog*>(aPtr)->DoShowDetailsL();
+    return KErrNone;
+}
+
+// -------------------------------------------------------------------------------------------------
+//   CVcxHgMyVideosVideoDetailsDialog::DoShowDetailsL
+// -------------------------------------------------------------------------------------------------
+//
+void CVcxHgMyVideosVideoDetailsDialog::DoShowDetailsL()
+    {
+    if ( iDetailsMedia )
+        {
+        CFileDetailsPluginIF* fdPlugin = CFileDetailsPluginIF::NewL();
+        CleanupStack::PushL( fdPlugin );
+        fdPlugin->ShowFileDetailsL( *iDetailsMedia );
+        CleanupStack::PopAndDestroy();
+        }
+    }
+
+