OLD | NEW |
| (Empty) |
1 // Copyright (c) 2011 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_AURA_DESKTOP_HOST_H_ | |
6 #define UI_AURA_DESKTOP_HOST_H_ | |
7 #pragma once | |
8 | |
9 #include "base/message_loop.h" | |
10 #include "ui/aura/cursor.h" | |
11 #include "ui/gfx/native_widget_types.h" | |
12 | |
13 namespace gfx { | |
14 class Point; | |
15 class Rect; | |
16 class Size; | |
17 } | |
18 | |
19 namespace aura { | |
20 | |
21 class Desktop; | |
22 | |
23 // DesktopHost bridges between a native window and the embedded Desktop. It | |
24 // provides the accelerated widget and maps events from the native os to aura. | |
25 class DesktopHost : public MessageLoop::Dispatcher { | |
26 public: | |
27 virtual ~DesktopHost() {} | |
28 | |
29 // Creates a new DesktopHost. The caller owns the returned value. | |
30 static DesktopHost* Create(const gfx::Rect& bounds); | |
31 | |
32 // Returns the actual size of the screen. | |
33 // (gfx::Screen only reports on the virtual desktop exposed by Aura.) | |
34 static gfx::Size GetNativeScreenSize(); | |
35 | |
36 // Sets the Desktop this DesktopHost is hosting. DesktopHost does not own the | |
37 // Desktop. | |
38 virtual void SetDesktop(Desktop* desktop) = 0; | |
39 | |
40 // Returns the accelerated widget. | |
41 virtual gfx::AcceleratedWidget GetAcceleratedWidget() = 0; | |
42 | |
43 // Shows the DesktopHost. | |
44 virtual void Show() = 0; | |
45 | |
46 // Toggles the host's full screen state. | |
47 virtual void ToggleFullScreen() = 0; | |
48 | |
49 // Gets/Sets the size of the DesktopHost. | |
50 virtual gfx::Size GetSize() const = 0; | |
51 virtual void SetSize(const gfx::Size& size) = 0; | |
52 | |
53 // Returns the location of the desktop on native screen. | |
54 virtual gfx::Point GetLocationOnNativeScreen() const = 0; | |
55 | |
56 // Sets the currently displayed cursor. | |
57 virtual void SetCursor(gfx::NativeCursor cursor) = 0; | |
58 | |
59 // Queries the mouse's current position relative to the host window. | |
60 // The position is constrained within the host window. | |
61 // You should probably call Desktop::last_mouse_location() instead; this | |
62 // method can be expensive. | |
63 virtual gfx::Point QueryMouseLocation() = 0; | |
64 | |
65 // Posts |native_event| to the platform's event queue. | |
66 virtual void PostNativeEvent(const base::NativeEvent& native_event) = 0; | |
67 }; | |
68 | |
69 } // namespace aura | |
70 | |
71 #endif // UI_AURA_DESKTOP_HOST_H_ | |
OLD | NEW |