equal
deleted
inserted
replaced
14 * Description: Activity Manager |
14 * Description: Activity Manager |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 #include <e32base.h> |
18 #include <e32base.h> |
|
19 #include <hwrmlight.h> |
19 |
20 |
20 #ifndef TMACTIVITYMANAGER_H |
21 #ifndef TMACTIVITYMANAGER_H |
21 #define TMACTIVITYMANAGER_H |
22 #define TMACTIVITYMANAGER_H |
22 |
23 |
23 |
24 |
24 class MTMActivityManagerObserver |
25 class MTMActivityManagerObserver |
25 |
26 |
26 { |
27 { |
27 public : |
28 public : |
28 virtual void ActivityDetected() = 0; |
29 virtual void ActivityChanged(const TBool aActive) = 0; |
29 virtual void InactivityDetected() = 0; |
|
30 }; |
30 }; |
31 |
31 |
32 |
32 |
33 class CTMActivityManager : public CActive |
33 class CTMActivityManager : public CActive, |
|
34 public MHWRMLightObserver |
34 |
35 |
35 { |
36 { |
36 public: |
37 public: |
37 |
38 |
38 /** |
39 /** |
51 virtual ~CTMActivityManager(); |
52 virtual ~CTMActivityManager(); |
52 void SetTimeout(TInt aTimeout); |
53 void SetTimeout(TInt aTimeout); |
53 void Start(); |
54 void Start(); |
54 void Reset(); |
55 void Reset(); |
55 void Stop(); |
56 void Stop(); |
|
57 TBool IsInactive(); |
56 |
58 |
57 |
59 |
58 protected: // from CActive |
60 protected: // from CActive |
59 void DoCancel(); |
61 void DoCancel(); |
60 void RunL(); |
62 void RunL(); |
61 TInt RunError(TInt aError); |
63 TInt RunError(TInt aError); |
62 |
64 |
63 protected: |
65 protected: |
64 CTMActivityManager(MTMActivityManagerObserver* aObserver, TInt aTimeout); |
66 CTMActivityManager(MTMActivityManagerObserver* aObserver, TInt aTimeout); |
65 void ConstructL(); |
67 void ConstructL(); |
66 |
68 void NotifyObserver(); |
67 |
69 |
|
70 private: //From MHWRMLightObserver |
|
71 void LightStatusChanged(TInt aTarget, CHWRMLight::TLightStatus aStatus); |
|
72 |
68 protected: |
73 protected: |
69 enum TWatch { ENone = 0, EWaitingForInactivity, EWaitingForActivity }; |
74 enum TWatch { ENone = 0, EWaitingForInactivity, EWaitingForActivity }; |
70 |
75 |
71 protected: |
76 protected: |
72 RTimer iTimer; |
77 RTimer iTimer; |
73 TWatch iWatch; |
78 TWatch iWatch; |
74 MTMActivityManagerObserver* iObserver; ///The observer of activity status |
79 MTMActivityManagerObserver* iObserver; ///The observer of activity status |
75 TInt iTimeout; ///Current inactivity period |
80 TInt iTimeout; ///Current inactivity period |
|
81 |
|
82 //Backlight control |
|
83 CHWRMLight* iLight; |
|
84 //backlight status |
|
85 TBool iLights; |
76 |
86 |
|
87 //previous status |
|
88 TInt iPreviousStatus; |
|
89 TBool iFirstRound; |
77 }; |
90 }; |
78 |
91 |
79 #endif // TMACTIVITYMANAGER_H |
92 #endif // TMACTIVITYMANAGER_H |