|
1 /* |
|
2 * Copyright (c) 2006-2009 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 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 /** |
|
22 @file |
|
23 @internalTechnology |
|
24 */ |
|
25 |
|
26 #ifndef HWRMLLIGHTSTIMEOUTOBSERVER_H |
|
27 #define HWRMLLIGHTSTIMEOUTOBSERVER_H |
|
28 |
|
29 // INCLUDES |
|
30 #include <e32base.h> |
|
31 #include <centralrepository.h> |
|
32 #include "cenrepobserver.h" |
|
33 |
|
34 // CONSTANTS |
|
35 // None |
|
36 |
|
37 // MACROS |
|
38 // None |
|
39 |
|
40 // DATA TYPES |
|
41 // None |
|
42 |
|
43 // FUNCTION PROTOTYPES |
|
44 // None |
|
45 |
|
46 // FORWARD DECLARATIONS |
|
47 // None |
|
48 |
|
49 // CLASS DECLARATION |
|
50 |
|
51 /** |
|
52 * Callback interface for lights timeout change passing. |
|
53 */ |
|
54 class MHWRMLightsTimeoutObserver |
|
55 { |
|
56 public: |
|
57 |
|
58 /** |
|
59 * Notifies lights timeout changes in cenrep |
|
60 * |
|
61 * @param aTimeout the new timeout value |
|
62 */ |
|
63 virtual void LightsTimeoutChange(TInt aTimeout)=0; |
|
64 }; |
|
65 |
|
66 /** |
|
67 * This class observes lights timeout cenrep key in lights settings |
|
68 * |
|
69 */ |
|
70 class CHWRMLightsTimeoutObserver : public CBase, |
|
71 public MCenRepObserver |
|
72 { |
|
73 public: // Constructors and Destructor |
|
74 |
|
75 /** |
|
76 * Two-phased constructor. |
|
77 */ |
|
78 IMPORT_C static CHWRMLightsTimeoutObserver* NewL(MHWRMLightsTimeoutObserver* aCallback); |
|
79 |
|
80 /** |
|
81 * Destructor. |
|
82 */ |
|
83 IMPORT_C virtual ~CHWRMLightsTimeoutObserver(); |
|
84 |
|
85 public: // New functions |
|
86 |
|
87 public: // Functions from base classes |
|
88 |
|
89 // From MCenRepObserver |
|
90 void HandleNotifyInt(TUint32 aId, TInt aNewValue); |
|
91 void HandleNotifyError(TUint32 aId, TInt error, CCenRepListener* aHandler); |
|
92 |
|
93 private: |
|
94 |
|
95 /** |
|
96 * C++ default constructor. |
|
97 */ |
|
98 CHWRMLightsTimeoutObserver(); |
|
99 |
|
100 /** |
|
101 * By default Symbian 2nd phase constructor is private. |
|
102 */ |
|
103 void ConstructL(MHWRMLightsTimeoutObserver* aCallback); |
|
104 |
|
105 private: |
|
106 |
|
107 CRepository* iRepository; // Cenrep client |
|
108 CCenRepListener* iNotifyHandler; // Cenrep notifyhandler |
|
109 MHWRMLightsTimeoutObserver* iCallback; // Callback object for passing value changes. Not owned |
|
110 }; |
|
111 |
|
112 |
|
113 |
|
114 #endif // HWRMLLIGHTSTIMEOUTOBSERVER_H |
|
115 |
|
116 // End of File |