OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 UI_AURA_WINDOW_H_ | 5 #ifndef UI_AURA_WINDOW_H_ |
6 #define UI_AURA_WINDOW_H_ | 6 #define UI_AURA_WINDOW_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 85 |
86 // Changes the visibility of the window. | 86 // Changes the visibility of the window. |
87 void Show(); | 87 void Show(); |
88 void Hide(); | 88 void Hide(); |
89 // Returns true if this window and all its ancestors are visible. | 89 // Returns true if this window and all its ancestors are visible. |
90 bool IsVisible() const; | 90 bool IsVisible() const; |
91 | 91 |
92 // Returns the window's bounds in screen coordinates. | 92 // Returns the window's bounds in screen coordinates. |
93 gfx::Rect GetScreenBounds() const; | 93 gfx::Rect GetScreenBounds() const; |
94 | 94 |
95 // Activates this window. Only top level windows can be activated. Requests | |
96 // to activate a non-top level window are ignored. | |
97 void Activate(); | |
98 | |
99 // Deactivates this window. Only top level windows can be | |
100 // deactivated. Requests to deactivate a non-top level window are ignored. | |
101 void Deactivate(); | |
102 | |
103 // Returns true if this window is active. | 95 // Returns true if this window is active. |
104 bool IsActive() const; | 96 bool IsActive() const; |
105 | 97 |
106 virtual void SetTransform(const ui::Transform& transform); | 98 virtual void SetTransform(const ui::Transform& transform); |
107 | 99 |
108 // Assigns a LayoutManager to size and place child windows. | 100 // Assigns a LayoutManager to size and place child windows. |
109 // The Window takes ownership of the LayoutManager. | 101 // The Window takes ownership of the LayoutManager. |
110 void SetLayoutManager(LayoutManager* layout_manager); | 102 void SetLayoutManager(LayoutManager* layout_manager); |
111 LayoutManager* layout_manager() { return layout_manager_.get(); } | 103 LayoutManager* layout_manager() { return layout_manager_.get(); } |
112 | 104 |
(...skipping 15 matching lines...) Expand all Loading... |
128 // the root window. | 120 // the root window. |
129 void SetParent(Window* parent); | 121 void SetParent(Window* parent); |
130 | 122 |
131 // Stacks the specified child of this Window at the front of the z-order. | 123 // Stacks the specified child of this Window at the front of the z-order. |
132 void StackChildAtTop(Window* child); | 124 void StackChildAtTop(Window* child); |
133 | 125 |
134 // Stacks |child| above |other|. Does nothing if |child| is already above | 126 // Stacks |child| above |other|. Does nothing if |child| is already above |
135 // |other|. | 127 // |other|. |
136 void StackChildAbove(Window* child, Window* other); | 128 void StackChildAbove(Window* child, Window* other); |
137 | 129 |
138 // Returns true if this window can be activated. | |
139 bool CanActivate() const; | |
140 | |
141 // Tree operations. | 130 // Tree operations. |
142 // TODO(beng): Child windows are currently not owned by the hierarchy. We | 131 // TODO(beng): Child windows are currently not owned by the hierarchy. We |
143 // should change this. | 132 // should change this. |
144 void AddChild(Window* child); | 133 void AddChild(Window* child); |
145 void RemoveChild(Window* child); | 134 void RemoveChild(Window* child); |
146 | 135 |
147 const Windows& children() const { return children_; } | 136 const Windows& children() const { return children_; } |
148 | 137 |
149 // Returns true if this Window contains |other| somewhere in its children. | 138 // Returns true if this Window contains |other| somewhere in its children. |
150 bool Contains(const Window* other) const; | 139 bool Contains(const Window* other) const; |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 // TODO(oshima): Consolidcate ViewProp and aura::window property | 339 // TODO(oshima): Consolidcate ViewProp and aura::window property |
351 // implementation. | 340 // implementation. |
352 std::map<const char*, void*> prop_map_; | 341 std::map<const char*, void*> prop_map_; |
353 | 342 |
354 DISALLOW_COPY_AND_ASSIGN(Window); | 343 DISALLOW_COPY_AND_ASSIGN(Window); |
355 }; | 344 }; |
356 | 345 |
357 } // namespace aura | 346 } // namespace aura |
358 | 347 |
359 #endif // UI_AURA_WINDOW_H_ | 348 #endif // UI_AURA_WINDOW_H_ |
OLD | NEW |