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 22 matching lines...) Expand all Loading... |
33 // communication of accessibility information, providing accessibility | 33 // communication of accessibility information, providing accessibility |
34 // to be used by screen readers and other assistive technology (AT). | 34 // to be used by screen readers and other assistive technology (AT). |
35 // | 35 // |
36 //////////////////////////////////////////////////////////////////////////////// | 36 //////////////////////////////////////////////////////////////////////////////// |
37 class __declspec(uuid("562072fe-3390-43b1-9e2c-dd4118f5ac79")) | 37 class __declspec(uuid("562072fe-3390-43b1-9e2c-dd4118f5ac79")) |
38 BrowserAccessibilityWin | 38 BrowserAccessibilityWin |
39 : public BrowserAccessibility, | 39 : public BrowserAccessibility, |
40 public CComObjectRootEx<CComMultiThreadModel>, | 40 public CComObjectRootEx<CComMultiThreadModel>, |
41 public IDispatchImpl<IAccessible2, &IID_IAccessible2, | 41 public IDispatchImpl<IAccessible2, &IID_IAccessible2, |
42 &LIBID_IAccessible2Lib>, | 42 &LIBID_IAccessible2Lib>, |
| 43 public IAccessibleHyperlink, |
| 44 public IAccessibleHypertext, |
43 public IAccessibleImage, | 45 public IAccessibleImage, |
44 public IAccessibleTable, | 46 public IAccessibleTable, |
45 public IAccessibleTable2, | 47 public IAccessibleTable2, |
46 public IAccessibleTableCell, | 48 public IAccessibleTableCell, |
47 public IAccessibleText, | |
48 public IAccessibleValue, | 49 public IAccessibleValue, |
49 public IServiceProvider, | 50 public IServiceProvider, |
50 public ISimpleDOMDocument, | 51 public ISimpleDOMDocument, |
51 public ISimpleDOMNode, | 52 public ISimpleDOMNode, |
52 public ISimpleDOMText { | 53 public ISimpleDOMText { |
53 public: | 54 public: |
54 BEGIN_COM_MAP(BrowserAccessibilityWin) | 55 BEGIN_COM_MAP(BrowserAccessibilityWin) |
55 COM_INTERFACE_ENTRY2(IDispatch, IAccessible2) | 56 COM_INTERFACE_ENTRY2(IDispatch, IAccessible2) |
56 COM_INTERFACE_ENTRY2(IAccessible, IAccessible2) | 57 COM_INTERFACE_ENTRY2(IAccessible, IAccessible2) |
| 58 COM_INTERFACE_ENTRY2(IAccessibleText, IAccessibleHypertext) |
57 COM_INTERFACE_ENTRY(IAccessible2) | 59 COM_INTERFACE_ENTRY(IAccessible2) |
| 60 COM_INTERFACE_ENTRY(IAccessibleHyperlink) |
| 61 COM_INTERFACE_ENTRY(IAccessibleHypertext) |
58 COM_INTERFACE_ENTRY(IAccessibleImage) | 62 COM_INTERFACE_ENTRY(IAccessibleImage) |
59 COM_INTERFACE_ENTRY(IAccessibleTable) | 63 COM_INTERFACE_ENTRY(IAccessibleTable) |
60 COM_INTERFACE_ENTRY(IAccessibleTable2) | 64 COM_INTERFACE_ENTRY(IAccessibleTable2) |
61 COM_INTERFACE_ENTRY(IAccessibleTableCell) | 65 COM_INTERFACE_ENTRY(IAccessibleTableCell) |
62 COM_INTERFACE_ENTRY(IAccessibleText) | |
63 COM_INTERFACE_ENTRY(IAccessibleValue) | 66 COM_INTERFACE_ENTRY(IAccessibleValue) |
64 COM_INTERFACE_ENTRY(IServiceProvider) | 67 COM_INTERFACE_ENTRY(IServiceProvider) |
65 COM_INTERFACE_ENTRY(ISimpleDOMDocument) | 68 COM_INTERFACE_ENTRY(ISimpleDOMDocument) |
66 COM_INTERFACE_ENTRY(ISimpleDOMNode) | 69 COM_INTERFACE_ENTRY(ISimpleDOMNode) |
67 COM_INTERFACE_ENTRY(ISimpleDOMText) | 70 COM_INTERFACE_ENTRY(ISimpleDOMText) |
68 END_COM_MAP() | 71 END_COM_MAP() |
69 | 72 |
| 73 // Represents a non-static text node in IAccessibleHypertext. This character |
| 74 // is embedded in the response to IAccessibleText::get_text, indicating the |
| 75 // position where a non-static text child object appears. |
| 76 static const char16 kEmbeddedCharacter[]; |
| 77 |
70 CONTENT_EXPORT BrowserAccessibilityWin(); | 78 CONTENT_EXPORT BrowserAccessibilityWin(); |
71 | 79 |
72 CONTENT_EXPORT virtual ~BrowserAccessibilityWin(); | 80 CONTENT_EXPORT virtual ~BrowserAccessibilityWin(); |
73 | 81 |
74 // | 82 // |
75 // BrowserAccessibility methods. | 83 // BrowserAccessibility methods. |
76 // | 84 // |
77 CONTENT_EXPORT virtual void Initialize(); | 85 CONTENT_EXPORT virtual void Initialize(); |
78 CONTENT_EXPORT virtual void SendNodeUpdateEvents(); | 86 CONTENT_EXPORT virtual void SendNodeUpdateEvents(); |
79 CONTENT_EXPORT virtual void NativeAddReference(); | 87 CONTENT_EXPORT virtual void NativeAddReference(); |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 return E_NOTIMPL; | 479 return E_NOTIMPL; |
472 } | 480 } |
473 CONTENT_EXPORT STDMETHODIMP scrollSubstringToPoint(LONG start_index, | 481 CONTENT_EXPORT STDMETHODIMP scrollSubstringToPoint(LONG start_index, |
474 LONG end_index, | 482 LONG end_index, |
475 enum IA2CoordinateType coordinate_type, | 483 enum IA2CoordinateType coordinate_type, |
476 LONG x, LONG y) { | 484 LONG x, LONG y) { |
477 return E_NOTIMPL; | 485 return E_NOTIMPL; |
478 } | 486 } |
479 | 487 |
480 // | 488 // |
| 489 // IAccessibleHypertext methods. |
| 490 // |
| 491 |
| 492 CONTENT_EXPORT STDMETHODIMP get_nHyperlinks(long* hyperlink_count); |
| 493 |
| 494 CONTENT_EXPORT STDMETHODIMP get_hyperlink( |
| 495 long index, |
| 496 IAccessibleHyperlink** hyperlink); |
| 497 |
| 498 CONTENT_EXPORT STDMETHODIMP get_hyperlinkIndex(long char_index, |
| 499 long* hyperlink_index); |
| 500 |
| 501 // IAccessibleHyperlink not implemented. |
| 502 CONTENT_EXPORT STDMETHODIMP get_anchor(long index, VARIANT* anchor) { |
| 503 return E_NOTIMPL; |
| 504 } |
| 505 CONTENT_EXPORT STDMETHODIMP get_anchorTarget( |
| 506 long index, |
| 507 VARIANT* anchor_target) { |
| 508 return E_NOTIMPL; |
| 509 } |
| 510 CONTENT_EXPORT STDMETHODIMP get_startIndex( long* index) { |
| 511 return E_NOTIMPL; |
| 512 } |
| 513 CONTENT_EXPORT STDMETHODIMP get_endIndex( long* index) { |
| 514 return E_NOTIMPL; |
| 515 } |
| 516 CONTENT_EXPORT STDMETHODIMP get_valid(boolean* valid) { |
| 517 return E_NOTIMPL; |
| 518 } |
| 519 |
| 520 // IAccessibleAction not implemented. |
| 521 CONTENT_EXPORT STDMETHODIMP nActions(long* n_actions) { |
| 522 return E_NOTIMPL; |
| 523 } |
| 524 CONTENT_EXPORT STDMETHODIMP doAction(long action_index) { |
| 525 return E_NOTIMPL; |
| 526 } |
| 527 CONTENT_EXPORT STDMETHODIMP get_description( |
| 528 long action_index, |
| 529 BSTR* description) { |
| 530 return E_NOTIMPL; |
| 531 } |
| 532 CONTENT_EXPORT STDMETHODIMP get_keyBinding( |
| 533 long action_index, |
| 534 long n_max_bindings, |
| 535 BSTR** key_bindings, |
| 536 long* n_bindings) { |
| 537 return E_NOTIMPL; |
| 538 } |
| 539 CONTENT_EXPORT STDMETHODIMP get_name(long action_index, BSTR* name) { |
| 540 return E_NOTIMPL; |
| 541 } |
| 542 CONTENT_EXPORT STDMETHODIMP get_localizedName( |
| 543 long action_index, |
| 544 BSTR* localized_name) { |
| 545 return E_NOTIMPL; |
| 546 } |
| 547 |
| 548 // |
481 // IAccessibleValue methods. | 549 // IAccessibleValue methods. |
482 // | 550 // |
483 | 551 |
484 CONTENT_EXPORT STDMETHODIMP get_currentValue(VARIANT* value); | 552 CONTENT_EXPORT STDMETHODIMP get_currentValue(VARIANT* value); |
485 | 553 |
486 CONTENT_EXPORT STDMETHODIMP get_minimumValue(VARIANT* value); | 554 CONTENT_EXPORT STDMETHODIMP get_minimumValue(VARIANT* value); |
487 | 555 |
488 CONTENT_EXPORT STDMETHODIMP get_maximumValue(VARIANT* value); | 556 CONTENT_EXPORT STDMETHODIMP get_maximumValue(VARIANT* value); |
489 | 557 |
490 CONTENT_EXPORT STDMETHODIMP setCurrentValue(VARIANT new_value); | 558 CONTENT_EXPORT STDMETHODIMP setCurrentValue(VARIANT new_value); |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
708 string16 previous_text_; | 776 string16 previous_text_; |
709 | 777 |
710 // The old text to return in IAccessibleText::get_oldText - this is like | 778 // The old text to return in IAccessibleText::get_oldText - this is like |
711 // previous_text_ except that it's NOT updated when the object | 779 // previous_text_ except that it's NOT updated when the object |
712 // is initialized again but the text doesn't change. | 780 // is initialized again but the text doesn't change. |
713 string16 old_text_; | 781 string16 old_text_; |
714 | 782 |
715 // Relationships between this node and other nodes. | 783 // Relationships between this node and other nodes. |
716 std::vector<BrowserAccessibilityRelation*> relations_; | 784 std::vector<BrowserAccessibilityRelation*> relations_; |
717 | 785 |
| 786 // The text of this node including embedded hyperlink characters. |
| 787 string16 hypertext_; |
| 788 |
| 789 // Maps the |hypertext_| embedded character offset to an index in |
| 790 // |hyperlinks_|. |
| 791 std::map<int32, int32> hyperlink_offset_to_index_; |
| 792 |
| 793 // Collection of non-static text child indicies, each of which corresponds to |
| 794 // a hyperlink. |
| 795 std::vector<int32> hyperlinks_; |
| 796 |
718 // Give BrowserAccessibility::Create access to our constructor. | 797 // Give BrowserAccessibility::Create access to our constructor. |
719 friend class BrowserAccessibility; | 798 friend class BrowserAccessibility; |
720 friend class BrowserAccessibilityRelation; | 799 friend class BrowserAccessibilityRelation; |
721 | 800 |
722 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityWin); | 801 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityWin); |
723 }; | 802 }; |
724 | 803 |
725 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_WIN_H_ | 804 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_WIN_H_ |
OLD | NEW |