williamr@2
|
1 |
// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
2 |
// All rights reserved.
|
williamr@2
|
3 |
// This component and the accompanying materials are made available
|
williamr@2
|
4 |
// 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
|
williamr@2
|
5 |
// which accompanies this distribution, and is available
|
williamr@2
|
6 |
// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
|
williamr@2
|
7 |
//
|
williamr@2
|
8 |
// Initial Contributors:
|
williamr@2
|
9 |
// Nokia Corporation - initial contribution.
|
williamr@2
|
10 |
//
|
williamr@2
|
11 |
// Contributors:
|
williamr@2
|
12 |
//
|
williamr@2
|
13 |
// Description:
|
williamr@2
|
14 |
//
|
williamr@2
|
15 |
|
williamr@2
|
16 |
|
williamr@2
|
17 |
|
williamr@2
|
18 |
/**
|
williamr@2
|
19 |
@file
|
williamr@2
|
20 |
*/
|
williamr@2
|
21 |
|
williamr@2
|
22 |
#if !defined (__SMSULOG_H__)
|
williamr@2
|
23 |
#define __SMSULOG_H__
|
williamr@2
|
24 |
|
williamr@2
|
25 |
#include <e32base.h>
|
williamr@2
|
26 |
#include <logwrap.h>
|
williamr@2
|
27 |
#include <e32std.h>
|
williamr@2
|
28 |
#include "smsuact.h"
|
williamr@2
|
29 |
|
williamr@2
|
30 |
class RFs;
|
williamr@2
|
31 |
class CSmsMessage;
|
williamr@2
|
32 |
|
williamr@2
|
33 |
|
williamr@2
|
34 |
/**
|
williamr@2
|
35 |
* Logs SMS-related events.
|
williamr@2
|
36 |
*
|
williamr@2
|
37 |
* The class uses the log engine functionality provided by the Log Engine (CLogWrapper
|
williamr@2
|
38 |
* etc.).
|
williamr@2
|
39 |
*
|
williamr@2
|
40 |
* @publishedAll
|
williamr@2
|
41 |
* @released
|
williamr@2
|
42 |
*/
|
williamr@2
|
43 |
class CSmsEventLogger : public CSmsuActiveBase
|
williamr@2
|
44 |
{
|
williamr@2
|
45 |
public:
|
williamr@2
|
46 |
IMPORT_C static CSmsEventLogger* NewL(RFs& aFs,TInt aPriority=CActive::EPriorityStandard);
|
williamr@2
|
47 |
IMPORT_C ~CSmsEventLogger();
|
williamr@2
|
48 |
|
williamr@2
|
49 |
IMPORT_C void AddEvent(TRequestStatus& aStatus,const CSmsMessage& aSmsMessage,const TLogSmsPduData& aData,TInt* aStatusId=NULL);
|
williamr@2
|
50 |
IMPORT_C void GetEvent(TRequestStatus& aStatus,TLogId aId);
|
williamr@2
|
51 |
IMPORT_C void ChangeEvent(TRequestStatus& aStatus,const CSmsMessage& aSmsMessage,const TLogSmsPduData& aData,TInt* aStatusId=NULL);
|
williamr@2
|
52 |
IMPORT_C void ChangeEvent(TRequestStatus& aStatus,const CSmsMessage& aSmsMessage, const TTime* aTime, const TLogSmsPduData& aData, TInt* aStatusId=NULL);
|
williamr@2
|
53 |
IMPORT_C void DeleteEvent(TRequestStatus& aStatus);
|
williamr@2
|
54 |
|
williamr@2
|
55 |
inline TBool ClientAvailable() const;
|
williamr@2
|
56 |
inline TInt GetString(TDes& aString,TInt aId) const;
|
williamr@2
|
57 |
inline CLogEvent& Event();
|
williamr@2
|
58 |
inline const CLogEvent& Event() const;
|
williamr@2
|
59 |
inline const TLogSmsPduData& SmsPDUData() const;
|
williamr@2
|
60 |
|
williamr@2
|
61 |
protected:
|
williamr@2
|
62 |
|
williamr@2
|
63 |
void DoCancel();
|
williamr@2
|
64 |
|
williamr@2
|
65 |
private:
|
williamr@2
|
66 |
CSmsEventLogger(TInt aPriority);
|
williamr@2
|
67 |
void ConstructL(RFs& aFs);
|
williamr@2
|
68 |
void DoRunL();
|
williamr@2
|
69 |
void DoAddEventL(const CSmsMessage& aSmsMessage,TInt* aStatusId);
|
williamr@2
|
70 |
void SetDataL(const CSmsMessage& aSmsMessage,TInt* aStatusId, const TTime* aDischargeTime);
|
williamr@2
|
71 |
void DoComplete(TInt& aStatus);
|
williamr@2
|
72 |
inline void GetStringL(TDes& aString,TInt aId) const;
|
williamr@2
|
73 |
|
williamr@2
|
74 |
private:
|
williamr@2
|
75 |
enum TSmsEventLoggerState
|
williamr@2
|
76 |
{
|
williamr@2
|
77 |
ESmsEventLoggerIdle,
|
williamr@2
|
78 |
ESmsEventLoggerGettingEvent,
|
williamr@2
|
79 |
ESmsEventLoggerAddingEvent,
|
williamr@2
|
80 |
ESmsEventLoggerChangingEvent,
|
williamr@2
|
81 |
ESmsEventLoggerDeletingEvent
|
williamr@2
|
82 |
};
|
williamr@2
|
83 |
private:
|
williamr@2
|
84 |
TSmsEventLoggerState iState;
|
williamr@2
|
85 |
|
williamr@2
|
86 |
CLogWrapper* iLogWrapper;
|
williamr@2
|
87 |
CLogEvent* iLogEvent;
|
williamr@2
|
88 |
|
williamr@2
|
89 |
TLogSmsPduData iSmsPDUData;
|
williamr@2
|
90 |
};
|
williamr@2
|
91 |
|
williamr@2
|
92 |
#include "smsulog.inl"
|
williamr@2
|
93 |
|
williamr@2
|
94 |
#endif
|