epoc32/include/smsulog.h
branchSymbian2
changeset 2 2fe1408b6811
child 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/smsulog.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -0,0 +1,94 @@
     1.4 +// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +
    1.20 +
    1.21 +/**
    1.22 + @file
    1.23 +*/
    1.24 +
    1.25 +#if !defined (__SMSULOG_H__)
    1.26 +#define __SMSULOG_H__
    1.27 +
    1.28 +#include <e32base.h>
    1.29 +#include <logwrap.h>
    1.30 +#include <e32std.h>
    1.31 +#include "smsuact.h"
    1.32 +
    1.33 +class RFs;
    1.34 +class CSmsMessage;
    1.35 +
    1.36 +
    1.37 +/**
    1.38 + *  Logs SMS-related events.
    1.39 + *  
    1.40 + *  The class uses the log engine functionality provided by the Log Engine (CLogWrapper
    1.41 + *  etc.).
    1.42 + *  
    1.43 + *  @publishedAll
    1.44 + *  @released 
    1.45 + */
    1.46 +class CSmsEventLogger : public CSmsuActiveBase
    1.47 +	{
    1.48 +public:
    1.49 +	IMPORT_C static CSmsEventLogger* NewL(RFs& aFs,TInt aPriority=CActive::EPriorityStandard);
    1.50 +	IMPORT_C ~CSmsEventLogger();
    1.51 +
    1.52 +	IMPORT_C void AddEvent(TRequestStatus& aStatus,const CSmsMessage& aSmsMessage,const TLogSmsPduData& aData,TInt* aStatusId=NULL);
    1.53 +	IMPORT_C void GetEvent(TRequestStatus& aStatus,TLogId aId);
    1.54 +	IMPORT_C void ChangeEvent(TRequestStatus& aStatus,const CSmsMessage& aSmsMessage,const TLogSmsPduData& aData,TInt* aStatusId=NULL);
    1.55 +    IMPORT_C void ChangeEvent(TRequestStatus& aStatus,const CSmsMessage& aSmsMessage, const TTime* aTime, const TLogSmsPduData& aData, TInt* aStatusId=NULL);   
    1.56 +	IMPORT_C void DeleteEvent(TRequestStatus& aStatus);
    1.57 +
    1.58 +	inline TBool ClientAvailable() const;
    1.59 +	inline TInt GetString(TDes& aString,TInt aId) const;
    1.60 +	inline CLogEvent& Event();
    1.61 +	inline const CLogEvent& Event() const;
    1.62 +	inline const TLogSmsPduData& SmsPDUData() const;
    1.63 +
    1.64 +protected:
    1.65 +
    1.66 +	void DoCancel();
    1.67 +
    1.68 +private:
    1.69 +	CSmsEventLogger(TInt aPriority);
    1.70 +	void ConstructL(RFs& aFs);
    1.71 +	void DoRunL();
    1.72 +	void DoAddEventL(const CSmsMessage& aSmsMessage,TInt* aStatusId);
    1.73 +    void SetDataL(const CSmsMessage& aSmsMessage,TInt* aStatusId, const TTime* aDischargeTime);
    1.74 +	void DoComplete(TInt& aStatus);
    1.75 +	inline void GetStringL(TDes& aString,TInt aId) const;
    1.76 +
    1.77 +private:
    1.78 +	enum TSmsEventLoggerState
    1.79 +		{
    1.80 +		ESmsEventLoggerIdle,
    1.81 +		ESmsEventLoggerGettingEvent,
    1.82 +		ESmsEventLoggerAddingEvent,
    1.83 +		ESmsEventLoggerChangingEvent,
    1.84 +		ESmsEventLoggerDeletingEvent
    1.85 +		};
    1.86 +private:
    1.87 +	TSmsEventLoggerState iState;
    1.88 +
    1.89 +	CLogWrapper* iLogWrapper;
    1.90 +	CLogEvent* iLogEvent;
    1.91 +
    1.92 +	TLogSmsPduData iSmsPDUData;
    1.93 +	};
    1.94 +
    1.95 +#include "smsulog.inl"
    1.96 +
    1.97 +#endif