cc:Stop incrementing while loop when iterator at the end
[chromium-blink-merge.git] / ui / platform_window / platform_window.h
blob67d32069a419aa742178bf72b4a0f613e73000e8
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"
11 namespace gfx {
12 class Rect;
15 namespace ui {
17 class PlatformImeController;
18 class PlatformWindowDelegate;
20 // Platform window.
22 // Each instance of PlatformWindow represents a single window in the
23 // underlying platform windowing system (i.e. X11/Win/OSX).
24 class PlatformWindow {
25 public:
26 virtual ~PlatformWindow() {}
28 virtual void Show() = 0;
29 virtual void Hide() = 0;
30 virtual void Close() = 0;
32 // Sets and gets the bounds of the platform-window. Note that the bounds is in
33 // physical pixel coordinates.
34 virtual void SetBounds(const gfx::Rect& bounds) = 0;
35 virtual gfx::Rect GetBounds() = 0;
37 virtual void SetCapture() = 0;
38 virtual void ReleaseCapture() = 0;
40 virtual void ToggleFullscreen() = 0;
41 virtual void Maximize() = 0;
42 virtual void Minimize() = 0;
43 virtual void Restore() = 0;
45 virtual void SetCursor(PlatformCursor cursor) = 0;
47 // Moves the cursor to |location|. Location is in platform window coordinates.
48 virtual void MoveCursorTo(const gfx::Point& location) = 0;
50 // Confines the cursor to |bounds| when it is in the platform window. |bounds|
51 // is in platform window coordinates.
52 virtual void ConfineCursorToBounds(const gfx::Rect& bounds) = 0;
54 // The PlatformImeController is owned by the PlatformWindow, the ownership is
55 // not transferred.
56 virtual PlatformImeController* GetPlatformImeController() = 0;
59 } // namespace ui
61 #endif // UI_PLATFORM_WINDOW_PLATFORM_WINDOW_H_