- add sources.
[platform/framework/web/crosswalk.git] / src / ui / views / widget / desktop_aura / desktop_root_window_host.h
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
3 // found in the LICENSE file.
4
5 #ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_ROOT_WINDOW_HOST_H_
6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_ROOT_WINDOW_HOST_H_
7
8 #include "base/memory/scoped_ptr.h"
9 #include "ui/aura/root_window.h"
10 #include "ui/base/ui_base_types.h"
11 #include "ui/views/views_export.h"
12 #include "ui/views/widget/widget.h"
13
14 namespace aura {
15 class RootWindowHost;
16 class Window;
17
18 namespace client {
19 class DragDropClient;
20 }
21 }
22
23 namespace gfx {
24 class ImageSkia;
25 class Rect;
26 }
27
28 namespace ui {
29 class NativeTheme;
30 }
31
32 namespace views {
33 namespace corewm {
34
35 class Tooltip;
36 }
37
38 namespace internal {
39 class NativeWidgetDelegate;
40 }
41
42 class DesktopNativeCursorManager;
43 class DesktopNativeWidgetAura;
44
45 class VIEWS_EXPORT DesktopRootWindowHost {
46  public:
47   virtual ~DesktopRootWindowHost() {}
48
49   static DesktopRootWindowHost* Create(
50       internal::NativeWidgetDelegate* native_widget_delegate,
51       DesktopNativeWidgetAura* desktop_native_widget_aura);
52
53   // Return the NativeTheme to use for |window|. WARNING: |window| may be NULL.
54   static ui::NativeTheme* GetNativeTheme(aura::Window* window);
55
56   // Sets up resources needed before the RootWindow has been created.
57   virtual void Init(aura::Window* content_window,
58                     const Widget::InitParams& params,
59                     aura::RootWindow::CreateParams* rw_create_params) = 0;
60
61   // Invoked once the RootWindow has been created. Caller owns the RootWindow.
62   virtual void OnRootWindowCreated(aura::RootWindow* root,
63                                    const Widget::InitParams& params) = 0;
64
65   // Creates and returns the Tooltip implementation to use. Return value is
66   // owned by DesktopNativeWidgetAura and lives as long as
67   // DesktopRootWindowHost.
68   virtual scoped_ptr<corewm::Tooltip> CreateTooltip() = 0;
69
70   // Creates and returns the DragDropClient implementation to use. Return value
71   // is owned by DesktopNativeWidgetAura and lives as long as
72   // DesktopRootWindowHost.
73   virtual scoped_ptr<aura::client::DragDropClient> CreateDragDropClient(
74       DesktopNativeCursorManager* cursor_manager) = 0;
75
76   virtual void Close() = 0;
77   virtual void CloseNow() = 0;
78
79   virtual aura::RootWindowHost* AsRootWindowHost() = 0;
80
81   virtual void ShowWindowWithState(ui::WindowShowState show_state) = 0;
82   virtual void ShowMaximizedWithBounds(const gfx::Rect& restored_bounds) = 0;
83
84   virtual bool IsVisible() const = 0;
85
86   virtual void SetSize(const gfx::Size& size) = 0;
87   virtual void CenterWindow(const gfx::Size& size) = 0;
88   virtual void GetWindowPlacement(gfx::Rect* bounds,
89                                   ui::WindowShowState* show_state) const = 0;
90   virtual gfx::Rect GetWindowBoundsInScreen() const = 0;
91   virtual gfx::Rect GetClientAreaBoundsInScreen() const = 0;
92   virtual gfx::Rect GetRestoredBounds() const = 0;
93
94   virtual gfx::Rect GetWorkAreaBoundsInScreen() const = 0;
95
96   // Sets the shape of the root window. If |native_region| is NULL then the
97   // window reverts to rectangular. Takes ownership of |native_region|.
98   virtual void SetShape(gfx::NativeRegion native_region) = 0;
99
100   virtual void Activate() = 0;
101   virtual void Deactivate() = 0;
102   virtual bool IsActive() const = 0;
103   virtual void Maximize() = 0;
104   virtual void Minimize() = 0;
105   virtual void Restore() = 0;
106   virtual bool IsMaximized() const = 0;
107   virtual bool IsMinimized() const = 0;
108
109   virtual bool HasCapture() const = 0;
110
111   virtual void SetAlwaysOnTop(bool always_on_top) = 0;
112   virtual bool IsAlwaysOnTop() const = 0;
113
114   virtual void SetWindowTitle(const string16& title) = 0;
115
116   virtual void ClearNativeFocus() = 0;
117
118   virtual Widget::MoveLoopResult RunMoveLoop(
119       const gfx::Vector2d& drag_offset,
120       Widget::MoveLoopSource source,
121       Widget::MoveLoopEscapeBehavior escape_behavior) = 0;
122   virtual void EndMoveLoop() = 0;
123
124   virtual void SetVisibilityChangedAnimationsEnabled(bool value) = 0;
125
126   virtual bool ShouldUseNativeFrame() = 0;
127   virtual void FrameTypeChanged() = 0;
128   virtual NonClientFrameView* CreateNonClientFrameView() = 0;
129
130   virtual void SetFullscreen(bool fullscreen) = 0;
131   virtual bool IsFullscreen() const = 0;
132
133   virtual void SetOpacity(unsigned char opacity) = 0;
134
135   virtual void SetWindowIcons(const gfx::ImageSkia& window_icon,
136                               const gfx::ImageSkia& app_icon) = 0;
137
138   virtual void InitModalType(ui::ModalType modal_type) = 0;
139
140   virtual void FlashFrame(bool flash_frame) = 0;
141
142   virtual void OnRootViewLayout() const = 0;
143
144   // Called when the DesktopNativeWidgetAura's aura::Window is focused and
145   // blurred.
146   virtual void OnNativeWidgetFocus() = 0;
147   virtual void OnNativeWidgetBlur() = 0;
148
149   // Returns true if the Widget was closed but is still showing because of
150   // animations.
151   virtual bool IsAnimatingClosed() const = 0;
152 };
153
154 }  // namespace views
155
156 #endif  // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_ROOT_WINDOW_HOST_H_