MD Downloads: prevent search text from overlapping with the cancel search (X)
[chromium-blink-merge.git] / ui / platform_window / platform_window.h
bloba8fd6ee37fe49e33298142daac59b2cabb9254be
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 "base/strings/string16.h"
10 #include "ui/base/cursor/cursor.h"
12 namespace gfx {
13 class Rect;
16 namespace ui {
18 class PlatformImeController;
19 class PlatformWindowDelegate;
21 // Platform window.
23 // Each instance of PlatformWindow represents a single window in the
24 // underlying platform windowing system (i.e. X11/Win/OSX).
25 class PlatformWindow {
26 public:
27 virtual ~PlatformWindow() {}
29 virtual void Show() = 0;
30 virtual void Hide() = 0;
31 virtual void Close() = 0;
33 // Sets and gets the bounds of the platform-window. Note that the bounds is in
34 // physical pixel coordinates.
35 virtual void SetBounds(const gfx::Rect& bounds) = 0;
36 virtual gfx::Rect GetBounds() = 0;
38 virtual void SetTitle(const base::string16& title) = 0;
40 virtual void SetCapture() = 0;
41 virtual void ReleaseCapture() = 0;
43 virtual void ToggleFullscreen() = 0;
44 virtual void Maximize() = 0;
45 virtual void Minimize() = 0;
46 virtual void Restore() = 0;
48 virtual void SetCursor(PlatformCursor cursor) = 0;
50 // Moves the cursor to |location|. Location is in platform window coordinates.
51 virtual void MoveCursorTo(const gfx::Point& location) = 0;
53 // Confines the cursor to |bounds| when it is in the platform window. |bounds|
54 // is in platform window coordinates.
55 virtual void ConfineCursorToBounds(const gfx::Rect& bounds) = 0;
57 // The PlatformImeController is owned by the PlatformWindow, the ownership is
58 // not transferred.
59 virtual PlatformImeController* GetPlatformImeController() = 0;
62 } // namespace ui
64 #endif // UI_PLATFORM_WINDOW_PLATFORM_WINDOW_H_