Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(317)

Unified Diff: ui/base/accessibility/accessible_text_utils.h

Issue 9958139: Add support for UIA accessibility interfaces like IAccessibleEx and IRawElementProviderSimple. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/base/accessibility/accessible_text_utils.h
===================================================================
--- ui/base/accessibility/accessible_text_utils.h (revision 130412)
+++ ui/base/accessibility/accessible_text_utils.h (working copy)
@@ -12,6 +12,12 @@
#include "base/string16.h"
#include "ui/base/ui_export.h"
+#if defined(OS_WIN)
+#include <atlbase.h>
+#include <atlcom.h>
+#include <UIAutomationCore.h>
+#endif // OS_WIN
+
namespace ui {
// Boundaries that can be passed to FindAccessibleTextBoundary,
@@ -50,6 +56,73 @@
size_t start_offset,
TextBoundaryDirection direction);
+#if defined(OS_WIN)
+// UIA Text provider implementation for edit controls.
+class UI_EXPORT UIATextProvider
dmazzoni 2012/04/04 06:02:00 After looking at this, I think a better place for
ananta 2012/04/04 19:23:00 Done. Moved the class to the new files accessibili
+ : public CComObjectRootEx<CComMultiThreadModel>,
+ public IValueProvider,
+ public ITextProvider {
+ public:
+ BEGIN_COM_MAP(UIATextProvider)
+ COM_INTERFACE_ENTRY2(IUnknown, ITextProvider)
+ COM_INTERFACE_ENTRY(IValueProvider)
+ COM_INTERFACE_ENTRY(ITextProvider)
+ END_COM_MAP()
+
+ UIATextProvider();
+
+ // Creates an instance of the UIATextProvider class.
+ // Returns true on success
+ static bool CreateTextProvider(bool editable, IUnknown** provider);
+
+ void set_editable(bool editable) {
+ editable_ = editable;
+ }
+
+ // IValueProvider methods.
+ STDMETHOD(get_IsReadOnly)(BOOL* read_only);
+
+ // IValueProvider methods not implemented.
+ STDMETHOD(SetValue)(const wchar_t* val) {
+ return E_NOTIMPL;
+ }
+
+ STDMETHOD(get_Value)(BSTR* value) {
+ return E_NOTIMPL;
+ }
+
+ // ITextProvider methods not implemented.
+ STDMETHOD(GetSelection)(SAFEARRAY** ret) {
+ return E_NOTIMPL;
+ }
+
+ STDMETHOD(GetVisibleRanges)(SAFEARRAY** ret) {
+ return E_NOTIMPL;
+ }
+
+ STDMETHOD(RangeFromChild)(IRawElementProviderSimple* child,
+ ITextRangeProvider** ret) {
+ return E_NOTIMPL;
+ }
+
+ STDMETHOD(RangeFromPoint)(struct UiaPoint point,
+ ITextRangeProvider** ret) {
+ return E_NOTIMPL;
+ }
+
+ STDMETHOD(get_DocumentRange)(ITextRangeProvider** ret) {
+ return E_NOTIMPL;
+ }
+
+ STDMETHOD(get_SupportedTextSelection)(enum SupportedTextSelection* ret) {
+ return E_NOTIMPL;
+ }
+
+ private:
+ bool editable_;
+};
+#endif // OS_WIN
+
} // namespace ui
#endif // UI_BASE_ACCESSIBILITY_ACCESSIBLE_TEXT_UTILS_H_

Powered by Google App Engine
This is Rietveld 408576698