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