Upstream version 11.39.252.0
[platform/framework/web/crosswalk.git] / src / ozone / ui / public / ozone_channel_host.h
1 // Copyright 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 OZONE_UI_PUBLIC_OZONE_CHANNEL_HOST_H_
6 #define OZONE_UI_PUBLIC_OZONE_CHANNEL_HOST_H_
7
8 #include <string>
9
10 #include "base/memory/shared_memory.h"
11 #include "ui/events/event_constants.h"
12 #include "ui/ozone/public/gpu_platform_support_host.h"
13
14 namespace ui {
15 class RemoteStateChangeHandler;
16 class EventConverterInProcess;
17
18 class OzoneChannelHost : public GpuPlatformSupportHost {
19  public:
20   OzoneChannelHost();
21   virtual ~OzoneChannelHost();
22
23   void DeleteRemoteStateChangeHandler();
24
25   // GpuPlatformSupportHost:
26   virtual void OnChannelEstablished(int host_id, IPC::Sender* sender) OVERRIDE;
27   virtual void OnChannelDestroyed(int host_id) OVERRIDE;
28   virtual bool OnMessageReceived(const IPC::Message&) OVERRIDE;
29
30   void OnMotionNotify(float x, float y);
31   void OnButtonNotify(unsigned handle,
32                       ui::EventType type,
33                       ui::EventFlags flags,
34                       float x,
35                       float y);
36   void OnTouchNotify(ui::EventType type,
37                      float x,
38                      float y,
39                      int32_t touch_id,
40                      uint32_t time_stamp);
41   void OnAxisNotify(float x, float y, int xoffset, int yoffset);
42   void OnPointerEnter(unsigned handle, float x, float y);
43   void OnPointerLeave(unsigned handle, float x, float y);
44   void OnKeyNotify(ui::EventType type, unsigned code);
45   void OnVirtualKeyNotify(ui::EventType type,
46                           uint32_t key,
47                           uint32_t modifiers);
48   void OnKeyModifiers(uint32_t mods_depressed,
49                       uint32_t mods_latched,
50                       uint32_t mods_locked,
51                       uint32_t group);
52   void OnOutputSizeChanged(unsigned width, unsigned height);
53   void OnCloseWidget(unsigned handle);
54   void OnWindowResized(unsigned handle,
55                        unsigned width,
56                        unsigned height);
57   void OnWindowUnminimized(unsigned handle);
58   void OnCommit(unsigned handle, std::string text);
59   void OnPreeditChanged(unsigned handle, std::string text, std::string commit);
60   void OnPreeditEnd();
61   void OnPreeditStart();
62   void OnInitializeXKB(base::SharedMemoryHandle fd, uint32_t size);
63
64  private:
65   RemoteStateChangeHandler* state_handler_;
66   EventConverterInProcess* event_converter_;
67   DISALLOW_COPY_AND_ASSIGN(OzoneChannelHost);
68 };
69
70 }  // namespace ui
71
72 #endif  // OZONE_UI_PUBLIC_OZONE_CHANNEL_HOST_H_