serviceproviders/sapi_logging/loggingservice/src/loggingevent.cpp
changeset 5 989d2f495d90
child 16 44bb89c96acb
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/serviceproviders/sapi_logging/loggingservice/src/loggingevent.cpp	Fri Jul 03 15:51:24 2009 +0100
@@ -0,0 +1,102 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:  Implements sapievent class.
+*
+*/
+
+
+#include <e32base.h>
+#include <logwrap.h>
+#include <logcli.h>
+
+#include "loggingevent.h"
+
+/**
+* Default Constructor Method
+*/
+
+CLogsEvent :: CLogsEvent()
+    {
+    }
+
+/**
+* Default Destructor
+*/
+
+CLogsEvent :: ~CLogsEvent()
+    {
+    delete iLogEvent;
+    delete iLogClient ;
+    iFs.Close() ;
+    }
+
+/**
+*Two phased constructor implementation
+*/
+
+EXPORT_C CLogsEvent* CLogsEvent :: NewL()
+    {
+    CLogsEvent* self = CLogsEvent::NewLC();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+/**
+* Two phased constructor implementation
+*/
+
+CLogsEvent* CLogsEvent :: NewLC()
+    {
+    CLogsEvent* self = new (ELeave) CLogsEvent();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    return self;
+    }
+
+/**
+* This function constructs the member elements of CLogsEvent Class
+*/
+void CLogsEvent :: ConstructL()
+    {
+    User::LeaveIfError(iFs.Connect());
+    iLogClient = CLogClient::NewL(iFs);
+    iLogEvent = CLogEvent::NewL();
+    }
+
+/**
+* This function sets the direction of the event
+*/
+EXPORT_C  void CLogsEvent ::  SetDirection(TInt aDirection)
+    {
+    TBuf<KLogMaxDirectionLength> direction;
+    iLogClient->GetString(direction, aDirection);
+    iLogEvent->SetDirection(direction) ;
+    }
+
+
+/**
+* This function sets the status of the event
+*
+* @param aStatus , status of the event(pending, delivered etc.,)
+*/
+EXPORT_C void CLogsEvent :: SetStatus(TInt aStatus)
+    {
+    TBuf<KLogMaxDirectionLength> status ;
+    iLogClient->GetString(status , aStatus) ;
+    iLogEvent->SetStatus(status) ;
+    }
+
+
+
+