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