OLD | NEW |
(Empty) | |
| 1 // Copyright 2013 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 ASH_WM_OVERVIEW_WINDOW_SELECTOR_ITEM_H_ |
| 6 #define ASH_WM_OVERVIEW_WINDOW_SELECTOR_ITEM_H_ |
| 7 |
| 8 #include "base/compiler_specific.h" |
| 9 #include "ui/gfx/rect.h" |
| 10 |
| 11 namespace aura { |
| 12 class RootWindow; |
| 13 class Window; |
| 14 } |
| 15 |
| 16 namespace ash { |
| 17 |
| 18 // This class represents an item in overview mode. An item can have one or more |
| 19 // windows, of which only one can be activated by keyboard (i.e. alt+tab) but |
| 20 // any can be selected with a pointer (touch or mouse). |
| 21 class WindowSelectorItem { |
| 22 public: |
| 23 WindowSelectorItem(); |
| 24 virtual ~WindowSelectorItem(); |
| 25 |
| 26 // Returns the root window on which this item is shown. |
| 27 virtual const aura::RootWindow* GetRootWindow() const = 0; |
| 28 |
| 29 // Returns the targeted window given the event |target| window. |
| 30 // Returns NULL if no Window in this item was selected. |
| 31 virtual aura::Window* TargetedWindow(const aura::Window* target) const = 0; |
| 32 |
| 33 // Restores |window| on exiting window overview rather than returning it |
| 34 // to its previous state. |
| 35 virtual void RestoreWindowOnExit(aura::Window* window) = 0; |
| 36 |
| 37 // Returns the |window| to activate on selecting of this item. |
| 38 virtual aura::Window* SelectionWindow() const = 0; |
| 39 |
| 40 // Removes |window| from this item. Check empty() after calling this to see |
| 41 // if the entire item is now empty. |
| 42 virtual void RemoveWindow(const aura::Window* window) = 0; |
| 43 |
| 44 // Returns true if this item has no more selectable windows (i.e. after |
| 45 // calling RemoveWindow for the last contained window). |
| 46 virtual bool empty() const = 0; |
| 47 |
| 48 // Sets the bounds of this window selector item to |target_bounds| in the |
| 49 // |root_window| root window. |
| 50 void SetBounds(aura::RootWindow* root_window, |
| 51 const gfx::Rect& target_bounds); |
| 52 |
| 53 // Returns the current bounds of this selector item. |
| 54 const gfx::Rect& bounds() { return bounds_; } |
| 55 |
| 56 protected: |
| 57 virtual void SetItemBounds(aura::RootWindow* root_window, |
| 58 const gfx::Rect& target_bounds) = 0; |
| 59 |
| 60 private: |
| 61 // The bounds this item is fit to. |
| 62 gfx::Rect bounds_; |
| 63 |
| 64 DISALLOW_COPY_AND_ASSIGN(WindowSelectorItem); |
| 65 }; |
| 66 |
| 67 } // namespace ash |
| 68 |
| 69 #endif // ASH_WM_OVERVIEW_WINDOW_SELECTOR_ITEM_H_ |
OLD | NEW |