OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 VIEWS_VIEWS_DELEGATE_H_ | 5 #ifndef VIEWS_VIEWS_DELEGATE_H_ |
6 #define VIEWS_VIEWS_DELEGATE_H_ | 6 #define VIEWS_VIEWS_DELEGATE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #if defined(OS_WIN) | 10 #if defined(OS_WIN) |
11 #include <windows.h> | 11 #include <windows.h> |
12 #endif | 12 #endif |
13 | 13 |
14 #include "ui/base/accessibility/accessibility_types.h" | 14 #include "ui/base/accessibility/accessibility_types.h" |
| 15 #include "ui/base/ui_base_types.h" |
15 #include "views/views_export.h" | 16 #include "views/views_export.h" |
16 | 17 |
17 namespace gfx { | 18 namespace gfx { |
18 class Rect; | 19 class Rect; |
19 } | 20 } |
20 | 21 |
21 namespace ui { | 22 namespace ui { |
22 class Clipboard; | 23 class Clipboard; |
23 } | 24 } |
24 | 25 |
(...skipping 14 matching lines...) Expand all Loading... |
39 | 40 |
40 // Gets the clipboard. | 41 // Gets the clipboard. |
41 virtual ui::Clipboard* GetClipboard() const = 0; | 42 virtual ui::Clipboard* GetClipboard() const = 0; |
42 | 43 |
43 // Returns the View that all synthetic widgets created without a specified | 44 // Returns the View that all synthetic widgets created without a specified |
44 // parent will be parented to if they do not specify a parent in their | 45 // parent will be parented to if they do not specify a parent in their |
45 // InitParams, or NULL if they should have no parent. | 46 // InitParams, or NULL if they should have no parent. |
46 // TODO(beng): perhaps this should be a Widget. | 47 // TODO(beng): perhaps this should be a Widget. |
47 virtual View* GetDefaultParentView() = 0; | 48 virtual View* GetDefaultParentView() = 0; |
48 | 49 |
49 // Saves the position, size and maximized state for the window with the | 50 // Saves the position, size and "show" state for the window with the |
50 // specified name. | 51 // specified name. |
51 virtual void SaveWindowPlacement(const Widget* widget, | 52 virtual void SaveWindowPlacement(const Widget* widget, |
52 const std::wstring& window_name, | 53 const std::wstring& window_name, |
53 const gfx::Rect& bounds, | 54 const gfx::Rect& bounds, |
54 bool maximized) = 0; | 55 ui::WindowShowState show_state) = 0; |
55 | 56 |
56 // Retrieves the saved position and size for the window with the specified | 57 // Retrieves the saved position and size and "show" state for the window with |
57 // name. | 58 // the specified name. |
58 virtual bool GetSavedWindowBounds(const std::wstring& window_name, | 59 virtual bool GetSavedWindowPlacement( |
59 gfx::Rect* bounds) const = 0; | 60 const std::wstring& window_name, |
60 | 61 gfx::Rect* bounds, |
61 // Retrieves the saved maximized state for the window with the specified | 62 ui::WindowShowState* show_state) const = 0; |
62 // name. | |
63 virtual bool GetSavedMaximizedState(const std::wstring& window_name, | |
64 bool* maximized) const = 0; | |
65 | 63 |
66 virtual void NotifyAccessibilityEvent( | 64 virtual void NotifyAccessibilityEvent( |
67 views::View* view, ui::AccessibilityTypes::Event event_type) = 0; | 65 views::View* view, ui::AccessibilityTypes::Event event_type) = 0; |
68 | 66 |
69 // For accessibility, notify the delegate that a menu item was focused | 67 // For accessibility, notify the delegate that a menu item was focused |
70 // so that alternate feedback (speech / magnified text) can be provided. | 68 // so that alternate feedback (speech / magnified text) can be provided. |
71 virtual void NotifyMenuItemFocused( | 69 virtual void NotifyMenuItemFocused( |
72 const std::wstring& menu_name, | 70 const std::wstring& menu_name, |
73 const std::wstring& menu_item_name, | 71 const std::wstring& menu_item_name, |
74 int item_index, | 72 int item_index, |
(...skipping 13 matching lines...) Expand all Loading... |
88 // Converts views::Event::flags to a WindowOpenDisposition. | 86 // Converts views::Event::flags to a WindowOpenDisposition. |
89 virtual int GetDispositionForEvent(int event_flags) = 0; | 87 virtual int GetDispositionForEvent(int event_flags) = 0; |
90 | 88 |
91 // The active ViewsDelegate used by the views system. | 89 // The active ViewsDelegate used by the views system. |
92 static ViewsDelegate* views_delegate; | 90 static ViewsDelegate* views_delegate; |
93 }; | 91 }; |
94 | 92 |
95 } // namespace views | 93 } // namespace views |
96 | 94 |
97 #endif // VIEWS_VIEWS_DELEGATE_H_ | 95 #endif // VIEWS_VIEWS_DELEGATE_H_ |
OLD | NEW |