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 CHROME_BROWSER_UI_PANELS_PANEL_STRIP_H_ | 5 #ifndef CHROME_BROWSER_UI_PANELS_PANEL_STRIP_H_ |
6 #define CHROME_BROWSER_UI_PANELS_PANEL_STRIP_H_ | 6 #define CHROME_BROWSER_UI_PANELS_PANEL_STRIP_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "ui/gfx/rect.h" | 9 #include "ui/gfx/rect.h" |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 | 29 |
30 // Updates the positioning of all panels in the collection, usually as | 30 // Updates the positioning of all panels in the collection, usually as |
31 // a result of removing or resizing a panel in collection. | 31 // a result of removing or resizing a panel in collection. |
32 virtual void RefreshLayout() = 0; | 32 virtual void RefreshLayout() = 0; |
33 | 33 |
34 // Adds |panel| to the collection of panels. | 34 // Adds |panel| to the collection of panels. |
35 virtual void AddPanel(Panel* panel) = 0; | 35 virtual void AddPanel(Panel* panel) = 0; |
36 | 36 |
37 // Removes |panel| from the collection of panels. Invoked asynchronously | 37 // Removes |panel| from the collection of panels. Invoked asynchronously |
38 // after a panel has been closed. | 38 // after a panel has been closed. |
39 // Returns |false| if the panel is not in the strip. | 39 virtual void RemovePanel(Panel* panel) = 0; |
40 virtual bool RemovePanel(Panel* panel) = 0; | |
41 | 40 |
42 // Closes all panels in the collection. Panels will be removed after closing. | 41 // Closes all panels in the collection. Panels will be removed after closing. |
43 virtual void CloseAll() = 0; | 42 virtual void CloseAll() = 0; |
44 | 43 |
45 // Resizes the |panel| to the |preferred_window_size| and updates the layout | 44 // Resizes the |panel| to the |preferred_window_size| and updates the layout |
46 // of other panels in the collection accordingly. | 45 // of other panels in the collection accordingly. |
47 // |preferred_window_size| is the outer dimensions of the window, not | 46 // |preferred_window_size| is the outer dimensions of the window, not |
48 // the content area, and is in screen coordinates. | 47 // the content area, and is in screen coordinates. |
49 // The preferred size may be adjusted to fit layout constraints. | 48 // The preferred size may be adjusted to fit layout constraints. |
50 virtual void ResizePanelWindow(Panel* panel, | 49 virtual void ResizePanelWindow(Panel* panel, |
51 const gfx::Size& preferred_window_size) = 0; | 50 const gfx::Size& preferred_window_size) = 0; |
52 | 51 |
53 // Invoked when the draw attention state of the panel has changed. | 52 // Invoked when the draw attention state of the panel has changed. |
54 // Subclass should update the display of the panel to match the new | 53 // Subclass should update the display of the panel to match the new |
55 // draw attention state. | 54 // draw attention state. |
56 virtual void OnPanelAttentionStateChanged(Panel* panel) = 0; | 55 virtual void OnPanelAttentionStateChanged(Panel* panel) = 0; |
57 | 56 |
58 // Updates the display to show |panel| as active. | 57 // Updates the display to show |panel| as active. |
59 virtual void ActivatePanel(Panel* panel) = 0; | 58 virtual void ActivatePanel(Panel* panel) = 0; |
60 | 59 |
61 // Updates the display to show |panel| as minimized/restored. | 60 // Updates the display to show |panel| as minimized/restored. |
62 virtual void MinimizePanel(Panel* panel) = 0; | 61 virtual void MinimizePanel(Panel* panel) = 0; |
63 virtual void RestorePanel(Panel* panel) = 0; | 62 virtual void RestorePanel(Panel* panel) = 0; |
64 | 63 |
| 64 virtual bool IsPanelMinimized(const Panel* panel) const = 0; |
| 65 |
65 // Returns true if |panel| can be shown as active. | 66 // Returns true if |panel| can be shown as active. |
66 virtual bool CanShowPanelAsActive(const Panel* panel) const = 0; | 67 virtual bool CanShowPanelAsActive(const Panel* panel) const = 0; |
67 | 68 |
68 // Returns true if |panel| is draggable. | 69 // Returns true if |panel| is draggable. |
69 virtual bool CanDragPanel(const Panel* panel) const = 0; | 70 virtual bool CanDragPanel(const Panel* panel) const = 0; |
70 | 71 |
71 // Drags |panel| in the bounds of this strip. | 72 // Drags |panel| in the bounds of this strip. |
72 virtual void StartDraggingPanel(Panel* panel) = 0; | 73 virtual void StartDraggingPanel(Panel* panel) = 0; |
73 // |delta_x| and |delta_y| denotes how much the mouse has been moved since | 74 // |delta_x| and |delta_y| denotes how much the mouse has been moved since |
74 // last time when DragPanel or StartDraggingPanel is called. | 75 // last time when DragPanel or StartDraggingPanel is called. |
75 virtual void DragPanel(Panel* panel, int delta_x, int delta_y) = 0; | 76 virtual void DragPanel(Panel* panel, int delta_x, int delta_y) = 0; |
76 virtual void EndDraggingPanel(Panel* panel, bool cancelled) = 0; | 77 virtual void EndDraggingPanel(Panel* panel, bool cancelled) = 0; |
77 | 78 |
78 protected: | 79 protected: |
79 explicit PanelStrip(Type type); | 80 explicit PanelStrip(Type type); |
80 virtual ~PanelStrip(); | 81 virtual ~PanelStrip(); |
81 | 82 |
82 const Type type_; // Type of this panel strip. | 83 const Type type_; // Type of this panel strip. |
83 }; | 84 }; |
84 | 85 |
85 #endif // CHROME_BROWSER_UI_PANELS_PANEL_STRIP_H_ | 86 #endif // CHROME_BROWSER_UI_PANELS_PANEL_STRIP_H_ |
OLD | NEW |