Upstream version 11.40.277.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   void OnChannelEstablished(int host_id, IPC::Sender* sender) override;
27   void OnChannelDestroyed(int host_id) override;
28   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 OnWindowActivated(unsigned handle);
59   void OnWindowDeActivated(unsigned handle);
60
61   void OnCommit(unsigned handle, std::string text);
62   void OnPreeditChanged(unsigned handle, std::string text, std::string commit);
63   void OnPreeditEnd();
64   void OnPreeditStart();
65   void OnInitializeXKB(base::SharedMemoryHandle fd, uint32_t size);
66
67  private:
68   RemoteStateChangeHandler* state_handler_;
69   EventConverterInProcess* event_converter_;
70   DISALLOW_COPY_AND_ASSIGN(OzoneChannelHost);
71 };
72
73 }  // namespace ui
74
75 #endif  // OZONE_UI_PUBLIC_OZONE_CHANNEL_HOST_H_