OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 ASH_WM_PROPERTY_UTIL_H_ | 5 #ifndef ASH_WM_PROPERTY_UTIL_H_ |
6 #define ASH_WM_PROPERTY_UTIL_H_ | 6 #define ASH_WM_PROPERTY_UTIL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "ash/ash_export.h" | 9 #include "ash/ash_export.h" |
10 | 10 |
11 namespace aura { | 11 namespace aura { |
12 class Window; | 12 class Window; |
13 template<typename T> | |
14 struct WindowProperty; | |
15 } | 13 } |
16 | 14 |
17 namespace gfx { | 15 namespace gfx { |
18 class Rect; | 16 class Rect; |
19 } | 17 } |
20 | 18 |
21 namespace ash { | 19 namespace ash { |
22 | 20 |
23 // Sets the restore bounds property on |window|. Deletes existing bounds value | 21 // Sets the restore bounds property on |window|. Deletes existing bounds value |
24 // if exists. | 22 // if exists. |
25 ASH_EXPORT void SetRestoreBounds(aura::Window* window, const gfx::Rect& bounds); | 23 ASH_EXPORT void SetRestoreBounds(aura::Window* window, const gfx::Rect& bounds); |
26 | 24 |
27 // Same as SetRestoreBounds(), but does nothing if the restore bounds have | 25 // Same as SetRestoreBounds(), but does nothing if the restore bounds have |
28 // already been set. The bounds used are the bounds of the window. | 26 // already been set. The bounds used are the bounds of the window. |
29 ASH_EXPORT void SetRestoreBoundsIfNotSet(aura::Window* window); | 27 ASH_EXPORT void SetRestoreBoundsIfNotSet(aura::Window* window); |
30 | 28 |
31 // Returns the restore bounds property on |window|. NULL if the | 29 // Returns the restore bounds property on |window|. NULL if the |
32 // restore bounds property does not exist for |window|. |window| | 30 // restore bounds property does not exist for |window|. |window| |
33 // owns the bounds object. | 31 // owns the bounds object. |
34 ASH_EXPORT const gfx::Rect* GetRestoreBounds(aura::Window* window); | 32 ASH_EXPORT const gfx::Rect* GetRestoreBounds(aura::Window* window); |
35 | 33 |
36 // Deletes and clears the restore bounds property on |window|. | 34 // Deletes and clears the restore bounds property on |window|. |
37 ASH_EXPORT void ClearRestoreBounds(aura::Window* window); | 35 ASH_EXPORT void ClearRestoreBounds(aura::Window* window); |
38 | 36 |
39 // Toggles the maximized state of the specified window. | 37 // Toggles the maximized state of the specified window. |
40 ASH_EXPORT void ToggleMaximizedState(aura::Window* window); | 38 ASH_EXPORT void ToggleMaximizedState(aura::Window* window); |
41 | 39 |
42 ASH_EXPORT extern const aura::WindowProperty<bool>* const | |
43 kWindowTrackedByWorkspacePropKey; | |
44 | |
45 enum WindowPersistsAcrossAllWorkspacesType { | 40 enum WindowPersistsAcrossAllWorkspacesType { |
46 WINDOW_PERSISTS_ACROSS_ALL_WORKSPACES_VALUE_DEFAULT, | 41 WINDOW_PERSISTS_ACROSS_ALL_WORKSPACES_VALUE_DEFAULT, |
47 WINDOW_PERSISTS_ACROSS_ALL_WORKSPACES_VALUE_NO, | 42 WINDOW_PERSISTS_ACROSS_ALL_WORKSPACES_VALUE_NO, |
48 WINDOW_PERSISTS_ACROSS_ALL_WORKSPACES_VALUE_YES, | 43 WINDOW_PERSISTS_ACROSS_ALL_WORKSPACES_VALUE_YES, |
49 }; | 44 }; |
50 | 45 |
51 ASH_EXPORT extern const | |
52 aura::WindowProperty<WindowPersistsAcrossAllWorkspacesType>* const | |
53 kWindowPersistsAcrossAllWorkspacesPropKey; | |
54 | |
55 // Sets whether the specified window is tracked by workspace code. Default is | 46 // Sets whether the specified window is tracked by workspace code. Default is |
56 // true. If set to false the workspace does not switch the current workspace, | 47 // true. If set to false the workspace does not switch the current workspace, |
57 // nor does it attempt to impose constraints on the bounds of the window. This | 48 // nor does it attempt to impose constraints on the bounds of the window. This |
58 // is intended for tab dragging. | 49 // is intended for tab dragging. |
59 ASH_EXPORT void SetTrackedByWorkspace(aura::Window* window, bool value); | 50 ASH_EXPORT void SetTrackedByWorkspace(aura::Window* window, bool value); |
60 ASH_EXPORT bool GetTrackedByWorkspace(aura::Window* window); | 51 ASH_EXPORT bool GetTrackedByWorkspace(aura::Window* window); |
61 | 52 |
62 // Makes |window| persist across all workspaces. The default is controlled | 53 // Makes |window| persist across all workspaces. The default is controlled |
63 // by SetDefaultPersistsAcrossAllWorkspaces(). | 54 // by SetDefaultPersistsAcrossAllWorkspaces(). |
64 ASH_EXPORT void SetPersistsAcrossAllWorkspaces( | 55 ASH_EXPORT void SetPersistsAcrossAllWorkspaces( |
65 aura::Window* window, | 56 aura::Window* window, |
66 WindowPersistsAcrossAllWorkspacesType type); | 57 WindowPersistsAcrossAllWorkspacesType type); |
67 ASH_EXPORT bool GetPersistsAcrossAllWorkspaces(aura::Window* window); | 58 ASH_EXPORT bool GetPersistsAcrossAllWorkspaces(aura::Window* window); |
68 | 59 |
69 // Sets the default value for whether windows persist across all workspaces. | 60 // Sets the default value for whether windows persist across all workspaces. |
70 // The default is false. | 61 // The default is false. |
71 ASH_EXPORT void SetDefaultPersistsAcrossAllWorkspaces(bool value); | 62 ASH_EXPORT void SetDefaultPersistsAcrossAllWorkspaces(bool value); |
72 | 63 |
73 } | 64 } |
74 | 65 |
75 #endif // ASH_WM_PROPERTY_UTIL_H_ | 66 #endif // ASH_WM_PROPERTY_UTIL_H_ |
OLD | NEW |