Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / ozone / ui / events / window_state_change_handler.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_WINDOW_STATE_CHANGE_HANDLER_H_
6 #define OZONE_UI_EVENTS_WINDOW_STATE_CHANGE_HANDLER_H_
7
8 #include "base/basictypes.h"
9 #include "base/strings/string16.h"
10 #include "ozone/platform/ozone_export_wayland.h"
11 #include "ozone/ui/events/window_constants.h"
12
13 namespace ui {
14
15 // A simple interface for passing Window state change notifications coming from
16 // Aura to Wayland.
17 class OZONE_WAYLAND_EXPORT WindowStateChangeHandler {
18  public:
19   WindowStateChangeHandler();
20   virtual ~WindowStateChangeHandler();
21
22   // Returns the static instance last set using SetInstance().
23   static WindowStateChangeHandler* GetInstance();
24
25   // Sets the implementation delegate. Ownership is retained by the caller.
26   static void SetInstance(WindowStateChangeHandler* instance);
27
28   // Called when AcceleratedWidget widget state has changed.
29   virtual void SetWidgetState(unsigned widget,
30                               ui::WidgetState state) = 0;
31
32   // Called when AcceleratedWidget widget title has changed.
33   virtual void SetWidgetTitle(unsigned widget, const base::string16& title) = 0;
34   // Called when Cursor has changed and the image needs to be updated.
35   virtual void SetWidgetCursor(int cursor_type) = 0;
36
37   // This is called when we want to create an AcceleratedWidget widget.
38   virtual void CreateWidget(unsigned handle,
39                             unsigned parent,
40                             unsigned x,
41                             unsigned y,
42                             ui::WidgetType type) = 0;
43
44  private:
45   static WindowStateChangeHandler* impl_;  // not owned
46 };
47
48 }  // namespace ui
49
50 #endif  // OZONE_UI_EVENTS_WINDOW_STATE_CHANGE_HANDLER_H_