OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef ATHENA_SCREEN_PUBLIC_SCREEN_MANAGER_H_ | 5 #ifndef ATHENA_SCREEN_PUBLIC_SCREEN_MANAGER_H_ |
6 #define ATHENA_SCREEN_PUBLIC_SCREEN_MANAGER_H_ | 6 #define ATHENA_SCREEN_PUBLIC_SCREEN_MANAGER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "athena/athena_export.h" | 10 #include "athena/athena_export.h" |
11 | 11 |
12 namespace aura { | 12 namespace aura { |
13 class Window; | 13 class Window; |
14 } | 14 } |
15 | 15 |
16 namespace gfx { | 16 namespace gfx { |
17 class ImageSkia; | 17 class ImageSkia; |
| 18 class Insets; |
18 } | 19 } |
19 | 20 |
20 namespace ui { | 21 namespace ui { |
21 class LayerAnimator; | 22 class LayerAnimator; |
22 } | 23 } |
23 | 24 |
24 namespace wm { | 25 namespace wm { |
25 class FocusRules; | 26 class FocusRules; |
26 } | 27 } |
27 | 28 |
28 namespace athena { | 29 namespace athena { |
| 30 class ScreenManagerDelegate; |
29 | 31 |
30 // Mananges basic UI components on the screen such as background, and provide | 32 // Mananges basic UI components on the screen such as background, and provide |
31 // API for other UI components, such as window manager, home card, to | 33 // API for other UI components, such as window manager, home card, to |
32 // create and manage their windows on the screen. | 34 // create and manage their windows on the screen. |
33 class ATHENA_EXPORT ScreenManager { | 35 class ATHENA_EXPORT ScreenManager { |
34 public: | 36 public: |
35 struct ContainerParams { | 37 struct ContainerParams { |
36 ContainerParams(const std::string& name, int z_order_priority); | 38 ContainerParams(const std::string& name, int z_order_priority); |
37 std::string name; | 39 std::string name; |
38 | 40 |
39 // True if the container can activate its child window. | 41 // True if the container can activate its child window. |
40 bool can_activate_children; | 42 bool can_activate_children; |
41 | 43 |
42 // True if the container will grab all of input events. | 44 // True if the container will grab all of input events. |
43 bool grab_inputs; | 45 bool grab_inputs; |
44 | 46 |
45 // Defines the z_order priority of the container. | 47 // Defines the z_order priority of the container. |
46 int z_order_priority; | 48 int z_order_priority; |
47 }; | 49 }; |
48 | 50 |
49 // Creates, returns and deletes the singleton object of the ScreenManager | 51 // Creates, returns and deletes the singleton object of the ScreenManager |
50 // implementation. | 52 // implementation. |
51 static ScreenManager* Create(aura::Window* root); | 53 static ScreenManager* Create(ScreenManagerDelegate* delegate, |
| 54 aura::Window* root); |
52 static ScreenManager* Get(); | 55 static ScreenManager* Get(); |
53 static void Shutdown(); | 56 static void Shutdown(); |
54 | 57 |
55 virtual ~ScreenManager() {} | 58 virtual ~ScreenManager() {} |
56 | 59 |
| 60 // Sets the screen's work area insets. |
| 61 virtual void SetWorkAreaInsets(const gfx::Insets& insets) = 0; |
| 62 |
57 // Creates the container window that is used when creating a normal | 63 // Creates the container window that is used when creating a normal |
58 // widget without specific parent. | 64 // widget without specific parent. |
59 virtual aura::Window* CreateDefaultContainer( | 65 virtual aura::Window* CreateDefaultContainer( |
60 const ContainerParams& params) = 0; | 66 const ContainerParams& params) = 0; |
61 | 67 |
62 // Creates the container window on the screen. | 68 // Creates the container window on the screen. |
63 virtual aura::Window* CreateContainer(const ContainerParams& params) = 0; | 69 virtual aura::Window* CreateContainer(const ContainerParams& params) = 0; |
64 | 70 |
65 // Return the context object to be used for widget creation. | 71 // Return the context object to be used for widget creation. |
66 virtual aura::Window* GetContext() = 0; | 72 virtual aura::Window* GetContext() = 0; |
67 | 73 |
68 // Sets the background image. | 74 // Sets the background image. |
69 virtual void SetBackgroundImage(const gfx::ImageSkia& image) = 0; | 75 virtual void SetBackgroundImage(const gfx::ImageSkia& image) = 0; |
70 | 76 |
71 // Returns the LayerAnimator to use to animate the entire screen (e.g. fade | 77 // Returns the LayerAnimator to use to animate the entire screen (e.g. fade |
72 // screen to white). | 78 // screen to white). |
73 virtual ui::LayerAnimator* GetScreenAnimator() = 0; | 79 virtual ui::LayerAnimator* GetScreenAnimator() = 0; |
74 | 80 |
75 // Create a focus rules. | 81 // Create a focus rules. |
76 // TODO(oshima): Make this virtual function. | 82 // TODO(oshima): Make this virtual function. |
77 static wm::FocusRules* CreateFocusRules(); | 83 static wm::FocusRules* CreateFocusRules(); |
78 }; | 84 }; |
79 | 85 |
80 } // namespace athena | 86 } // namespace athena |
81 | 87 |
82 #endif // ATHENA_SCREEN_PUBLIC_SCREEN_MANAGER_H_ | 88 #endif // ATHENA_SCREEN_PUBLIC_SCREEN_MANAGER_H_ |
OLD | NEW |