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.
5 #ifndef UI_PLATFORM_WINDOW_PLATFORM_WINDOW_H_
6 #define UI_PLATFORM_WINDOW_PLATFORM_WINDOW_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "ui/base/cursor/cursor.h"
17 class PlatformWindowDelegate;
21 // Each instance of PlatformWindow represents a single window in the
22 // underlying platform windowing system (i.e. X11/Win/OSX).
23 class PlatformWindow {
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
35 virtual ~PlatformWindow() {}
37 virtual void InitPlatformWindow(PlatformWindowType type,
38 gfx::AcceleratedWidget parent_window) { }
40 virtual void Show() = 0;
41 virtual void Hide() = 0;
42 virtual void Close() = 0;
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;
49 virtual void SetCapture() = 0;
50 virtual void ReleaseCapture() = 0;
52 virtual void ToggleFullscreen() = 0;
53 virtual void Maximize() = 0;
54 virtual void Minimize() = 0;
55 virtual void Restore() = 0;
57 virtual void SetCursor(PlatformCursor cursor) = 0;
58 virtual void MoveCursorTo(const gfx::Point& location) = 0;
63 #endif // UI_PLATFORM_WINDOW_PLATFORM_WINDOW_H_