Bump version to 0.127
[platform/framework/web/tizen-extensions-crosswalk.git] / power / power_instance_tizen.h
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.
4
5 #ifndef POWER_POWER_INSTANCE_TIZEN_H_
6 #define POWER_POWER_INSTANCE_TIZEN_H_
7
8 #include <power.h>
9 #include "common/extension.h"
10 #include "power/power_types.h"
11 #include "power/power_event_source_tizen.h"
12
13 namespace picojson {
14 class value;
15 }
16
17 class PowerInstanceMobile
18     : public common::Instance, public PowerEventListener {
19  public:
20   explicit PowerInstanceMobile(PowerEventSource* event_source);
21   ~PowerInstanceMobile();
22
23   void DispatchScreenStateChangedToJS(ResourceState state);
24
25  private:
26   // PowerEventListener implementation.
27   void OnPowerStateChanged(power_state_e state);
28
29   // common::Instance implementation.
30   virtual void HandleMessage(const char* msg);
31   virtual void HandleSyncMessage(const char* msg);
32
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);
40
41   bool js_listening_to_state_change_;
42   bool pending_screen_state_change_;
43   bool pending_screen_state_reply_;
44   PowerEventSource* event_source_;
45 };
46
47 #endif  // POWER_POWER_INSTANCE_TIZEN_H_