|
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 * Main list reader |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef __Logs_Engine_CLogsMainReader_H__ |
|
21 #define __Logs_Engine_CLogsMainReader_H__ |
|
22 |
|
23 // INCLUDES |
|
24 #include <logclientchangeobserver.h> |
|
25 #include "CLogsBaseReader.h" |
|
26 |
|
27 // FORWARD DECLARATION |
|
28 class CLogViewEvent; |
|
29 class CLogFilter; |
|
30 class CLogFilterList; |
|
31 |
|
32 // CLASS DECLARATION |
|
33 class MLogsEventArray; |
|
34 |
|
35 /** |
|
36 * Main list reader |
|
37 */ |
|
38 class CLogsMainReader : public CLogsBaseReader, |
|
39 public MLogClientChangeObserver |
|
40 { |
|
41 |
|
42 public: |
|
43 |
|
44 /** |
|
45 * Two phase constructor |
|
46 * |
|
47 * @param aFsSession ref. to file server session |
|
48 * @param aEventArray array of events |
|
49 * @param aStrings log client constants |
|
50 * @param aModel model id |
|
51 * @param aObserver observer |
|
52 */ |
|
53 static CLogsMainReader* NewL( RFs& aFsSession, |
|
54 MLogsEventArray& aEventArray, |
|
55 TLogsEventStrings& aStrings, TLogsModel aModel, |
|
56 MLogsObserver* aObserver, |
|
57 CLogsEngine* aLogsEngineRef ); |
|
58 |
|
59 /** |
|
60 * Destructor. |
|
61 */ |
|
62 virtual ~CLogsMainReader(); |
|
63 |
|
64 private: |
|
65 |
|
66 /** |
|
67 * Default constructor |
|
68 */ |
|
69 CLogsMainReader(); |
|
70 |
|
71 /** |
|
72 * Constructor |
|
73 * |
|
74 * @param aFsSession ref. to file server session |
|
75 * @param aEventArray array of events |
|
76 * @param aStrings log client constants |
|
77 * @param aModel model id |
|
78 * @param aObserver observer |
|
79 */ |
|
80 CLogsMainReader( RFs& aFsSession, |
|
81 MLogsEventArray& aEventArray, |
|
82 TLogsEventStrings& aStrings, TLogsModel aModel, |
|
83 MLogsObserver* aObserver, |
|
84 CLogsEngine* aLogsEngineRef ); |
|
85 |
|
86 /** |
|
87 * Second phase constructor |
|
88 */ |
|
89 void ConstructL(); |
|
90 |
|
91 |
|
92 /** |
|
93 * Creates and returns a filter. |
|
94 * Leaves filter object on cleanupstack. |
|
95 * |
|
96 * @param aFilterType Filter type id. |
|
97 * |
|
98 * @return Pointer to created and configured filter. |
|
99 */ |
|
100 CLogFilter* SetOneFilterLC( TUid aFilterType ); |
|
101 |
|
102 /** |
|
103 * Creates and returns a filter. |
|
104 * Leaves filter object on cleanupstack. |
|
105 * |
|
106 * @param aDirection Filter direction |
|
107 * |
|
108 * @return Pointer to created and configured filter. |
|
109 */ |
|
110 CLogFilter* SetOneFilterLC( TLogString& aDirection ); |
|
111 |
|
112 /** |
|
113 * Creates and returns a filter. |
|
114 * Leaves filter object to cleanupstack. |
|
115 * |
|
116 * @param aNumber number filter |
|
117 * @param aName remoty party filter |
|
118 * |
|
119 * @return Pointer to created and configured filter. |
|
120 */ |
|
121 CLogFilter* SetOneFilterLC( const TDesC* aNumber, const TDesC* aName ); |
|
122 |
|
123 /** |
|
124 * Set filter. |
|
125 * |
|
126 * @param aFilter Filter type. |
|
127 * @param aNumber Telephone number as filter criterion, |
|
128 * NULL is a default |
|
129 * @param aName Person's name as filter criterion, |
|
130 * NULL is a default |
|
131 */ |
|
132 void SetFilterL( const TLogsFilter aFilter, |
|
133 const TDesC* aNumber = NULL, const TDesC* aName = NULL ); |
|
134 |
|
135 private: // from CLogsBaseReader |
|
136 |
|
137 TInt ViewCountL() const; |
|
138 CLogEvent& Event() const; |
|
139 TBool DoNextL(); |
|
140 void ConstructEventL( MLogsEvent& aDest, const CLogEvent& aSource ); |
|
141 |
|
142 protected: // From CActive |
|
143 |
|
144 void DoCancel(); |
|
145 |
|
146 |
|
147 public: // from MLogsReader |
|
148 |
|
149 void Stop(); |
|
150 |
|
151 void StartL(); |
|
152 |
|
153 void ConfigureL( const MLogsReaderConfig* aConfig ); |
|
154 |
|
155 private: // from MLogClientChangeObserver |
|
156 /** (copied from LOGCLIENTCHANGEOBSERVER.H: |
|
157 Handle a global change within the logs database |
|
158 |
|
159 This method is called when a generic event occurs within the log database. |
|
160 Such events are not specific to a view (see MLogViewChangeObserver for view |
|
161 specific events). |
|
162 |
|
163 @param aChangeType The uid corresponding to the type of event which |
|
164 occurred. |
|
165 @param aChangeParam1 A context-specific change paramater which can be |
|
166 interpreted based on the change type. |
|
167 @param aChangeParam2 A context-specific change paramater which can be |
|
168 interpreted based on the change type. |
|
169 @param aChangeParam3 A context-specific change paramater which can be |
|
170 interpreted based on the change type. |
|
171 |
|
172 A list of change types and their associated parameters follows: |
|
173 |
|
174 KLogClientChangeEventLogCleared - no parameters. This event occurs when |
|
175 the log database is cleared. */ |
|
176 void HandleLogClientChangeEventL( TUid aChangeType, |
|
177 TInt aChangeParam1, |
|
178 TInt aChangeParam2, |
|
179 TInt aChangeParam3); |
|
180 |
|
181 private: // data |
|
182 |
|
183 /// Own: View to filtered events. |
|
184 CLogViewEvent* iLogViewEvent; |
|
185 |
|
186 /// Own: Filterlist |
|
187 CLogFilterList* iFilterList; |
|
188 }; |
|
189 |
|
190 #endif // __Logs_Engine_CLogsMainReader_H__ |
|
191 |
|
192 |
|
193 // End of File |
|
194 |
|
195 |
|
196 |
|
197 |