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 UI_AURA_WINDOW_H_ | 5 #ifndef UI_AURA_WINDOW_H_ |
6 #define UI_AURA_WINDOW_H_ | 6 #define UI_AURA_WINDOW_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 | 140 |
141 // Returns the window's bounds in root window's coordinates. | 141 // Returns the window's bounds in root window's coordinates. |
142 gfx::Rect GetBoundsInRootWindow() const; | 142 gfx::Rect GetBoundsInRootWindow() const; |
143 | 143 |
144 // Returns the window's bounds in screen coordinates. | 144 // Returns the window's bounds in screen coordinates. |
145 // How the root window's coordinates is mapped to screen's coordinates | 145 // How the root window's coordinates is mapped to screen's coordinates |
146 // is platform dependent and defined in the implementation of the | 146 // is platform dependent and defined in the implementation of the |
147 // |aura::client::ScreenPositionClient| interface. | 147 // |aura::client::ScreenPositionClient| interface. |
148 gfx::Rect GetBoundsInScreen() const; | 148 gfx::Rect GetBoundsInScreen() const; |
149 | 149 |
150 virtual void SetTransform(const gfx::Transform& transform); | 150 void SetTransform(const gfx::Transform& transform); |
151 | 151 |
152 // Assigns a LayoutManager to size and place child windows. | 152 // Assigns a LayoutManager to size and place child windows. |
153 // The Window takes ownership of the LayoutManager. | 153 // The Window takes ownership of the LayoutManager. |
154 void SetLayoutManager(LayoutManager* layout_manager); | 154 void SetLayoutManager(LayoutManager* layout_manager); |
155 LayoutManager* layout_manager() { return layout_manager_.get(); } | 155 LayoutManager* layout_manager() { return layout_manager_.get(); } |
156 | 156 |
157 // Sets a new event-targeter for the window, and returns the previous | 157 // Sets a new event-targeter for the window, and returns the previous |
158 // event-targeter. | 158 // event-targeter. |
159 scoped_ptr<ui::EventTargeter> SetEventTargeter( | 159 scoped_ptr<ui::EventTargeter> SetEventTargeter( |
160 scoped_ptr<ui::EventTargeter> targeter); | 160 scoped_ptr<ui::EventTargeter> targeter); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 static void ConvertRectToTarget(const Window* source, | 213 static void ConvertRectToTarget(const Window* source, |
214 const Window* target, | 214 const Window* target, |
215 gfx::Rect* rect); | 215 gfx::Rect* rect); |
216 | 216 |
217 // Moves the cursor to the specified location relative to the window. | 217 // Moves the cursor to the specified location relative to the window. |
218 virtual void MoveCursorTo(const gfx::Point& point_in_window); | 218 virtual void MoveCursorTo(const gfx::Point& point_in_window); |
219 | 219 |
220 // Returns the cursor for the specified point, in window coordinates. | 220 // Returns the cursor for the specified point, in window coordinates. |
221 gfx::NativeCursor GetCursor(const gfx::Point& point) const; | 221 gfx::NativeCursor GetCursor(const gfx::Point& point) const; |
222 | 222 |
223 // Sets an 'event filter' for the window. An 'event filter' for a Window is | |
224 // a pre-target event handler, where the window owns the handler. A window | |
225 // can have only one such event filter. Setting a new filter removes and | |
226 // destroys any previously installed filter. | |
227 void SetEventFilter(ui::EventHandler* event_filter); | |
228 | |
229 // Add/remove observer. | 223 // Add/remove observer. |
230 void AddObserver(WindowObserver* observer); | 224 void AddObserver(WindowObserver* observer); |
231 void RemoveObserver(WindowObserver* observer); | 225 void RemoveObserver(WindowObserver* observer); |
232 bool HasObserver(WindowObserver* observer); | 226 bool HasObserver(WindowObserver* observer); |
233 | 227 |
234 void set_ignore_events(bool ignore_events) { ignore_events_ = ignore_events; } | 228 void set_ignore_events(bool ignore_events) { ignore_events_ = ignore_events; } |
235 bool ignore_events() const { return ignore_events_; } | 229 bool ignore_events() const { return ignore_events_; } |
236 | 230 |
237 // Sets the window to grab hits for an area extending |insets| pixels inside | 231 // Sets the window to grab hits for an area extending |insets| pixels inside |
238 // its bounds (even if that inner region overlaps a child window). This can be | 232 // its bounds (even if that inner region overlaps a child window). This can be |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
511 bool visible_; | 505 bool visible_; |
512 | 506 |
513 int id_; | 507 int id_; |
514 std::string name_; | 508 std::string name_; |
515 | 509 |
516 base::string16 title_; | 510 base::string16 title_; |
517 | 511 |
518 // Whether layer is initialized as non-opaque. | 512 // Whether layer is initialized as non-opaque. |
519 bool transparent_; | 513 bool transparent_; |
520 | 514 |
521 scoped_ptr<ui::EventHandler> event_filter_; | |
522 scoped_ptr<LayoutManager> layout_manager_; | 515 scoped_ptr<LayoutManager> layout_manager_; |
523 scoped_ptr<ui::EventTargeter> targeter_; | 516 scoped_ptr<ui::EventTargeter> targeter_; |
524 | 517 |
525 void* user_data_; | 518 void* user_data_; |
526 | 519 |
527 // Makes the window pass all events through to any windows behind it. | 520 // Makes the window pass all events through to any windows behind it. |
528 bool ignore_events_; | 521 bool ignore_events_; |
529 | 522 |
530 // See set_hit_test_bounds_override_inner(). | 523 // See set_hit_test_bounds_override_inner(). |
531 gfx::Insets hit_test_bounds_override_inner_; | 524 gfx::Insets hit_test_bounds_override_inner_; |
(...skipping 10 matching lines...) Expand all Loading... |
542 }; | 535 }; |
543 | 536 |
544 std::map<const void*, Value> prop_map_; | 537 std::map<const void*, Value> prop_map_; |
545 | 538 |
546 DISALLOW_COPY_AND_ASSIGN(Window); | 539 DISALLOW_COPY_AND_ASSIGN(Window); |
547 }; | 540 }; |
548 | 541 |
549 } // namespace aura | 542 } // namespace aura |
550 | 543 |
551 #endif // UI_AURA_WINDOW_H_ | 544 #endif // UI_AURA_WINDOW_H_ |
OLD | NEW |