1 // Copyright (c) 2013 Intel Corporation. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef POWER_POWER_INSTANCE_TIZEN_H_
6 #define POWER_POWER_INSTANCE_TIZEN_H_
9 #include "common/extension.h"
10 #include "power/power_types.h"
11 #include "power/power_event_source_tizen.h"
17 class PowerInstanceMobile
18 : public common::Instance, public PowerEventListener {
20 explicit PowerInstanceMobile(PowerEventSource* event_source);
21 ~PowerInstanceMobile();
23 void DispatchScreenStateChangedToJS(ResourceState state);
26 // PowerEventListener implementation.
27 void OnPowerStateChanged(power_state_e state);
29 // common::Instance implementation.
30 virtual void HandleMessage(const char* msg);
31 virtual void HandleSyncMessage(const char* msg);
33 void HandleRequest(const picojson::value& msg);
34 void HandleRelease(const picojson::value& msg);
35 void HandleSetScreenBrightness(const picojson::value& msg);
36 void HandleGetScreenBrightness();
37 void HandleSetScreenEnabled(const picojson::value& msg);
38 void HandleGetScreenState();
39 void HandleSetListenToScreenStateChange(const picojson::value& msg);
41 bool js_listening_to_state_change_;
42 bool pending_screen_state_change_;
43 bool pending_screen_state_reply_;
44 PowerEventSource* event_source_;
47 #endif // POWER_POWER_INSTANCE_TIZEN_H_