|
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 __LOGNOTIFY_H__ |
|
17 #define __LOGNOTIFY_H__ |
|
18 |
|
19 #include <logcli.h> |
|
20 #include "LogServBackupObserver.h" |
|
21 #include "LogServDatabaseChangeObserver.h" |
|
22 |
|
23 // Classes referenced |
|
24 class MLogServBackupInterface; |
|
25 class MLogServDatabaseChangeInterface; |
|
26 |
|
27 /** |
|
28 Uses the previous classes to provide change notifications |
|
29 @internalComponent |
|
30 */ |
|
31 class CLogNotify : public CTimer, public MLogServBackupObserver, public MLogServDatabaseChangeObserver |
|
32 { |
|
33 public: |
|
34 static CLogNotify* NewL(MLogServBackupInterface& aBackupInterface, MLogServDatabaseChangeInterface& aChangeInterface, TInt aPriority); |
|
35 ~CLogNotify(); |
|
36 |
|
37 private: |
|
38 CLogNotify(MLogServBackupInterface& aBackupInterface, MLogServDatabaseChangeInterface& aChangeInterface, TInt aPriority); |
|
39 void ConstructL(); |
|
40 |
|
41 public: |
|
42 void Notify(TTimeIntervalMicroSeconds32 aDelay, const RMessage2& aMessage); |
|
43 |
|
44 |
|
45 private: // FROM MLogServDatabaseChangeObserver |
|
46 void DCOHandleChangeEventsL(const CLogChangeDefinition& aChanges); |
|
47 |
|
48 private: // FROM MLogServBackupObserver |
|
49 void BOHandleEventL(TLogServBackupEvent aEvent); |
|
50 |
|
51 public: // FROM CActive |
|
52 void Cancel(); |
|
53 |
|
54 private: // FROM CActive |
|
55 void RunL(); |
|
56 void DoCancel(); |
|
57 |
|
58 private: // Internal |
|
59 void CheckForChanges(); |
|
60 void CompleteClientRequest(TInt aCompletionCode); |
|
61 |
|
62 private: |
|
63 |
|
64 /** |
|
65 * So this object knows when a backup is starting. Have to cancel the delay timer |
|
66 * during this period. |
|
67 */ |
|
68 MLogServBackupInterface& iBackupInterface; |
|
69 |
|
70 /** |
|
71 * The change interface |
|
72 */ |
|
73 MLogServDatabaseChangeInterface& iChangeInterface; |
|
74 |
|
75 /** |
|
76 * Counters for change tracking |
|
77 */ |
|
78 TUint iLastCommit; |
|
79 TUint iCommit; |
|
80 |
|
81 /** |
|
82 * The client-side outstanding notification request |
|
83 */ |
|
84 |
|
85 RMessagePtr2 iMessagePtr; |
|
86 |
|
87 /** |
|
88 * Used as a flag to indicate whether the client-side message should |
|
89 * be completed |
|
90 */ |
|
91 TBool iCompleteClientMessage; |
|
92 |
|
93 #ifdef LOGGING_ENABLED |
|
94 public: |
|
95 TName iClientThreadName; |
|
96 inline void SetClientThreadName(const TDesC& aName) { iClientThreadName = aName; } |
|
97 #endif |
|
98 }; |
|
99 |
|
100 #endif |