1 // Copyright (c) 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.
5 #ifndef CHROME_BROWSER_UI_PANELS_NATIVE_PANEL_STACK_WINDOW_H_
6 #define CHROME_BROWSER_UI_PANELS_NATIVE_PANEL_STACK_WINDOW_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "base/strings/string16.h"
17 class NativePanelStackWindowDelegate
{
19 // Returns the title representing the whole stack.
20 virtual string16
GetTitle() const = 0;
22 // Called when the batch bounds update is completed, i.e. animation ends.
23 virtual void PanelBoundsBatchUpdateCompleted() = 0;
26 // An interface that encapsulates the platform-specific behaviors that are
27 // needed to support multiple panels that are stacked together. A native
28 // window might be created to enclose all the panels in the stack. The lifetime
29 // of the class that implements this interface is managed by itself.
30 class NativePanelStackWindow
{
32 // Creates and returns a NativePanelStackWindow instance. Calling Close() will
33 // destruct the instance.
34 static NativePanelStackWindow
* Create(
35 NativePanelStackWindowDelegate
* delegate
);
37 virtual ~NativePanelStackWindow() {}
39 virtual bool IsMinimized() const = 0;
42 friend class StackedPanelCollection
;
44 // Called when the stack is to be closed. This will cause this instance to be
45 // self destructed after the native window closes.
46 virtual void Close() = 0;
48 // Makes |panel| be enclosed by this stack window.
50 // Adds |panel| to the set of panels grouped and shown inside this stack
51 // Window. It does not take ownership of |panel|.
52 virtual void AddPanel(Panel
* panel
) = 0;
54 // Removes |panel| from the set of panels grouped and shown inside this stack
56 virtual void RemovePanel(Panel
* panel
) = 0;
58 // Merges those panels grouped and shown inside |another| stack window into
59 // the set of panels grouped and shown inside this stack window.
60 virtual void MergeWith(NativePanelStackWindow
* another
) = 0;
62 // Returns true if no panel is being shown inside this stack window.
63 virtual bool IsEmpty() const = 0;
65 // Returns true if |panel| is being enclosed by this stack window.
66 virtual bool HasPanel(Panel
* panel
) const = 0;
68 // Moves all panels instantly by |delta|. All the moves should be done
70 virtual void MovePanelsBy(const gfx::Vector2d
& delta
) = 0;
72 // Changes the bounds of a set of panels synchronously.
73 virtual void BeginBatchUpdatePanelBounds(bool animate
) = 0;
74 virtual void AddPanelBoundsForBatchUpdate(Panel
* panel
,
75 const gfx::Rect
& new_bounds
) = 0;
76 virtual void EndBatchUpdatePanelBounds() = 0;
78 // Returns true if some panels within this stack window are still in the
79 // process of bounds animation.
80 virtual bool IsAnimatingPanelBounds() const = 0;
82 // Minimizes all the panels in the stack as a whole via system.
83 virtual void Minimize() = 0;
85 // Draws or clears the attention via system. The system might choose to
86 // flash the taskbar icon for attention.
87 virtual void DrawSystemAttention(bool draw_attention
) = 0;
89 // Called when the panel is activated.
90 virtual void OnPanelActivated(Panel
* panel
) = 0;
93 #endif // CHROME_BROWSER_UI_PANELS_NATIVE_PANEL_STACK_WINDOW_H_