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.
5 #ifndef OZONE_UI_EVENTS_WINDOW_STATE_CHANGE_HANDLER_H_
6 #define OZONE_UI_EVENTS_WINDOW_STATE_CHANGE_HANDLER_H_
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"
15 // A simple interface for passing Window state change notifications coming from
17 class OZONE_WAYLAND_EXPORT WindowStateChangeHandler {
19 WindowStateChangeHandler();
20 virtual ~WindowStateChangeHandler();
22 // Returns the static instance last set using SetInstance().
23 static WindowStateChangeHandler* GetInstance();
25 // Sets the implementation delegate. Ownership is retained by the caller.
26 static void SetInstance(WindowStateChangeHandler* instance);
28 // Called when AcceleratedWidget widget state has changed.
29 virtual void SetWidgetState(unsigned widget,
30 ui::WidgetState state) = 0;
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;
37 // This is called when we want to create an AcceleratedWidget widget.
38 virtual void CreateWidget(unsigned handle,
42 ui::WidgetType type) = 0;
45 static WindowStateChangeHandler* impl_; // not owned
50 #endif // OZONE_UI_EVENTS_WINDOW_STATE_CHANGE_HANDLER_H_