|
1 /* |
|
2 * Copyright (c) 2009-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: CDisplayServiceLight class declaration. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef DISPLAYSERVICELIGHT_H |
|
20 #define DISPLAYSERVICELIGHT_H |
|
21 |
|
22 // SYSTEM INCLUDE FILES |
|
23 #include <hwrmlight.h> |
|
24 |
|
25 // USER INCLUDE FILES |
|
26 #include "displayservicebase.h" |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 |
|
30 // DATA TYPES |
|
31 |
|
32 // CLASS DECLARATION |
|
33 |
|
34 /** |
|
35 * Display light service provides context information about |
|
36 * the display light status. |
|
37 * |
|
38 * @lib None. |
|
39 * @since S60 5.0 |
|
40 */ |
|
41 NONSHARABLE_CLASS( CDisplayServiceLight ): public CDisplayServiceBase, |
|
42 public MHWRMLightObserver |
|
43 { |
|
44 public: |
|
45 |
|
46 /** |
|
47 * Symbian two phased constructors. |
|
48 * |
|
49 * @since S60 5.0 |
|
50 * @param aCF Interface to Context Access API. |
|
51 * @return CDisplayServiceLight* |
|
52 */ |
|
53 static CDisplayServiceLight* NewL( MCFContextInterface& aCF ); |
|
54 static CDisplayServiceLight* NewLC( MCFContextInterface& aCF ); |
|
55 |
|
56 /** |
|
57 * C++ destructor. |
|
58 */ |
|
59 virtual ~CDisplayServiceLight(); |
|
60 |
|
61 public: // From base classes |
|
62 |
|
63 // @see CDisplayServiceBase |
|
64 virtual void StartL(); |
|
65 |
|
66 // @see CDisplayServiceBase |
|
67 virtual void Stop(); |
|
68 |
|
69 // @see MHWRMLightObserver |
|
70 virtual void LightStatusChanged( TInt aTarget, |
|
71 CHWRMLight::TLightStatus aStatus ); |
|
72 |
|
73 private: // New methods |
|
74 |
|
75 // Publishes the display state value |
|
76 void PublishContext( CHWRMLight::TLightStatus aStatus ); |
|
77 |
|
78 private: |
|
79 |
|
80 CDisplayServiceLight( MCFContextInterface& aCF ); |
|
81 void ConstructL(); |
|
82 |
|
83 private: // Data |
|
84 |
|
85 /** HWRM Light client connection */ |
|
86 CHWRMLight* iLight; |
|
87 |
|
88 /** Last light status stored to avoid publishing state status twice */ |
|
89 CHWRMLight::TLightStatus iCurrentStatus; |
|
90 }; |
|
91 |
|
92 #endif // DISPLAYSERVICELIGHT_H |