sl@0
|
1 |
// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
//
|
sl@0
|
15 |
|
sl@0
|
16 |
#ifndef __LOGNOTIFY_H__
|
sl@0
|
17 |
#define __LOGNOTIFY_H__
|
sl@0
|
18 |
|
sl@0
|
19 |
#include <logcli.h>
|
sl@0
|
20 |
#include "LogServBackupObserver.h"
|
sl@0
|
21 |
#include "LogServDatabaseChangeObserver.h"
|
sl@0
|
22 |
|
sl@0
|
23 |
// Classes referenced
|
sl@0
|
24 |
class MLogServBackupInterface;
|
sl@0
|
25 |
class MLogServDatabaseChangeInterface;
|
sl@0
|
26 |
|
sl@0
|
27 |
/**
|
sl@0
|
28 |
Uses the previous classes to provide change notifications
|
sl@0
|
29 |
@internalComponent
|
sl@0
|
30 |
*/
|
sl@0
|
31 |
class CLogNotify : public CTimer, public MLogServBackupObserver, public MLogServDatabaseChangeObserver
|
sl@0
|
32 |
{
|
sl@0
|
33 |
public:
|
sl@0
|
34 |
static CLogNotify* NewL(MLogServBackupInterface& aBackupInterface, MLogServDatabaseChangeInterface& aChangeInterface, TInt aPriority);
|
sl@0
|
35 |
~CLogNotify();
|
sl@0
|
36 |
|
sl@0
|
37 |
private:
|
sl@0
|
38 |
CLogNotify(MLogServBackupInterface& aBackupInterface, MLogServDatabaseChangeInterface& aChangeInterface, TInt aPriority);
|
sl@0
|
39 |
void ConstructL();
|
sl@0
|
40 |
|
sl@0
|
41 |
public:
|
sl@0
|
42 |
void Notify(TTimeIntervalMicroSeconds32 aDelay, const RMessage2& aMessage);
|
sl@0
|
43 |
|
sl@0
|
44 |
|
sl@0
|
45 |
private: // FROM MLogServDatabaseChangeObserver
|
sl@0
|
46 |
void DCOHandleChangeEventsL(const CLogChangeDefinition& aChanges);
|
sl@0
|
47 |
|
sl@0
|
48 |
private: // FROM MLogServBackupObserver
|
sl@0
|
49 |
void BOHandleEventL(TLogServBackupEvent aEvent);
|
sl@0
|
50 |
|
sl@0
|
51 |
public: // FROM CActive
|
sl@0
|
52 |
void Cancel();
|
sl@0
|
53 |
|
sl@0
|
54 |
private: // FROM CActive
|
sl@0
|
55 |
void RunL();
|
sl@0
|
56 |
void DoCancel();
|
sl@0
|
57 |
|
sl@0
|
58 |
private: // Internal
|
sl@0
|
59 |
void CheckForChanges();
|
sl@0
|
60 |
void CompleteClientRequest(TInt aCompletionCode);
|
sl@0
|
61 |
|
sl@0
|
62 |
private:
|
sl@0
|
63 |
|
sl@0
|
64 |
/**
|
sl@0
|
65 |
* So this object knows when a backup is starting. Have to cancel the delay timer
|
sl@0
|
66 |
* during this period.
|
sl@0
|
67 |
*/
|
sl@0
|
68 |
MLogServBackupInterface& iBackupInterface;
|
sl@0
|
69 |
|
sl@0
|
70 |
/**
|
sl@0
|
71 |
* The change interface
|
sl@0
|
72 |
*/
|
sl@0
|
73 |
MLogServDatabaseChangeInterface& iChangeInterface;
|
sl@0
|
74 |
|
sl@0
|
75 |
/**
|
sl@0
|
76 |
* Counters for change tracking
|
sl@0
|
77 |
*/
|
sl@0
|
78 |
TUint iLastCommit;
|
sl@0
|
79 |
TUint iCommit;
|
sl@0
|
80 |
|
sl@0
|
81 |
/**
|
sl@0
|
82 |
* The client-side outstanding notification request
|
sl@0
|
83 |
*/
|
sl@0
|
84 |
|
sl@0
|
85 |
RMessagePtr2 iMessagePtr;
|
sl@0
|
86 |
|
sl@0
|
87 |
/**
|
sl@0
|
88 |
* Used as a flag to indicate whether the client-side message should
|
sl@0
|
89 |
* be completed
|
sl@0
|
90 |
*/
|
sl@0
|
91 |
TBool iCompleteClientMessage;
|
sl@0
|
92 |
|
sl@0
|
93 |
#ifdef LOGGING_ENABLED
|
sl@0
|
94 |
public:
|
sl@0
|
95 |
TName iClientThreadName;
|
sl@0
|
96 |
inline void SetClientThreadName(const TDesC& aName) { iClientThreadName = aName; }
|
sl@0
|
97 |
#endif
|
sl@0
|
98 |
};
|
sl@0
|
99 |
|
sl@0
|
100 |
#endif
|