|
1 /* |
|
2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * Class for log clearing. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef __CLogsClearLog_H_ |
|
21 #define __CLogsClearLog_H_ |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <f32file.h> |
|
26 #include <logviewchangeobserver.h> |
|
27 |
|
28 |
|
29 |
|
30 #include "MLogsClearLog.h" |
|
31 #include "MLogsStateHolder.h" |
|
32 |
|
33 // MACROS |
|
34 |
|
35 // DATA TYPES |
|
36 |
|
37 // FUNCTION PROTOTYPES |
|
38 |
|
39 // FORWARD DECLARATIONS |
|
40 class CLogClient; |
|
41 class MLogsObserver; |
|
42 class CLogViewRecent; |
|
43 |
|
44 // CLASS DECLARATION |
|
45 |
|
46 /** |
|
47 * Clearing class. |
|
48 */ |
|
49 class CLogsClearLog : public CActive, |
|
50 public MLogsClearLog, |
|
51 public MLogsStateHolder |
|
52 { |
|
53 public: |
|
54 /** |
|
55 * Symbian OS constructor. |
|
56 * |
|
57 * @param aFsSession ref. to file server session |
|
58 * @param aObserver pointer to observer. Default NULL |
|
59 * @return New instance of this class |
|
60 */ |
|
61 static CLogsClearLog* NewL |
|
62 ( RFs& aFsSession |
|
63 , MLogsObserver* aObserver = NULL\ |
|
64 ); |
|
65 |
|
66 /** |
|
67 * Destructor |
|
68 */ |
|
69 ~CLogsClearLog(); |
|
70 |
|
71 private: |
|
72 /** |
|
73 * Default constructor. |
|
74 */ |
|
75 CLogsClearLog(); |
|
76 |
|
77 /** |
|
78 * Second phase constructor. |
|
79 */ |
|
80 void ConstructL(); |
|
81 |
|
82 /** |
|
83 * C++ constructor. |
|
84 * |
|
85 * @param aFsSession ref. to file server session |
|
86 * @param aObserver pointer to observer |
|
87 */ |
|
88 CLogsClearLog( RFs& aFsSession, MLogsObserver* aObserver ); |
|
89 |
|
90 protected: // from CActive |
|
91 void DoCancel(); |
|
92 void RunL(); |
|
93 TInt RunError(TInt aError); |
|
94 |
|
95 public: // from MLogsClearLog |
|
96 void ClearModelL( const TLogsModel aModel ); |
|
97 void DeleteEventL( TLogId aId ); |
|
98 void SetObserver( MLogsObserver* aObserver ); |
|
99 |
|
100 public: // from MLogsStateHolder |
|
101 TLogsState State() const; |
|
102 |
|
103 private: |
|
104 // internal states of object |
|
105 enum TClearPhase |
|
106 { |
|
107 EClearLog = 0, |
|
108 EClearEvent, |
|
109 EClearDuplicates |
|
110 }; |
|
111 |
|
112 private: // data |
|
113 /// Ref: File server session |
|
114 RFs& iFsSession; |
|
115 |
|
116 /// Own: Log client |
|
117 CLogClient* iLogClient; |
|
118 |
|
119 /// Own: |
|
120 CLogViewRecent* iViewRecent; |
|
121 |
|
122 /// Ref: Observer |
|
123 MLogsObserver* iObserver; |
|
124 |
|
125 |
|
126 |
|
127 |
|
128 |
|
129 |
|
130 /// Own: state |
|
131 TLogsState iState; |
|
132 |
|
133 /// Own: phase |
|
134 TClearPhase iPhase; |
|
135 }; |
|
136 |
|
137 #endif |
|
138 |
|
139 // End of File __CLogsClearLog_H_ |