OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2009 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 CHROME_VIEWS_WINDOW_WINDOW_GTK_H_ |
| 6 #define CHROME_VIEWS_WINDOW_WINDOW_GTK_H_ |
| 7 |
| 8 #include "base/basictypes.h" |
| 9 #include "chrome/views/widget/widget_gtk.h" |
| 10 #include "chrome/views/window/window.h" |
| 11 |
| 12 namespace gfx { |
| 13 class Point; |
| 14 class Size; |
| 15 }; |
| 16 |
| 17 namespace views { |
| 18 |
| 19 class Client; |
| 20 class WindowDelegate; |
| 21 |
| 22 // Window implementation for GTK. |
| 23 class WindowGtk : public WidgetGtk, public Window { |
| 24 public: |
| 25 virtual ~WindowGtk(); |
| 26 |
| 27 // Window overrides: |
| 28 virtual gfx::Rect GetBounds() const; |
| 29 virtual gfx::Rect GetNormalBounds() const; |
| 30 virtual void SetBounds(const gfx::Rect& bounds); |
| 31 virtual void SetBounds(const gfx::Rect& bounds, |
| 32 gfx::NativeWindow other_window); |
| 33 virtual void Show(); |
| 34 virtual void Activate(); |
| 35 virtual void Close(); |
| 36 virtual void Maximize(); |
| 37 virtual void Minimize(); |
| 38 virtual void Restore(); |
| 39 virtual bool IsActive() const; |
| 40 virtual bool IsVisible() const; |
| 41 virtual bool IsMaximized() const; |
| 42 virtual bool IsMinimized() const; |
| 43 virtual void SetFullscreen(bool fullscreen); |
| 44 virtual bool IsFullscreen() const; |
| 45 virtual void EnableClose(bool enable); |
| 46 virtual void DisableInactiveRendering(); |
| 47 virtual void UpdateWindowTitle(); |
| 48 virtual void UpdateWindowIcon(); |
| 49 virtual NonClientFrameView* CreateFrameViewForWindow(); |
| 50 virtual void UpdateFrameAfterFrameChange(); |
| 51 virtual WindowDelegate* GetDelegate() const; |
| 52 virtual NonClientView* GetNonClientView() const; |
| 53 virtual ClientView* GetClientView() const; |
| 54 virtual gfx::NativeWindow GetNativeWindow() const; |
| 55 |
| 56 virtual Window* AsWindow() { return this; } |
| 57 virtual const Window* AsWindow() const { return this; } |
| 58 |
| 59 protected: |
| 60 // For the constructor. |
| 61 friend class Window; |
| 62 |
| 63 // Constructs the WindowGtk. |window_delegate| cannot be NULL. |
| 64 explicit WindowGtk(WindowDelegate* window_delegate); |
| 65 |
| 66 // Initializes the window to the passed in bounds. |
| 67 void Init(const gfx::Rect& bounds); |
| 68 |
| 69 private: |
| 70 // Whether or not the window is modal. This comes from the delegate and is |
| 71 // cached at Init time to avoid calling back to the delegate from the |
| 72 // destructor. |
| 73 bool is_modal_; |
| 74 |
| 75 // Whether the window is currently always on top. |
| 76 bool is_always_on_top_; |
| 77 |
| 78 // Our window delegate. |
| 79 WindowDelegate* window_delegate_; |
| 80 |
| 81 // The View that provides the non-client area of the window (title bar, |
| 82 // window controls, sizing borders etc). To use an implementation other than |
| 83 // the default, this class must be subclassed and this value set to the |
| 84 // desired implementation before calling |Init|. |
| 85 NonClientView* non_client_view_; |
| 86 |
| 87 DISALLOW_COPY_AND_ASSIGN(WindowGtk); |
| 88 }; |
| 89 |
| 90 } // namespace views |
| 91 |
| 92 #endif // CHROME_VIEWS_WINDOW_WINDOW_GTK_H_ |
OLD | NEW |