Upstream version 8.37.180.0
[platform/framework/web/crosswalk.git] / src / ozone / ui / events / event_factory_ozone_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_UI_EVENTS_EVENT_FACTORY_OZONE_WAYLAND_H_
6 #define OZONE_UI_EVENTS_EVENT_FACTORY_OZONE_WAYLAND_H_
7
8 #include "ozone/ui/events/event_converter_ozone_wayland.h"
9 #include "ozone/platform/ozone_export_wayland.h"
10 #include "ui/ozone/public/event_factory_ozone.h"
11
12 namespace ui {
13
14 class WindowChangeObserver;
15 class OutputChangeObserver;
16
17 class OZONE_WAYLAND_EXPORT EventFactoryOzoneWayland : public EventFactoryOzone {
18  public:
19   EventFactoryOzoneWayland();
20   virtual ~EventFactoryOzoneWayland();
21
22   // Returns the static instance last set using SetInstance().
23   static EventFactoryOzoneWayland* GetInstance();
24
25   // Sets the implementation delegate. Ownership is retained by the caller.
26   static void SetInstance(EventFactoryOzoneWayland* instance);
27
28   // Sets the window change observer. Ownership is retained by the caller.
29   void SetWindowChangeObserver(WindowChangeObserver* observer);
30   WindowChangeObserver* GetWindowChangeObserver() const;
31   // Sets the output change observer. Ownership is retained by the caller.
32   void SetOutputChangeObserver(OutputChangeObserver* observer);
33   // Registered OutputChangeObserver. Ownership is not passed to the caller.
34   OutputChangeObserver* GetOutputChangeObserver() const;
35   void SetEventConverterOzoneWayland(EventConverterOzoneWayland* converter);
36   // EventConverter used to convert native input events to |ui::Event|.
37   // Ownership is not passed to the caller.
38   EventConverterOzoneWayland* EventConverter() const;
39
40  protected:
41   EventConverterOzoneWayland* event_converter_;
42   WindowChangeObserver* observer_;
43   OutputChangeObserver* output_observer_;
44   static EventFactoryOzoneWayland* impl_;  // not owned
45 };
46
47 }  // namespace ui
48
49 #endif  // OZONE_UI_EVENTS_EVENT_FACTORY_OZONE_WAYLAND_H_