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