homescreensrv_plat/menu_content_service_api/tsrc/src/mcsmenuopwatcher.cpp
changeset 0 79c6a41cd166
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreensrv_plat/menu_content_service_api/tsrc/src/mcsmenuopwatcher.cpp	Thu Dec 17 08:54:17 2009 +0200
@@ -0,0 +1,97 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+#include <mcsmenuoperation.h>
+#include "mcsmenuopwatcher.h"
+
+// ---------------------------------------------------------------------------
+// two-phased constructor
+// ---------------------------------------------------------------------------
+CMCSMenuOpWatcher* CMCSMenuOpWatcher::NewL( TBool aStopScheduler )
+	{
+	CMCSMenuOpWatcher* self = new (ELeave) CMCSMenuOpWatcher(aStopScheduler);
+	CleanupStack::PushL( self );
+	self->ConstructL();
+	CleanupStack::Pop( self );
+	return self;
+	}
+
+// ---------------------------------------------------------------------------
+// default constructor
+// ---------------------------------------------------------------------------
+CMCSMenuOpWatcher::CMCSMenuOpWatcher( TBool aStopScheduler )
+	: CActive( CActive::EPriorityStandard ),
+	iStopScheduler(aStopScheduler)
+    {
+    CActiveScheduler::Add( this );
+    }
+
+// ---------------------------------------------------------------------------
+// destructor
+// ---------------------------------------------------------------------------
+CMCSMenuOpWatcher::~CMCSMenuOpWatcher()
+    {
+    Cancel();
+    }
+
+// ---------------------------------------------------------------------------
+// second phase constructor
+// ---------------------------------------------------------------------------
+void CMCSMenuOpWatcher::ConstructL()
+	{
+	
+	}
+
+// ---------------------------------------------------------------------------
+// Watch  Async
+// ---------------------------------------------------------------------------
+void CMCSMenuOpWatcher::Watch( CMenuOperation& aOperation)
+    {
+    __ASSERT_DEBUG( KRequestPending == iStatus.Int(), User::Invariant() );
+    __ASSERT_DEBUG( !iOperation, User::Invariant() ); 
+    iOperation = &aOperation;
+    SetActive();
+    }
+
+// ---------------------------------------------------------------------------
+// Inherited from CActive class 
+// ---------------------------------------------------------------------------
+void CMCSMenuOpWatcher::RunL()
+    {
+    delete iOperation;
+    iOperation = NULL;    
+    //TRAP_IGNORE( iObserver.MenuOpCompletedL(iStatus.Int() ) );
+    if (iStopScheduler)
+        {
+        CActiveScheduler::Stop();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Inherited from CActive class 
+// ---------------------------------------------------------------------------
+void CMCSMenuOpWatcher::DoCancel()
+    {
+    //iOperation->Cancel();
+    delete iOperation;
+    iOperation = NULL;
+    }
+
+TInt CMCSMenuOpWatcher::GetStatus()
+    {
+    return iStatus.Int();
+    }
\ No newline at end of file