|
1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef __LOGSERVDATABASEDRIVER_H__ |
|
17 #define __LOGSERVDATABASEDRIVER_H__ |
|
18 |
|
19 #include <e32base.h> |
|
20 #include "LogServTaskInterface.h" |
|
21 #include "LogServBackupObserver.h" |
|
22 |
|
23 // Classes referenced |
|
24 class CLogEvent; |
|
25 class CLogEventType; |
|
26 class CLogAddEvent; |
|
27 class CLogMaintenance; |
|
28 class CLogChangeEvent; |
|
29 class CLogGetEvent; |
|
30 class CLogDeleteEvent; |
|
31 class CLogChangeConfig; |
|
32 class MLogServDatabaseTransactionInterface; |
|
33 class MLogServBackupInterface; |
|
34 class CLogServRecentListManager; |
|
35 class CLogServResourceInterpreter; |
|
36 class CLogServViewWindowFetcher; |
|
37 |
|
38 /** |
|
39 Implements MLogServTaskInterface and MLogServBackupObserver. |
|
40 Maintains a list of hitters, i.e. objects that will execute the requested by the client operation - add event, etc. |
|
41 Every time, when one of the implemented TaskEventAddL(), TaskEventChangeL() etc. methods is called, that method |
|
42 will read the client data and call the StartL() method of the hitter suitable for that operation. |
|
43 |
|
44 @see MLogServTaskInterface |
|
45 @see MLogServBackupObserver |
|
46 @see CLogAddEvent; |
|
47 @see CLogGetEvent; |
|
48 @see CLogChangeEvent; |
|
49 @see CLogDeleteEvent; |
|
50 @see CLogChangeConfig; |
|
51 @see CLogMaintenance; |
|
52 |
|
53 @internalComponent |
|
54 */ |
|
55 class CLogServDatabaseDriver : public CBase, public MLogServTaskInterface, public MLogServBackupObserver |
|
56 { |
|
57 public: |
|
58 static CLogServDatabaseDriver* NewL(MLogServBackupInterface& aBackupInterface, MLogServDatabaseTransactionInterface& aDatabase, CLogServResourceInterpreter& aResourceInterface, CLogServRecentListManager& aRecentListManager, TInt aHitterPriorities); |
|
59 ~CLogServDatabaseDriver(); |
|
60 |
|
61 private: |
|
62 CLogServDatabaseDriver(MLogServBackupInterface& aBackupInterface, MLogServDatabaseTransactionInterface& aDatabase, CLogServResourceInterpreter& aResourceInterface, CLogServRecentListManager& aRecentListManager, TInt aHitterPriorities); |
|
63 void ConstructL(); |
|
64 |
|
65 private: // FROM MLogServBackupObserver |
|
66 void BOHandleEventL(TLogServBackupEvent aEvent); |
|
67 |
|
68 private: // FROM MLogServTaskInterface |
|
69 void TaskEventAddL(TRequestStatus& aStatus, CLogEvent& aEvent, const RMessage2& aMessage); |
|
70 void TaskEventChangeL(TRequestStatus& aStatus, const CLogEvent& aEvent, const RMessage2& aMessage); |
|
71 void TaskEventGetL(TRequestStatus& aStatus, CLogEvent& aEvent, const RMessage2& aMessage); |
|
72 void TaskEventDeleteL(TRequestStatus& aStatus, TLogId aId, const RMessage2& aMessage); |
|
73 // |
|
74 void TaskEventTypeAddL(TRequestStatus& aStatus, const CLogEventType& aEventType); |
|
75 void TaskEventTypeGetL(TRequestStatus& aStatus, const CLogEventType*& aEventType, TUid aUid); |
|
76 void TaskEventTypeChangeL(TRequestStatus& aStatus, const CLogEventType& aEventType); |
|
77 void TaskEventTypeDeleteL(TRequestStatus& aStatus, TUid aType); |
|
78 // |
|
79 void TaskConfigGetL(TRequestStatus& aStatus, TLogConfig& aConfig); |
|
80 void TaskConfigChangeL(TRequestStatus& aStatus, const TLogConfig& aConfig); |
|
81 // |
|
82 void TaskClearLogL(TRequestStatus& aStatus, const TTime& aDate |
|
83 #ifdef SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM |
|
84 , TSimId aSimId |
|
85 #endif |
|
86 ); |
|
87 void TaskClearRecentL(TRequestStatus& aStatus, TInt aRecentList |
|
88 #ifdef SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM |
|
89 , TSimId aSimId |
|
90 #endif |
|
91 ); |
|
92 // |
|
93 void TaskMaintenanceStartL(TRequestStatus& aStatus, TBool aPurge); |
|
94 // |
|
95 void TaskBuildWindowL(TRequestStatus& aStatus, const CLogServViewBase& aView, const TLogTransferWindow& aWindow, const RMessage2& aMessage); |
|
96 // |
|
97 void TaskCancelCurrent(); |
|
98 |
|
99 private: |
|
100 void DestroyHitters(); |
|
101 void CreateHittersL(); |
|
102 |
|
103 private: |
|
104 TInt iHitterPriorities;//The active object priority used for all objects which hit the database |
|
105 MLogServBackupInterface& iBackupInterface;//The interface to the backup manager |
|
106 MLogServDatabaseTransactionInterface& iDatabase;//Access the database |
|
107 CLogServResourceInterpreter& iResourceInterface;//Access resource files |
|
108 CLogServRecentListManager& iRecentListManager;//Access recent list |
|
109 // The hitters - named as such because they all hit the database in some |
|
110 // way (e.g. read or write from/to it). |
|
111 CLogAddEvent* iAddEvent; |
|
112 CLogGetEvent* iGetEvent; |
|
113 CLogChangeEvent* iChangeEvent; |
|
114 CLogDeleteEvent* iDeleteEvent; |
|
115 CLogChangeConfig* iChangeConfig; |
|
116 CLogMaintenance* iMaintainer; |
|
117 CLogServViewWindowFetcher* iWindowFetcher; |
|
118 |
|
119 }; |
|
120 |
|
121 #endif |
|
122 |