|
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 * Recent list duplicate cleaner |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 // INCLUDE FILES |
|
21 |
|
22 #include <logview.h> |
|
23 #include "CLogsRecentReader.h" |
|
24 #include "MLogsObserver.h" |
|
25 #include "MLogsEvent.h" |
|
26 #include "MLogsEventArray.h" |
|
27 #include "LogsEngConsts.h" |
|
28 |
|
29 // MODULE DATA STRUCTURES |
|
30 class CLogsClearDuplicates : public CActive, |
|
31 public MLogViewChangeObserver |
|
32 { |
|
33 public: |
|
34 /** |
|
35 * Symbian OS constructor. |
|
36 * |
|
37 * @param aFsSession ref. to file server session |
|
38 * @return New instance of this class |
|
39 */ |
|
40 static CLogsClearDuplicates* NewL( RFs& aFsSession ); |
|
41 |
|
42 /** |
|
43 * Destructor |
|
44 */ |
|
45 ~CLogsClearDuplicates(); |
|
46 |
|
47 private: |
|
48 /** |
|
49 * Default constructor. |
|
50 */ |
|
51 CLogsClearDuplicates(); |
|
52 |
|
53 /** |
|
54 * Second phase constructor. |
|
55 */ |
|
56 void ConstructL(); |
|
57 |
|
58 /** |
|
59 * C++ constructor. |
|
60 * |
|
61 * @param aFsSession ref. to file server session |
|
62 */ |
|
63 CLogsClearDuplicates( RFs& aFsSession ); |
|
64 |
|
65 public: |
|
66 /** |
|
67 * Clear duplicates and set KLogEventRead flag |
|
68 * |
|
69 * @param aDuplicates clear duplicates if ETrue |
|
70 * @param aView view to clear duplicates from |
|
71 */ |
|
72 void ClearDuplicatesL( TBool aDuplicates, CLogViewRecent* aView ); |
|
73 |
|
74 private: |
|
75 /** |
|
76 * Initialize database view for log events having "read" flag unset |
|
77 */ |
|
78 void SetFlagClearViewL(); |
|
79 /** |
|
80 * Initialize the database view for log events having "ALS" flag set |
|
81 */ |
|
82 void SetFlagClearViewALSL(); |
|
83 |
|
84 public: // from MLogViewChangeObserver |
|
85 void HandleLogViewChangeEventAddedL |
|
86 ( TLogId aId |
|
87 , TInt aViewIndex |
|
88 , TInt aChangeIndex |
|
89 , TInt aTotalChangeCount |
|
90 ); |
|
91 |
|
92 void HandleLogViewChangeEventChangedL |
|
93 ( TLogId aId |
|
94 , TInt aViewIndex |
|
95 , TInt aChangeIndex |
|
96 , TInt aTotalChangeCount |
|
97 ); |
|
98 |
|
99 void HandleLogViewChangeEventDeletedL |
|
100 ( TLogId aId |
|
101 , TInt aViewIndex |
|
102 , TInt aChangeIndex |
|
103 , TInt aTotalChangeCount |
|
104 ); |
|
105 |
|
106 protected: /// from CActive |
|
107 void RunL(); |
|
108 void DoCancel(); |
|
109 |
|
110 private: // data |
|
111 /// Ref: file server session |
|
112 RFs& iFsSession; |
|
113 |
|
114 /// Own: log client |
|
115 CLogClient* iLogClient; |
|
116 |
|
117 /// Own: log view |
|
118 // database view for log events having "read" flag unset |
|
119 CLogViewRecent* iFlagClearView; |
|
120 // database view for log events having "ALS" flag set |
|
121 CLogViewRecent* iFlagClearViewALS; |
|
122 TBool iClearViewALSIsSet; |
|
123 |
|
124 |
|
125 /// Own: log clear flags filter |
|
126 CLogFilter* iFilterFlagClear; |
|
127 CLogFilter* iFilterFlagClearALS; |
|
128 }; |
|
129 |