locationtriggering/ltstrategyengine/src/lbtstatusmanager.cpp
changeset 56 4e949f03ecc5
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/locationtriggering/ltstrategyengine/src/lbtstatusmanager.cpp	Wed Nov 03 23:28:39 2010 +0530
@@ -0,0 +1,115 @@
+/*
+* Copyright (c) 2006, 2007 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:  Implementation of Status Manager
+*
+*/
+
+
+
+#include <e32base.h>
+#include <lbtstatuspskeys.h>
+#include "lbtstatusmanager.h"
+#include "lbtlogger.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+// -----------------------------------------------------------------------------
+// CLbtStatusManager::NewL
+// CLbtStatusManager instantiation method.
+// -----------------------------------------------------------------------------
+//
+CLbtStatusManager* CLbtStatusManager::NewL()
+    {
+    CLbtStatusManager* self = new ( ELeave ) CLbtStatusManager;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+    }
+	
+
+// -----------------------------------------------------------------------------
+// CLbtStatusManager::~CLbtStatusManager
+// Destructor
+// -----------------------------------------------------------------------------
+//
+CLbtStatusManager::~CLbtStatusManager()
+    {
+    iStatusInfo.Close();
+    }
+	
+	
+// -----------------------------------------------------------------------------
+// CLbtStatusManager::ReportLocationAcquisitionStatus
+// 
+// -----------------------------------------------------------------------------
+//
+void CLbtStatusManager::ReportLocationAcquisitionStatus( 
+                            TAcquisitionStatus aStatus )
+    {
+    TInt msg;
+    if( KErrNone == aStatus )
+        {
+        msg = iStatusInfo.Set( ELbtLocationTriggeringSupervisionSuccessful );
+        }
+    else
+        {
+        msg = iStatusInfo.Set( ELbtLocationTriggeringSupervisionFailed );
+        }
+        
+    iLastLocAcqStatus = aStatus;        
+    if( KErrNone != msg )
+        {
+        LOG1("Error updating status info:%d",msg);
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CLbtStatusManager::ReportLocationAcquisitionStatus
+// 
+// -----------------------------------------------------------------------------
+//
+TBool CLbtStatusManager::LocationAcqSuccess()
+    {
+    if( KErrNone == iLastLocAcqStatus )
+        {
+        return ETrue;
+        }
+    return EFalse;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CLbtStatusManager::CLbtStatusManager
+// Constructor
+// -----------------------------------------------------------------------------
+//
+CLbtStatusManager::CLbtStatusManager()
+    {
+    }
+	
+
+// -----------------------------------------------------------------------------
+// CLbtStatusManager::ConstructL
+// 2nd phase constructor
+// -----------------------------------------------------------------------------
+//
+void CLbtStatusManager::ConstructL()
+    {
+    User::LeaveIfError( iStatusInfo.Attach( 
+                KPSUidLbtStatusInformation,
+                KLbtLocationTriggeringSupervisionStatus,
+                EOwnerThread ) );
+    }