2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 * @author Shi Hezhang (hezhang.shi@samsung.com)
22 #ifndef WRTDEVICEAPIS_POWER_BACK_LIGHT_H_
23 #define WRTDEVICEAPIS_POWER_BACK_LIGHT_H_
27 #include <dpl/mutex.h>
28 #include <Commons/EventReceiver.h>
29 #include <Power/IBacklight.h>
30 #include <Power/Enums.h>
31 #include <VConf/Key.h>
32 #include <Elementary.h>
34 namespace WrtDeviceApis {
37 // Dummy event for asynchronous light on schedule
38 class EventLightOffTimer : public Commons::IEvent<EventLightOffTimer>
42 typedef DPL::SharedPtr<EventLightOffTimer> EventLightOffTimerPtr;
43 typedef Commons::EventRequestReceiver<EventLightOffTimer>
44 EventLightOffTimerReqReceiver;
45 typedef Commons::EventRequestReceiver<Api::EventLight> EventLightReqReceiver;
47 class Backlight : public Api::IBacklight,
48 public EventLightOffTimerReqReceiver,
49 public EventLightReqReceiver
60 * @see Api::IBacklight::changeState()
62 int changeState(Api::BacklightStatus state,
63 unsigned int timeout);
66 * @see Api::IBacklight::changeState()
68 void changeState(const Api::EventLightPtr& event);
71 void OnRequestReceived(const EventLightOffTimerPtr& event);
72 void OnRequestReceived(const Api::EventLightPtr& event);
75 int toLCDState(Api::BacklightStatus state) const;
77 typedef DPL::SharedPtr<Backlight> BacklightPtr;
82 #endif /* WRTDEVICEAPIS_POWER_BATTERY_H_ */