|
1 /* |
|
2 * Copyright (c) 2008 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: CTCCenrepObserver class declaration. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef TCCENREPOBSERVER_H |
|
20 #define TCCENREPOBSERVER_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <cenrepnotifyhandler.h> |
|
24 #include <centralrepository.h> |
|
25 |
|
26 /** |
|
27 * Callback interface for cenrep change passing. |
|
28 * |
|
29 * @since S60 5.0 |
|
30 */ |
|
31 class MTCCenrepObserver |
|
32 { |
|
33 public: |
|
34 |
|
35 /** |
|
36 * Notifies cenrep value change |
|
37 * |
|
38 * @param aKey The key which changed. |
|
39 */ |
|
40 virtual void CenrepValueChanged( TUint32 aKey, |
|
41 CRepository& aRepository ) = 0; |
|
42 }; |
|
43 |
|
44 /** |
|
45 * This class observes compensation parameter changes |
|
46 * |
|
47 * @since S60 5.0 |
|
48 */ |
|
49 NONSHARABLE_CLASS( CTCCenrepObserver ): public CBase, |
|
50 public MCenRepNotifyHandlerCallback |
|
51 { |
|
52 public: // Constructors and Destructor |
|
53 |
|
54 /** |
|
55 * Two-phased constructor. |
|
56 */ |
|
57 static CTCCenrepObserver* NewL( MTCCenrepObserver& aCallback ); |
|
58 |
|
59 /** |
|
60 * Destructor. |
|
61 */ |
|
62 virtual ~CTCCenrepObserver(); |
|
63 |
|
64 public: |
|
65 |
|
66 // Returns handle to repository |
|
67 CRepository& GetCenrepHandle(); |
|
68 |
|
69 // From MCenRepNotifyHandlerCallback |
|
70 void HandleNotifyGeneric( TUint32 aId ); |
|
71 void HandleNotifyError( TUint32 aKey, TInt aError, CCenRepNotifyHandler* aHandler ); |
|
72 |
|
73 private: |
|
74 |
|
75 /** |
|
76 * C++ constructors. |
|
77 */ |
|
78 CTCCenrepObserver( MTCCenrepObserver& aCallback ); |
|
79 |
|
80 /** |
|
81 * 2nd phase of construction |
|
82 */ |
|
83 void ConstructL(); |
|
84 |
|
85 private: // Data |
|
86 |
|
87 // Cenrep client. Owned. |
|
88 CRepository* iRepository; |
|
89 |
|
90 // Cenrep notifyhandler. Owned. |
|
91 CCenRepNotifyHandler* iNotifyHandler; |
|
92 |
|
93 // Callback object for passing parameter changes. |
|
94 MTCCenrepObserver& iCallback; |
|
95 }; |
|
96 |
|
97 #endif // TCCENREPOBSERVER_H |
|
98 |
|
99 // End of File |