Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / ozone / ui / desktop_aura / window_tree_host_delegate_wayland.h
1 // Copyright 2014 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_IMPL_DESKTOP_AURA_WINDOW_TREE_HOST_DELEGATE_WAYLAND_H_
6 #define OZONE_IMPL_DESKTOP_AURA_WINDOW_TREE_HOST_DELEGATE_WAYLAND_H_
7
8 #include <list>
9 #include <string>
10 #include <vector>
11
12 #include "base/basictypes.h"
13 #include "base/message_loop/message_loop.h"
14 #include "ozone/ui/events/window_change_observer.h"
15 #include "ui/events/event.h"
16 #include "ui/events/event_source.h"
17 #include "ui/events/platform/platform_event_dispatcher.h"
18 #include "ui/gfx/native_widget_types.h"
19
20 namespace ui {
21 class OzoneWaylandWindow;
22 }
23
24 namespace views {
25
26 class DesktopWindowTreeHostOzone;
27
28 // A static class used by DesktopWindowTreeHostOzone to dispatch native events
29 // and basic window management.
30 class WindowTreeHostDelegateWayland
31     : public ui::WindowChangeObserver {
32  public:
33   WindowTreeHostDelegateWayland();
34   virtual ~WindowTreeHostDelegateWayland();
35
36   void OnRootWindowCreated(ui::OzoneWaylandWindow* window);
37   void OnRootWindowClosed(ui::OzoneWaylandWindow* window);
38
39   ui::OzoneWaylandWindow* GetWindow(unsigned handle);
40   bool HasWindowsOpen() const;
41
42  private:
43   // Window Change Observer.
44   void OnWindowFocused(unsigned handle) override;
45   void OnWindowEnter(unsigned handle) override;
46   void OnWindowLeave(unsigned handle) override;
47   void OnWindowClose(unsigned handle) override;
48   void OnWindowResized(unsigned windowhandle,
49                        unsigned width,
50                        unsigned height) override;
51   void OnWindowUnminimized(unsigned windowhandle) override;
52   void OnWindowDeActivated(unsigned windowhandle) override;
53   void OnWindowActivated(unsigned windowhandle) override;
54
55   // Dispatches a mouse event.
56   std::list<ui::OzoneWaylandWindow*>& open_windows();
57
58   // List of all open aura::Window.
59   std::list<ui::OzoneWaylandWindow*>* open_windows_;
60   DISALLOW_COPY_AND_ASSIGN(WindowTreeHostDelegateWayland);
61 };
62
63 }  // namespace views
64
65 #endif  // OZONE_IMPL_DESKTOP_AURA_WINDOW_TREE_HOST_DELEGATE_WAYLAND_H_