| 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, | |
| 49 public IAccessibleImage, | 47 public IAccessibleImage, |
| 50 public IAccessibleTable, | 48 public IAccessibleTable, |
| 51 public IAccessibleTable2, | 49 public IAccessibleTable2, |
| 52 public IAccessibleTableCell, | 50 public IAccessibleTableCell, |
| 51 public IAccessibleText, |
| 53 public IAccessibleValue, | 52 public IAccessibleValue, |
| 54 public IServiceProvider, | 53 public IServiceProvider, |
| 55 public ISimpleDOMDocument, | 54 public ISimpleDOMDocument, |
| 56 public ISimpleDOMNode, | 55 public ISimpleDOMNode, |
| 57 public ISimpleDOMText { | 56 public ISimpleDOMText { |
| 58 public: | 57 public: |
| 59 BEGIN_COM_MAP(BrowserAccessibilityWin) | 58 BEGIN_COM_MAP(BrowserAccessibilityWin) |
| 60 COM_INTERFACE_ENTRY2(IDispatch, IAccessible2) | 59 COM_INTERFACE_ENTRY2(IDispatch, IAccessible2) |
| 61 COM_INTERFACE_ENTRY2(IAccessible, IAccessible2) | 60 COM_INTERFACE_ENTRY2(IAccessible, IAccessible2) |
| 62 COM_INTERFACE_ENTRY2(IAccessibleText, IAccessibleHypertext) | |
| 63 COM_INTERFACE_ENTRY(IAccessible2) | 61 COM_INTERFACE_ENTRY(IAccessible2) |
| 64 COM_INTERFACE_ENTRY(IAccessibleHyperlink) | |
| 65 COM_INTERFACE_ENTRY(IAccessibleHypertext) | |
| 66 COM_INTERFACE_ENTRY(IAccessibleImage) | 62 COM_INTERFACE_ENTRY(IAccessibleImage) |
| 67 COM_INTERFACE_ENTRY(IAccessibleTable) | 63 COM_INTERFACE_ENTRY(IAccessibleTable) |
| 68 COM_INTERFACE_ENTRY(IAccessibleTable2) | 64 COM_INTERFACE_ENTRY(IAccessibleTable2) |
| 69 COM_INTERFACE_ENTRY(IAccessibleTableCell) | 65 COM_INTERFACE_ENTRY(IAccessibleTableCell) |
| 66 COM_INTERFACE_ENTRY(IAccessibleText) |
| 70 COM_INTERFACE_ENTRY(IAccessibleValue) | 67 COM_INTERFACE_ENTRY(IAccessibleValue) |
| 71 COM_INTERFACE_ENTRY(IServiceProvider) | 68 COM_INTERFACE_ENTRY(IServiceProvider) |
| 72 COM_INTERFACE_ENTRY(ISimpleDOMDocument) | 69 COM_INTERFACE_ENTRY(ISimpleDOMDocument) |
| 73 COM_INTERFACE_ENTRY(ISimpleDOMNode) | 70 COM_INTERFACE_ENTRY(ISimpleDOMNode) |
| 74 COM_INTERFACE_ENTRY(ISimpleDOMText) | 71 COM_INTERFACE_ENTRY(ISimpleDOMText) |
| 75 END_COM_MAP() | 72 END_COM_MAP() |
| 76 | 73 |
| 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 | |
| 82 CONTENT_EXPORT BrowserAccessibilityWin(); | 74 CONTENT_EXPORT BrowserAccessibilityWin(); |
| 83 | 75 |
| 84 CONTENT_EXPORT virtual ~BrowserAccessibilityWin(); | 76 CONTENT_EXPORT virtual ~BrowserAccessibilityWin(); |
| 85 | 77 |
| 86 // | 78 // |
| 87 // BrowserAccessibility methods. | 79 // BrowserAccessibility methods. |
| 88 // | 80 // |
| 89 CONTENT_EXPORT virtual void PreInitialize(); | 81 CONTENT_EXPORT virtual void Initialize(); |
| 90 CONTENT_EXPORT virtual void PostInitialize(); | 82 CONTENT_EXPORT virtual void SendNodeUpdateEvents(); |
| 91 CONTENT_EXPORT virtual void NativeAddReference(); | 83 CONTENT_EXPORT virtual void NativeAddReference(); |
| 92 CONTENT_EXPORT virtual void NativeReleaseReference(); | 84 CONTENT_EXPORT virtual void NativeReleaseReference(); |
| 93 | 85 |
| 94 // | 86 // |
| 95 // IAccessible methods. | 87 // IAccessible methods. |
| 96 // | 88 // |
| 97 | 89 |
| 98 // Performs the default action on a given object. | 90 // Performs the default action on a given object. |
| 99 CONTENT_EXPORT STDMETHODIMP accDoDefaultAction(VARIANT var_id); | 91 CONTENT_EXPORT STDMETHODIMP accDoDefaultAction(VARIANT var_id); |
| 100 | 92 |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 return E_NOTIMPL; | 471 return E_NOTIMPL; |
| 480 } | 472 } |
| 481 CONTENT_EXPORT STDMETHODIMP get_characterExtents(LONG offset, | 473 CONTENT_EXPORT STDMETHODIMP get_characterExtents(LONG offset, |
| 482 enum IA2CoordinateType coord_type, | 474 enum IA2CoordinateType coord_type, |
| 483 LONG* x, LONG* y, | 475 LONG* x, LONG* y, |
| 484 LONG* width, LONG* height) { | 476 LONG* width, LONG* height) { |
| 485 return E_NOTIMPL; | 477 return E_NOTIMPL; |
| 486 } | 478 } |
| 487 | 479 |
| 488 // | 480 // |
| 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 // | |
| 549 // IAccessibleValue methods. | 481 // IAccessibleValue methods. |
| 550 // | 482 // |
| 551 | 483 |
| 552 CONTENT_EXPORT STDMETHODIMP get_currentValue(VARIANT* value); | 484 CONTENT_EXPORT STDMETHODIMP get_currentValue(VARIANT* value); |
| 553 | 485 |
| 554 CONTENT_EXPORT STDMETHODIMP get_minimumValue(VARIANT* value); | 486 CONTENT_EXPORT STDMETHODIMP get_minimumValue(VARIANT* value); |
| 555 | 487 |
| 556 CONTENT_EXPORT STDMETHODIMP get_maximumValue(VARIANT* value); | 488 CONTENT_EXPORT STDMETHODIMP get_maximumValue(VARIANT* value); |
| 557 | 489 |
| 558 CONTENT_EXPORT STDMETHODIMP setCurrentValue(VARIANT new_value); | 490 CONTENT_EXPORT STDMETHODIMP setCurrentValue(VARIANT new_value); |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 782 // previous_text_ except that it's NOT updated when the object | 714 // previous_text_ except that it's NOT updated when the object |
| 783 // is initialized again but the text doesn't change. | 715 // is initialized again but the text doesn't change. |
| 784 string16 old_text_; | 716 string16 old_text_; |
| 785 | 717 |
| 786 // The previous state, used to see if there was a state change. | 718 // The previous state, used to see if there was a state change. |
| 787 int32 old_ia_state_; | 719 int32 old_ia_state_; |
| 788 | 720 |
| 789 // Relationships between this node and other nodes. | 721 // Relationships between this node and other nodes. |
| 790 std::vector<BrowserAccessibilityRelation*> relations_; | 722 std::vector<BrowserAccessibilityRelation*> relations_; |
| 791 | 723 |
| 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 | |
| 803 // Give BrowserAccessibility::Create access to our constructor. | 724 // Give BrowserAccessibility::Create access to our constructor. |
| 804 friend class BrowserAccessibility; | 725 friend class BrowserAccessibility; |
| 805 friend class BrowserAccessibilityRelation; | 726 friend class BrowserAccessibilityRelation; |
| 806 | 727 |
| 807 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityWin); | 728 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityWin); |
| 808 }; | 729 }; |
| 809 | 730 |
| 810 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_WIN_H_ | 731 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_WIN_H_ |
| OLD | NEW |