OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_VIEWS_WIDGET_WIDGET_H_ | 5 #ifndef CHROME_VIEWS_WIDGET_WIDGET_H_ |
6 #define CHROME_VIEWS_WIDGET_WIDGET_H_ | 6 #define CHROME_VIEWS_WIDGET_WIDGET_H_ |
7 | 7 |
8 #include "base/gfx/native_widget_types.h" | 8 #include "base/gfx/native_widget_types.h" |
9 | 9 |
10 namespace gfx { | 10 namespace gfx { |
(...skipping 26 matching lines...) Expand all Loading... |
37 public: | 37 public: |
38 virtual ~Widget() { } | 38 virtual ~Widget() { } |
39 | 39 |
40 // Returns the bounds of this Widget in the screen coordinate system. | 40 // Returns the bounds of this Widget in the screen coordinate system. |
41 // If the receiving Widget is a frame which is larger than its client area, | 41 // If the receiving Widget is a frame which is larger than its client area, |
42 // this method returns the client area if including_frame is false and the | 42 // this method returns the client area if including_frame is false and the |
43 // frame bounds otherwise. If the receiving Widget is not a frame, | 43 // frame bounds otherwise. If the receiving Widget is not a frame, |
44 // including_frame is ignored. | 44 // including_frame is ignored. |
45 virtual void GetBounds(gfx::Rect* out, bool including_frame) const = 0; | 45 virtual void GetBounds(gfx::Rect* out, bool including_frame) const = 0; |
46 | 46 |
47 // Moves this Widget to the front of the Z-Order If should_activate is TRUE, | |
48 // the window should also become the active window. | |
49 virtual void MoveToFront(bool should_activate) = 0; | |
50 | |
51 // Returns the gfx::NativeView associated with this Widget. | 47 // Returns the gfx::NativeView associated with this Widget. |
52 virtual gfx::NativeView GetNativeView() const = 0; | 48 virtual gfx::NativeView GetNativeView() const = 0; |
53 | 49 |
54 // Forces a paint of a specified rectangle immediately. | 50 // Forces a paint of a specified rectangle immediately. |
55 virtual void PaintNow(const gfx::Rect& update_rect) = 0; | 51 virtual void PaintNow(const gfx::Rect& update_rect) = 0; |
56 | 52 |
57 // Returns the RootView contained by this Widget. | 53 // Returns the RootView contained by this Widget. |
58 virtual RootView* GetRootView() = 0; | 54 virtual RootView* GetRootView() = 0; |
59 | 55 |
60 // Returns whether the Widget is visible to the user. | 56 // Returns whether the Widget is visible to the user. |
61 virtual bool IsVisible() const = 0; | 57 virtual bool IsVisible() const = 0; |
62 | 58 |
63 // Returns whether the Widget is the currently active window. | 59 // Returns whether the Widget is the currently active window. |
64 virtual bool IsActive() const = 0; | 60 virtual bool IsActive() const = 0; |
65 | 61 |
66 // Returns the TooltipManager for this Widget. If this Widget does not support | 62 // Returns the TooltipManager for this Widget. If this Widget does not support |
67 // tooltips, NULL is returned. | 63 // tooltips, NULL is returned. |
68 virtual TooltipManager* GetTooltipManager() { | 64 virtual TooltipManager* GetTooltipManager() { |
69 return NULL; | 65 return NULL; |
70 } | 66 } |
71 | 67 |
72 // Returns the accelerator given a command id. Returns false if there is | 68 // Returns the accelerator given a command id. Returns false if there is |
73 // no accelerator associated with a given id, which is a common condition. | 69 // no accelerator associated with a given id, which is a common condition. |
74 virtual bool GetAccelerator(int cmd_id, | 70 virtual bool GetAccelerator(int cmd_id, |
75 Accelerator* accelerator) = 0; | 71 Accelerator* accelerator) = 0; |
76 | 72 |
77 // Returns the Widget as a Window, if such a conversion is possible, or NULL | 73 // Returns the Window containing this Widget, or NULL if not contained in a |
78 // if it is not. | 74 // window. |
79 virtual Window* AsWindow() { return NULL; } | 75 virtual Window* GetWindow() { return NULL; } |
80 virtual const Window* AsWindow() const { return NULL; } | 76 virtual const Window* GetWindow() const { return NULL; } |
81 }; | 77 }; |
82 | 78 |
83 } // namespace views | 79 } // namespace views |
84 | 80 |
85 #endif // CHROME_VIEWS_WIDGET_WIDGET_H_ | 81 #endif // CHROME_VIEWS_WIDGET_WIDGET_H_ |
OLD | NEW |