| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 7 |
| 8 #include <atlbase.h> | 8 #include <atlbase.h> |
| 9 #include <atlcom.h> | 9 #include <atlcom.h> |
| 10 #include <oleacc.h> | 10 #include <oleacc.h> |
| (...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 759 // If the bool attribute |attribute| is present, add its value as an | 759 // If the bool attribute |attribute| is present, add its value as an |
| 760 // IAccessible2 attribute with the name |ia2_attr|. | 760 // IAccessible2 attribute with the name |ia2_attr|. |
| 761 void BoolAttributeToIA2(ui::AXBoolAttribute attribute, | 761 void BoolAttributeToIA2(ui::AXBoolAttribute attribute, |
| 762 const char* ia2_attr); | 762 const char* ia2_attr); |
| 763 | 763 |
| 764 // If the int attribute |attribute| is present, add its value as an | 764 // If the int attribute |attribute| is present, add its value as an |
| 765 // IAccessible2 attribute with the name |ia2_attr|. | 765 // IAccessible2 attribute with the name |ia2_attr|. |
| 766 void IntAttributeToIA2(ui::AXIntAttribute attribute, | 766 void IntAttributeToIA2(ui::AXIntAttribute attribute, |
| 767 const char* ia2_attr); | 767 const char* ia2_attr); |
| 768 | 768 |
| 769 // Functions that help in retrieving hyperlinks. Return -1 in case of failure. |
| 770 // (Hyperlink is an IA2 misnomer. It refers to objects embedded within other |
| 771 // objects, such as a numbered list within a contenteditable div.) |
| 772 int32 GetHyperlinkIndexFromChild(const BrowserAccessibilityWin& child) const; |
| 773 int32 GetHypertextOffsetFromHyperlinkIndex(int32 hyperlink_index) const; |
| 774 |
| 775 // Functions that retrieve the end-points of the current selection. |
| 776 // First they check for a local selection found on the current control, e.g. |
| 777 // when querying the selection on a textarea. |
| 778 // If not found they retrieve the global selection found on the current frame. |
| 779 int32 GetSelectionStart() const; |
| 780 int32 GetSelectionEnd() const; |
| 781 |
| 769 // Append the accessible name from this node and its children. | 782 // Append the accessible name from this node and its children. |
| 770 base::string16 GetNameRecursive() const; | 783 base::string16 GetNameRecursive() const; |
| 771 | 784 |
| 772 // Get the value text, which might come from the floating-point | 785 // Get the value text, which might come from the floating-point |
| 773 // value for some roles. | 786 // value for some roles. |
| 774 base::string16 GetValueText(); | 787 base::string16 GetValueText(); |
| 775 | 788 |
| 776 // Get the text of this node for the purposes of IAccessibleText - it may | 789 // Get the text of this node for the purposes of IAccessibleText - it may |
| 777 // be the name, it may be the value, etc. depending on the role. | 790 // be the name, it may be the value, etc. depending on the role. |
| 778 base::string16 TextForIAccessibleText(); | 791 base::string16 TextForIAccessibleText(); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 829 int32 ia2_state; | 842 int32 ia2_state; |
| 830 | 843 |
| 831 // IAccessible2 attributes. | 844 // IAccessible2 attributes. |
| 832 std::vector<base::string16> ia2_attributes; | 845 std::vector<base::string16> ia2_attributes; |
| 833 | 846 |
| 834 // Hypertext. | 847 // Hypertext. |
| 835 base::string16 hypertext; | 848 base::string16 hypertext; |
| 836 | 849 |
| 837 // Maps the |hypertext_| embedded character offset to an index in | 850 // Maps the |hypertext_| embedded character offset to an index in |
| 838 // |hyperlinks_|. | 851 // |hyperlinks_|. |
| 852 // TODO(nektar): Replace map with vector of offsets. |
| 839 std::map<int32, int32> hyperlink_offset_to_index; | 853 std::map<int32, int32> hyperlink_offset_to_index; |
| 840 | 854 |
| 841 // The id of a BrowserAccessibilityWin for each hyperlink. | 855 // The id of a BrowserAccessibilityWin for each hyperlink. |
| 856 // TODO(nektar): Replace object IDs with child indices. |
| 842 std::vector<int32> hyperlinks; | 857 std::vector<int32> hyperlinks; |
| 843 }; | 858 }; |
| 844 | 859 |
| 845 scoped_ptr<WinAttributes> win_attributes_; | 860 scoped_ptr<WinAttributes> win_attributes_; |
| 846 | 861 |
| 847 // Only valid during the scope of a IA2_EVENT_TEXT_REMOVED or | 862 // Only valid during the scope of a IA2_EVENT_TEXT_REMOVED or |
| 848 // IA2_EVENT_TEXT_INSERTED event. | 863 // IA2_EVENT_TEXT_INSERTED event. |
| 849 scoped_ptr<WinAttributes> old_win_attributes_; | 864 scoped_ptr<WinAttributes> old_win_attributes_; |
| 850 | 865 |
| 851 // Relationships between this node and other nodes. | 866 // Relationships between this node and other nodes. |
| 852 std::vector<BrowserAccessibilityRelation*> relations_; | 867 std::vector<BrowserAccessibilityRelation*> relations_; |
| 853 | 868 |
| 854 // The previous scroll position, so we can tell if this object scrolled. | 869 // The previous scroll position, so we can tell if this object scrolled. |
| 855 int previous_scroll_x_; | 870 int previous_scroll_x_; |
| 856 int previous_scroll_y_; | 871 int previous_scroll_y_; |
| 857 | 872 |
| 858 // The next unique id to use. | 873 // The next unique id to use. |
| 859 static LONG next_unique_id_win_; | 874 static LONG next_unique_id_win_; |
| 860 | 875 |
| 861 // Give BrowserAccessibility::Create access to our constructor. | 876 // Give BrowserAccessibility::Create access to our constructor. |
| 862 friend class BrowserAccessibility; | 877 friend class BrowserAccessibility; |
| 863 friend class BrowserAccessibilityRelation; | 878 friend class BrowserAccessibilityRelation; |
| 864 | 879 |
| 865 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityWin); | 880 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityWin); |
| 866 }; | 881 }; |
| 867 | 882 |
| 868 } // namespace content | 883 } // namespace content |
| 869 | 884 |
| 870 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_WIN_H_ | 885 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_WIN_H_ |
| OLD | NEW |