|
1 /* |
|
2 * Copyright (c) 2006-2007 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 the License "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: Includes core class log iterator method. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef _LOGITER_H |
|
20 #define _LOGITER_H |
|
21 |
|
22 /** |
|
23 * Forward declarations |
|
24 */ |
|
25 |
|
26 class CBase ; |
|
27 class CActive ; |
|
28 class CLogClient ; |
|
29 class CLogViewEvent ; |
|
30 class CLogViewRecent ; |
|
31 class RFs ; |
|
32 class CLogsEvent ; |
|
33 |
|
34 /** |
|
35 * Logiterator class, used by the core class for getlist api. |
|
36 */ |
|
37 |
|
38 class CLogIter : public CActive |
|
39 { |
|
40 public : |
|
41 |
|
42 /** |
|
43 * Two phase constructors |
|
44 * |
|
45 * @param aClient, CLogClient handle for log database |
|
46 * @param aRecent , CLogViewRecent handle |
|
47 * @param aViewEvents ,CLogViewEvents handle |
|
48 */ |
|
49 IMPORT_C static CLogIter* NewL() ; |
|
50 |
|
51 static CLogIter* NewLC() ; |
|
52 |
|
53 /** |
|
54 * NextL() method, used to iterate through getlis result |
|
55 */ |
|
56 |
|
57 IMPORT_C CLogsEvent* NextL() ; |
|
58 |
|
59 /** |
|
60 * Reset. |
|
61 */ |
|
62 |
|
63 IMPORT_C void Reset() ; |
|
64 |
|
65 /** |
|
66 * SetRecentView, function to set handle to recent view |
|
67 * |
|
68 * @param aRecentView, recentview handle |
|
69 */ |
|
70 |
|
71 inline void SetRecentView(CLogViewRecent* aRecent) |
|
72 { |
|
73 iLogViewRecent = aRecent ; |
|
74 } |
|
75 |
|
76 /** |
|
77 * SetEvent , holds the updated event for Getevent and |
|
78 * Add Event |
|
79 * |
|
80 * @param aEvent, Updated event to be stored |
|
81 */ |
|
82 |
|
83 IMPORT_C void SetEventL(CLogsEvent* aEvent) ; |
|
84 |
|
85 |
|
86 /** |
|
87 * Event, gets the current event and handles the owner ship |
|
88 */ |
|
89 |
|
90 inline CLogsEvent* Event() |
|
91 { |
|
92 /*CSapiEvent *temp = iEvent ; |
|
93 iEvent = NULL ;*/ |
|
94 return iEvent; |
|
95 } |
|
96 |
|
97 /** |
|
98 * GetRfs, gets the handle to the file server |
|
99 * subsession |
|
100 */ |
|
101 |
|
102 inline RFs& GetRFs(void) |
|
103 { |
|
104 return iFs ; |
|
105 } |
|
106 |
|
107 /** |
|
108 * SetLogClient , sets the handle to logview client |
|
109 */ |
|
110 void SetLogClient(CLogClient *aClient) ; |
|
111 |
|
112 /** |
|
113 * SetLogViewEvents, sets the handle to view the events |
|
114 * |
|
115 * @param CLogViewEvent , handle to view the events |
|
116 */ |
|
117 |
|
118 void SetLogViewEvents(CLogViewEvent *aEvent) ; |
|
119 |
|
120 /** |
|
121 * SetLogViewRecent, sets the handle to the recent view |
|
122 * |
|
123 * @param aRecentView, recent view handle |
|
124 */ |
|
125 void SetLogRecentView(CLogViewRecent *aRecent) ; |
|
126 |
|
127 /** |
|
128 * Set the task associated with this iterator |
|
129 * |
|
130 * @param aTaskId, task ID (GetEvents, ReadRecent , etc.,) |
|
131 */ |
|
132 inline void SetTaskId(TUint aTaskId) |
|
133 { |
|
134 iTaskId = aTaskId ; |
|
135 } |
|
136 |
|
137 /** |
|
138 * CountL function |
|
139 */ |
|
140 |
|
141 inline TInt CountL() |
|
142 { |
|
143 return iCount; |
|
144 } |
|
145 |
|
146 /** |
|
147 * Default destructor |
|
148 */ |
|
149 ~CLogIter() ; |
|
150 |
|
151 /** |
|
152 * From CActive |
|
153 */ |
|
154 void RunL() ; |
|
155 |
|
156 /** |
|
157 * From CActive |
|
158 */ |
|
159 |
|
160 void DoCancel() ; |
|
161 |
|
162 protected : |
|
163 |
|
164 |
|
165 /** |
|
166 * Default constructor |
|
167 */ |
|
168 |
|
169 CLogIter() ; |
|
170 |
|
171 /** |
|
172 *ConstructL() , to construct the member funtions |
|
173 */ |
|
174 |
|
175 void ConstructL() ; |
|
176 |
|
177 private : |
|
178 |
|
179 /** |
|
180 * Private member variables |
|
181 */ |
|
182 CActiveSchedulerWait* iScheduler; |
|
183 CLogViewEvent* iLogViewEvents ; |
|
184 CLogViewRecent* iLogViewRecent ; |
|
185 CLogClient* iLogClient ; |
|
186 CLogsEvent* iEvent ; |
|
187 RFs iFs ; |
|
188 TInt iTaskId ; |
|
189 TInt iCount ; |
|
190 TInt iOps ; |
|
191 |
|
192 }; |
|
193 |
|
194 #endif |