|
1 /* |
|
2 * Copyright (c) 2007 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: This file defines class CFSMailLedHandler. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __FSMAIL_LED_HANDLER_H__ |
|
20 #define __FSMAIL_LED_HANDLER_H__ |
|
21 |
|
22 #include "fsnotificationhandlerbase.h" |
|
23 #include "fsnotificationhandlertimerobserver.h" |
|
24 |
|
25 class CFSNotificationHandlerTimer; |
|
26 |
|
27 |
|
28 // Define startup Max retry counter for trying to get LED property |
|
29 // value before assuming that the LED is not supported |
|
30 const TInt KMaxLedRetry = 5; |
|
31 |
|
32 |
|
33 /** |
|
34 * Class to handle email led turning on. |
|
35 * A handler for observing inputs into email framework, turning on the |
|
36 * Email LED if a message addition is performed on a Inbox folder. |
|
37 * |
|
38 * @code |
|
39 * ?good_class_usage_example(s) |
|
40 * @endcode |
|
41 * |
|
42 * @lib ?library |
|
43 * @since S60 ?S60_version *** for example, S60 v3.0 |
|
44 */ |
|
45 class CFSMailLedHandler : public CFSNotificationHandlerBase, |
|
46 public MFSNotificationHandlerTimerObserver |
|
47 { |
|
48 public: |
|
49 |
|
50 enum TState |
|
51 { |
|
52 EStarting, |
|
53 ESupportLED, |
|
54 ENotSupportLED |
|
55 }; |
|
56 |
|
57 /** |
|
58 * Two-phased constructor. |
|
59 * @param aOwner Owner and manager of this handler. |
|
60 */ |
|
61 static CFSMailLedHandler* NewL( MFSNotificationHandlerMgr& aOwner ); |
|
62 /** |
|
63 * Destructor. |
|
64 */ |
|
65 virtual ~CFSMailLedHandler(); |
|
66 |
|
67 // From base class MFSNotificationHandlerTimerObserver |
|
68 virtual void TimerCallBackL( TInt aError ); |
|
69 |
|
70 // from base class CFSNotificationHandlerBase |
|
71 virtual void HandleEventL( |
|
72 TFSMailEvent aEvent, |
|
73 TFSMailMsgId aMailbox, |
|
74 TAny* aParam1, |
|
75 TAny* aParam2, |
|
76 TAny* aParam3 ); |
|
77 |
|
78 private: |
|
79 |
|
80 /** |
|
81 * Constructor. |
|
82 * |
|
83 * @since S60 ?S60_version |
|
84 * @param aOwner Owner and manager of this handler. |
|
85 */ |
|
86 CFSMailLedHandler( MFSNotificationHandlerMgr& aOwner ); |
|
87 void ConstructL(); |
|
88 |
|
89 |
|
90 // from base class CFSNotificationHandlerBase |
|
91 virtual void TurnNotificationOn(); |
|
92 virtual void TurnNotificationOff(); |
|
93 |
|
94 private: // data |
|
95 |
|
96 TState iState; |
|
97 TInt iRetryCount; |
|
98 |
|
99 /** |
|
100 * Timer service. |
|
101 * Own. |
|
102 */ |
|
103 CFSNotificationHandlerTimer* iTimer; |
|
104 |
|
105 }; |
|
106 |
|
107 |
|
108 #endif //__FSMAIL_LED_HANDLER_H__ |