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 CONTENT_EXPORT 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 378 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 get_characterExtents(LONG offset, | 481 CONTENT_EXPORT STDMETHODIMP get_characterExtents(LONG offset, |
474 enum IA2CoordinateType coord_type, | 482 enum IA2CoordinateType coord_type, |
475 LONG* x, LONG* y, | 483 LONG* x, LONG* y, |
476 LONG* width, LONG* height) { | 484 LONG* width, LONG* height) { |
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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
714 // previous_text_ except that it's NOT updated when the object | 782 // previous_text_ except that it's NOT updated when the object |
715 // is initialized again but the text doesn't change. | 783 // is initialized again but the text doesn't change. |
716 string16 old_text_; | 784 string16 old_text_; |
717 | 785 |
718 // The previous state, used to see if there was a state change. | 786 // The previous state, used to see if there was a state change. |
719 int32 old_ia_state_; | 787 int32 old_ia_state_; |
720 | 788 |
721 // Relationships between this node and other nodes. | 789 // Relationships between this node and other nodes. |
722 std::vector<BrowserAccessibilityRelation*> relations_; | 790 std::vector<BrowserAccessibilityRelation*> relations_; |
723 | 791 |
| 792 // The text of this node including embedded hyperlink characters. |
| 793 string16 hypertext_; |
| 794 |
| 795 // Maps the |hypertext_| embedded character offset to an index in |
| 796 // |hyperlinks_|. |
| 797 std::map<int32, int32> hyperlink_offset_to_index_; |
| 798 |
| 799 // Collection of non-static text child indicies, each of which corresponds to |
| 800 // a hyperlink. |
| 801 std::vector<int32> hyperlinks_; |
| 802 |
724 // Give BrowserAccessibility::Create access to our constructor. | 803 // Give BrowserAccessibility::Create access to our constructor. |
725 friend class BrowserAccessibility; | 804 friend class BrowserAccessibility; |
726 friend class BrowserAccessibilityRelation; | 805 friend class BrowserAccessibilityRelation; |
727 | 806 |
728 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityWin); | 807 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityWin); |
729 }; | 808 }; |
730 | 809 |
731 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_WIN_H_ | 810 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_WIN_H_ |
OLD | NEW |