Upstream version 11.40.277.0
[platform/framework/web/crosswalk.git] / src / ui / platform_window / platform_window.h
1 // Copyright 2014 The Chromium Authors. 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 UI_PLATFORM_WINDOW_PLATFORM_WINDOW_H_
6 #define UI_PLATFORM_WINDOW_PLATFORM_WINDOW_H_
7
8 #include "base/memory/scoped_ptr.h"
9 #include "ui/base/cursor/cursor.h"
10
11 namespace gfx {
12 class Rect;
13 }
14
15 namespace ui {
16
17 class PlatformWindowDelegate;
18
19 // Platform window.
20 //
21 // Each instance of PlatformWindow represents a single window in the
22 // underlying platform windowing system (i.e. X11/Win/OSX).
23 class PlatformWindow {
24  public:
25   enum PlatformWindowType {
26     PLATFORM_WINDOW_UNKNOWN,
27     PLATFORM_WINDOW_TYPE_TOOLTIP,
28     PLATFORM_WINDOW_TYPE_POPUP,
29     PLATFORM_WINDOW_TYPE_MENU,
30     PLATFORM_WINDOW_TYPE_BUBBLE,
31     PLATFORM_WINDOW_TYPE_WINDOW,
32     PLATFORM_WINDOW_TYPE_WINDOW_FRAMELESS
33   };
34
35   virtual ~PlatformWindow() {}
36
37   virtual void InitPlatformWindow(PlatformWindowType type,
38                                   gfx::AcceleratedWidget parent_window) { }
39
40   virtual void Show() = 0;
41   virtual void Hide() = 0;
42   virtual void Close() = 0;
43
44   // Sets and gets the bounds of the platform-window. Note that the bounds is in
45   // physical pixel coordinates.
46   virtual void SetBounds(const gfx::Rect& bounds) = 0;
47   virtual gfx::Rect GetBounds() = 0;
48
49   virtual void SetCapture() = 0;
50   virtual void ReleaseCapture() = 0;
51
52   virtual void ToggleFullscreen() = 0;
53   virtual void Maximize() = 0;
54   virtual void Minimize() = 0;
55   virtual void Restore() = 0;
56
57   virtual void SetCursor(PlatformCursor cursor) = 0;
58   virtual void MoveCursorTo(const gfx::Point& location) = 0;
59 };
60
61 }  // namespace ui
62
63 #endif  // UI_PLATFORM_WINDOW_PLATFORM_WINDOW_H_