|
1 /* |
|
2 * Copyright (c) 2009-2010 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 * Listens for changes in one CommsDat table through CenRep. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef CMMDBCHANGELISTENER_H_ |
|
21 #define CMMDBCHANGELISTENER_H_ |
|
22 |
|
23 #include <e32base.h> |
|
24 |
|
25 class CCmmListenerManager; |
|
26 class CRepository; |
|
27 |
|
28 // Stop requesting new notifications after this many consecutive errors |
|
29 const TInt KCmmCenRepErrorThreshold = 50; |
|
30 |
|
31 |
|
32 NONSHARABLE_CLASS( CCmmDbChangeListener ) : public CActive |
|
33 { |
|
34 public: |
|
35 static CCmmDbChangeListener* NewL( |
|
36 CCmmListenerManager* aListenerManager, |
|
37 TUint32 aTableId ); |
|
38 |
|
39 static CCmmDbChangeListener* NewLC( |
|
40 CCmmListenerManager* aListenerManager, |
|
41 TUint32 aTableId ); |
|
42 |
|
43 virtual ~CCmmDbChangeListener(); |
|
44 |
|
45 private: |
|
46 CCmmDbChangeListener( |
|
47 CCmmListenerManager* aListenerManager, |
|
48 TUint32 aTableId ); |
|
49 |
|
50 void ConstructL(); |
|
51 |
|
52 public: |
|
53 TUint32 GetTableId(); |
|
54 TInt Start(); |
|
55 |
|
56 private: // Methods from base class |
|
57 void DoCancel(); |
|
58 void RunL(); // Don't leave, or implement RunError() //TODO, implement RunError() |
|
59 |
|
60 private: |
|
61 TInt RequestNotification(); |
|
62 |
|
63 private: |
|
64 // Manager object that handles all similar listeners. |
|
65 CCmmListenerManager* iListenerManager; // Not owned |
|
66 |
|
67 // Central Repository handle. |
|
68 CRepository* iRepository; // Owned |
|
69 |
|
70 // Table ID of the commsdat table to be listened. |
|
71 TUint32 iTableId; |
|
72 |
|
73 // Safeguard in case of CenRep errors. |
|
74 TInt iErrorCounter; |
|
75 }; |
|
76 |
|
77 #endif // CMMDBCHANGELISTENER_H_ |
|
78 |
|
79 // End of file |