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 CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_WIN_H_ | 5 #ifndef CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_WIN_H_ |
6 #define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_WIN_H_ | 6 #define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_WIN_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <atlbase.h> | 9 #include <atlbase.h> |
10 #include <atlcom.h> | 10 #include <atlcom.h> |
(...skipping 26 matching lines...) Expand all Loading... |
37 // communication of accessibility information, providing accessibility | 37 // communication of accessibility information, providing accessibility |
38 // to be used by screen readers and other assistive technology (AT). | 38 // to be used by screen readers and other assistive technology (AT). |
39 // | 39 // |
40 //////////////////////////////////////////////////////////////////////////////// | 40 //////////////////////////////////////////////////////////////////////////////// |
41 class __declspec(uuid("562072fe-3390-43b1-9e2c-dd4118f5ac79")) | 41 class __declspec(uuid("562072fe-3390-43b1-9e2c-dd4118f5ac79")) |
42 BrowserAccessibilityWin | 42 BrowserAccessibilityWin |
43 : public BrowserAccessibility, | 43 : public BrowserAccessibility, |
44 public CComObjectRootEx<CComMultiThreadModel>, | 44 public CComObjectRootEx<CComMultiThreadModel>, |
45 public IDispatchImpl<IAccessible2, &IID_IAccessible2, | 45 public IDispatchImpl<IAccessible2, &IID_IAccessible2, |
46 &LIBID_IAccessible2Lib>, | 46 &LIBID_IAccessible2Lib>, |
| 47 public IAccessibleHyperlink, |
| 48 public IAccessibleHypertext, |
47 public IAccessibleImage, | 49 public IAccessibleImage, |
48 public IAccessibleTable, | 50 public IAccessibleTable, |
49 public IAccessibleTable2, | 51 public IAccessibleTable2, |
50 public IAccessibleTableCell, | 52 public IAccessibleTableCell, |
51 public IAccessibleText, | |
52 public IAccessibleValue, | 53 public IAccessibleValue, |
53 public IServiceProvider, | 54 public IServiceProvider, |
54 public ISimpleDOMDocument, | 55 public ISimpleDOMDocument, |
55 public ISimpleDOMNode, | 56 public ISimpleDOMNode, |
56 public ISimpleDOMText { | 57 public ISimpleDOMText { |
57 public: | 58 public: |
58 BEGIN_COM_MAP(BrowserAccessibilityWin) | 59 BEGIN_COM_MAP(BrowserAccessibilityWin) |
59 COM_INTERFACE_ENTRY2(IDispatch, IAccessible2) | 60 COM_INTERFACE_ENTRY2(IDispatch, IAccessible2) |
60 COM_INTERFACE_ENTRY2(IAccessible, IAccessible2) | 61 COM_INTERFACE_ENTRY2(IAccessible, IAccessible2) |
| 62 COM_INTERFACE_ENTRY2(IAccessibleText, IAccessibleHypertext) |
61 COM_INTERFACE_ENTRY(IAccessible2) | 63 COM_INTERFACE_ENTRY(IAccessible2) |
| 64 COM_INTERFACE_ENTRY(IAccessibleHyperlink) |
| 65 COM_INTERFACE_ENTRY(IAccessibleHypertext) |
62 COM_INTERFACE_ENTRY(IAccessibleImage) | 66 COM_INTERFACE_ENTRY(IAccessibleImage) |
63 COM_INTERFACE_ENTRY(IAccessibleTable) | 67 COM_INTERFACE_ENTRY(IAccessibleTable) |
64 COM_INTERFACE_ENTRY(IAccessibleTable2) | 68 COM_INTERFACE_ENTRY(IAccessibleTable2) |
65 COM_INTERFACE_ENTRY(IAccessibleTableCell) | 69 COM_INTERFACE_ENTRY(IAccessibleTableCell) |
66 COM_INTERFACE_ENTRY(IAccessibleText) | |
67 COM_INTERFACE_ENTRY(IAccessibleValue) | 70 COM_INTERFACE_ENTRY(IAccessibleValue) |
68 COM_INTERFACE_ENTRY(IServiceProvider) | 71 COM_INTERFACE_ENTRY(IServiceProvider) |
69 COM_INTERFACE_ENTRY(ISimpleDOMDocument) | 72 COM_INTERFACE_ENTRY(ISimpleDOMDocument) |
70 COM_INTERFACE_ENTRY(ISimpleDOMNode) | 73 COM_INTERFACE_ENTRY(ISimpleDOMNode) |
71 COM_INTERFACE_ENTRY(ISimpleDOMText) | 74 COM_INTERFACE_ENTRY(ISimpleDOMText) |
72 END_COM_MAP() | 75 END_COM_MAP() |
73 | 76 |
| 77 // Represents a non-static text node in IAccessibleHypertext. This character |
| 78 // is embedded in the response to IAccessibleText::get_text, indicating the |
| 79 // position where a non-static text child object appears. |
| 80 static const char16 kEmbeddedCharacter[]; |
| 81 |
74 CONTENT_EXPORT BrowserAccessibilityWin(); | 82 CONTENT_EXPORT BrowserAccessibilityWin(); |
75 | 83 |
76 CONTENT_EXPORT virtual ~BrowserAccessibilityWin(); | 84 CONTENT_EXPORT virtual ~BrowserAccessibilityWin(); |
77 | 85 |
78 // | 86 // |
79 // BrowserAccessibility methods. | 87 // BrowserAccessibility methods. |
80 // | 88 // |
81 CONTENT_EXPORT virtual void Initialize(); | 89 CONTENT_EXPORT virtual void PreInitialize(); |
82 CONTENT_EXPORT virtual void SendNodeUpdateEvents(); | 90 CONTENT_EXPORT virtual void PostInitialize(); |
83 CONTENT_EXPORT virtual void NativeAddReference(); | 91 CONTENT_EXPORT virtual void NativeAddReference(); |
84 CONTENT_EXPORT virtual void NativeReleaseReference(); | 92 CONTENT_EXPORT virtual void NativeReleaseReference(); |
85 | 93 |
86 // | 94 // |
87 // IAccessible methods. | 95 // IAccessible methods. |
88 // | 96 // |
89 | 97 |
90 // Performs the default action on a given object. | 98 // Performs the default action on a given object. |
91 CONTENT_EXPORT STDMETHODIMP accDoDefaultAction(VARIANT var_id); | 99 CONTENT_EXPORT STDMETHODIMP accDoDefaultAction(VARIANT var_id); |
92 | 100 |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 return E_NOTIMPL; | 486 return E_NOTIMPL; |
479 } | 487 } |
480 CONTENT_EXPORT STDMETHODIMP scrollSubstringToPoint(LONG start_index, | 488 CONTENT_EXPORT STDMETHODIMP scrollSubstringToPoint(LONG start_index, |
481 LONG end_index, | 489 LONG end_index, |
482 enum IA2CoordinateType coordinate_type, | 490 enum IA2CoordinateType coordinate_type, |
483 LONG x, LONG y) { | 491 LONG x, LONG y) { |
484 return E_NOTIMPL; | 492 return E_NOTIMPL; |
485 } | 493 } |
486 | 494 |
487 // | 495 // |
| 496 // IAccessibleHypertext methods. |
| 497 // |
| 498 |
| 499 CONTENT_EXPORT STDMETHODIMP get_nHyperlinks(long* hyperlink_count); |
| 500 |
| 501 CONTENT_EXPORT STDMETHODIMP get_hyperlink( |
| 502 long index, |
| 503 IAccessibleHyperlink** hyperlink); |
| 504 |
| 505 CONTENT_EXPORT STDMETHODIMP get_hyperlinkIndex(long char_index, |
| 506 long* hyperlink_index); |
| 507 |
| 508 // IAccessibleHyperlink not implemented. |
| 509 CONTENT_EXPORT STDMETHODIMP get_anchor(long index, VARIANT* anchor) { |
| 510 return E_NOTIMPL; |
| 511 } |
| 512 CONTENT_EXPORT STDMETHODIMP get_anchorTarget( |
| 513 long index, |
| 514 VARIANT* anchor_target) { |
| 515 return E_NOTIMPL; |
| 516 } |
| 517 CONTENT_EXPORT STDMETHODIMP get_startIndex( long* index) { |
| 518 return E_NOTIMPL; |
| 519 } |
| 520 CONTENT_EXPORT STDMETHODIMP get_endIndex( long* index) { |
| 521 return E_NOTIMPL; |
| 522 } |
| 523 CONTENT_EXPORT STDMETHODIMP get_valid(boolean* valid) { |
| 524 return E_NOTIMPL; |
| 525 } |
| 526 |
| 527 // IAccessibleAction not implemented. |
| 528 CONTENT_EXPORT STDMETHODIMP nActions(long* n_actions) { |
| 529 return E_NOTIMPL; |
| 530 } |
| 531 CONTENT_EXPORT STDMETHODIMP doAction(long action_index) { |
| 532 return E_NOTIMPL; |
| 533 } |
| 534 CONTENT_EXPORT STDMETHODIMP get_description( |
| 535 long action_index, |
| 536 BSTR* description) { |
| 537 return E_NOTIMPL; |
| 538 } |
| 539 CONTENT_EXPORT STDMETHODIMP get_keyBinding( |
| 540 long action_index, |
| 541 long n_max_bindings, |
| 542 BSTR** key_bindings, |
| 543 long* n_bindings) { |
| 544 return E_NOTIMPL; |
| 545 } |
| 546 CONTENT_EXPORT STDMETHODIMP get_name(long action_index, BSTR* name) { |
| 547 return E_NOTIMPL; |
| 548 } |
| 549 CONTENT_EXPORT STDMETHODIMP get_localizedName( |
| 550 long action_index, |
| 551 BSTR* localized_name) { |
| 552 return E_NOTIMPL; |
| 553 } |
| 554 |
| 555 // |
488 // IAccessibleValue methods. | 556 // IAccessibleValue methods. |
489 // | 557 // |
490 | 558 |
491 CONTENT_EXPORT STDMETHODIMP get_currentValue(VARIANT* value); | 559 CONTENT_EXPORT STDMETHODIMP get_currentValue(VARIANT* value); |
492 | 560 |
493 CONTENT_EXPORT STDMETHODIMP get_minimumValue(VARIANT* value); | 561 CONTENT_EXPORT STDMETHODIMP get_minimumValue(VARIANT* value); |
494 | 562 |
495 CONTENT_EXPORT STDMETHODIMP get_maximumValue(VARIANT* value); | 563 CONTENT_EXPORT STDMETHODIMP get_maximumValue(VARIANT* value); |
496 | 564 |
497 CONTENT_EXPORT STDMETHODIMP setCurrentValue(VARIANT new_value); | 565 CONTENT_EXPORT STDMETHODIMP setCurrentValue(VARIANT new_value); |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
718 string16 previous_text_; | 786 string16 previous_text_; |
719 | 787 |
720 // The old text to return in IAccessibleText::get_oldText - this is like | 788 // The old text to return in IAccessibleText::get_oldText - this is like |
721 // previous_text_ except that it's NOT updated when the object | 789 // previous_text_ except that it's NOT updated when the object |
722 // is initialized again but the text doesn't change. | 790 // is initialized again but the text doesn't change. |
723 string16 old_text_; | 791 string16 old_text_; |
724 | 792 |
725 // Relationships between this node and other nodes. | 793 // Relationships between this node and other nodes. |
726 std::vector<BrowserAccessibilityRelation*> relations_; | 794 std::vector<BrowserAccessibilityRelation*> relations_; |
727 | 795 |
| 796 // The text of this node including embedded hyperlink characters. |
| 797 string16 hypertext_; |
| 798 |
| 799 // Maps the |hypertext_| embedded character offset to an index in |
| 800 // |hyperlinks_|. |
| 801 std::map<int32, int32> hyperlink_offset_to_index_; |
| 802 |
| 803 // Collection of non-static text child indicies, each of which corresponds to |
| 804 // a hyperlink. |
| 805 std::vector<int32> hyperlinks_; |
| 806 |
728 // Give BrowserAccessibility::Create access to our constructor. | 807 // Give BrowserAccessibility::Create access to our constructor. |
729 friend class BrowserAccessibility; | 808 friend class BrowserAccessibility; |
730 friend class BrowserAccessibilityRelation; | 809 friend class BrowserAccessibilityRelation; |
731 | 810 |
732 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityWin); | 811 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityWin); |
733 }; | 812 }; |
734 | 813 |
735 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_WIN_H_ | 814 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_WIN_H_ |
OLD | NEW |