OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_ACCESSIBILITY_H_ | |
6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_ACCESSIBILITY_H_ | |
7 #pragma once | |
8 | |
9 #include <atlbase.h> | |
10 #include <atlcom.h> | |
11 #include <oleacc.h> | |
12 | |
13 #include "base/basictypes.h" | |
14 #include "base/win/scoped_comptr.h" | |
15 | |
16 class OmniboxViewWin; | |
17 | |
18 //////////////////////////////////////////////////////////////////////////////// | |
19 // | |
20 // AutocompleteAccessibility | |
21 // | |
22 // Class implementing the MSAA IAccessible COM interface for | |
23 // OmniboxViewWin, providing accessibility to be used by screen | |
24 // readers and other assistive technology (AT). | |
25 // | |
26 //////////////////////////////////////////////////////////////////////////////// | |
27 class ATL_NO_VTABLE AutocompleteAccessibility | |
28 : public CComObjectRootEx<CComMultiThreadModel>, | |
29 public IDispatchImpl<IAccessible, &IID_IAccessible, &LIBID_Accessibility> { | |
30 public: | |
31 BEGIN_COM_MAP(AutocompleteAccessibility) | |
32 COM_INTERFACE_ENTRY2(IDispatch, IAccessible) | |
33 COM_INTERFACE_ENTRY(IAccessible) | |
34 END_COM_MAP() | |
35 | |
36 AutocompleteAccessibility() {} | |
37 ~AutocompleteAccessibility() {} | |
38 | |
39 HRESULT Initialize(const OmniboxViewWin* omnibox_view); | |
40 | |
41 // Supported IAccessible methods. | |
42 | |
43 // Retrieves the number of accessible children. | |
44 STDMETHODIMP get_accChildCount(LONG* child_count); | |
45 | |
46 // Retrieves an IDispatch interface pointer for the specified child. | |
47 STDMETHODIMP get_accChild(VARIANT var_child, IDispatch** disp_child); | |
48 | |
49 // Retrieves the IDispatch interface of the object's parent. | |
50 STDMETHODIMP get_accParent(IDispatch** disp_parent); | |
51 | |
52 // Traverses to another UI element and retrieves the object. | |
53 STDMETHODIMP accNavigate(LONG nav_dir, VARIANT start, VARIANT* end); | |
54 | |
55 // Retrieves the object that has the keyboard focus. | |
56 STDMETHODIMP get_accFocus(VARIANT* focus_child); | |
57 | |
58 // Retrieves the name of the specified object. | |
59 STDMETHODIMP get_accName(VARIANT var_id, BSTR* name); | |
60 | |
61 // Retrieves the tooltip description. | |
62 STDMETHODIMP get_accDescription(VARIANT var_id, BSTR* desc); | |
63 | |
64 // Returns the current value of the edit box. | |
65 STDMETHODIMP get_accValue(VARIANT var_id, BSTR* value); | |
66 | |
67 // Retrieves the current state of the specified object. | |
68 STDMETHODIMP get_accState(VARIANT var_id, VARIANT* state); | |
69 | |
70 // Retrieves information describing the role of the specified object. | |
71 STDMETHODIMP get_accRole(VARIANT var_id, VARIANT* role); | |
72 | |
73 // Retrieves a string that describes the object's default action. | |
74 STDMETHODIMP get_accDefaultAction(VARIANT var_id, BSTR* default_action); | |
75 | |
76 // Retrieves the specified object's current screen location. | |
77 STDMETHODIMP accLocation(LONG* x_left, LONG* y_top, LONG* width, LONG* height, | |
78 VARIANT var_id); | |
79 | |
80 // Retrieves the child element or child object at a given point on the screen. | |
81 STDMETHODIMP accHitTest(LONG x_left, LONG y_top, VARIANT* child); | |
82 | |
83 // Retrieves the specified object's shortcut. | |
84 STDMETHODIMP get_accKeyboardShortcut(VARIANT var_id, BSTR* access_key); | |
85 | |
86 // Non-supported IAccessible methods. | |
87 | |
88 // Out-dated and can be safely said to be very rarely used. | |
89 STDMETHODIMP accDoDefaultAction(VARIANT var_id); | |
90 | |
91 // Selections not applicable to views. | |
92 STDMETHODIMP get_accSelection(VARIANT* selected); | |
93 STDMETHODIMP accSelect(LONG flags_sel, VARIANT var_id); | |
94 | |
95 // Help functions not supported. | |
96 STDMETHODIMP get_accHelp(VARIANT var_id, BSTR* help); | |
97 STDMETHODIMP get_accHelpTopic(BSTR* help_file, VARIANT var_id, | |
98 LONG* topic_id); | |
99 | |
100 // Deprecated functions, not implemented here. | |
101 STDMETHODIMP put_accName(VARIANT var_id, BSTR put_name); | |
102 STDMETHODIMP put_accValue(VARIANT var_id, BSTR put_val); | |
103 | |
104 protected: | |
105 // A pointer containing the Windows' default IAccessible implementation for | |
106 // this object. Used where it is acceptable to return default MSAA | |
107 // information. | |
108 base::win::ScopedComPtr<IAccessible> default_accessibility_server_; | |
109 | |
110 private: | |
111 const OmniboxViewWin* omnibox_view_; | |
112 | |
113 DISALLOW_COPY_AND_ASSIGN(AutocompleteAccessibility); | |
114 }; | |
115 | |
116 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_ACCESSIBILITY_H_ | |
OLD | NEW |