| 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 753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 764 | 764 |
| 765 CONTENT_EXPORT HRESULT WINAPI InternalQueryInterface( | 765 CONTENT_EXPORT HRESULT WINAPI InternalQueryInterface( |
| 766 void* this_ptr, | 766 void* this_ptr, |
| 767 const _ATL_INTMAP_ENTRY* entries, | 767 const _ATL_INTMAP_ENTRY* entries, |
| 768 REFIID iid, | 768 REFIID iid, |
| 769 void** object); | 769 void** object); |
| 770 | 770 |
| 771 // Accessors. | 771 // Accessors. |
| 772 int32 ia_role() const { return ia_role_; } | 772 int32 ia_role() const { return ia_role_; } |
| 773 int32 ia_state() const { return ia_state_; } | 773 int32 ia_state() const { return ia_state_; } |
| 774 const string16& role_name() const { return role_name_; } |
| 774 int32 ia2_role() const { return ia2_role_; } | 775 int32 ia2_role() const { return ia2_role_; } |
| 775 int32 ia2_state() const { return ia2_state_; } | 776 int32 ia2_state() const { return ia2_state_; } |
| 776 const std::vector<string16>& ia2_attributes() const { | 777 const std::vector<string16>& ia2_attributes() const { |
| 777 return ia2_attributes_; | 778 return ia2_attributes_; |
| 778 } | 779 } |
| 779 | 780 |
| 780 private: | 781 private: |
| 781 // Add one to the reference count and return the same object. Always | 782 // Add one to the reference count and return the same object. Always |
| 782 // use this method when returning a BrowserAccessibilityWin object as | 783 // use this method when returning a BrowserAccessibilityWin object as |
| 783 // an output parameter to a COM interface, never use it otherwise. | 784 // an output parameter to a COM interface, never use it otherwise. |
| (...skipping 25 matching lines...) Expand all Loading... |
| 809 // If the bool attribute |attribute| is present, add its value as an | 810 // If the bool attribute |attribute| is present, add its value as an |
| 810 // IAccessible2 attribute with the name |ia2_attr|. | 811 // IAccessible2 attribute with the name |ia2_attr|. |
| 811 void BoolAttributeToIA2(AccessibilityNodeData::BoolAttribute attribute, | 812 void BoolAttributeToIA2(AccessibilityNodeData::BoolAttribute attribute, |
| 812 const char* ia2_attr); | 813 const char* ia2_attr); |
| 813 | 814 |
| 814 // If the int attribute |attribute| is present, add its value as an | 815 // If the int attribute |attribute| is present, add its value as an |
| 815 // IAccessible2 attribute with the name |ia2_attr|. | 816 // IAccessible2 attribute with the name |ia2_attr|. |
| 816 void IntAttributeToIA2(AccessibilityNodeData::IntAttribute attribute, | 817 void IntAttributeToIA2(AccessibilityNodeData::IntAttribute attribute, |
| 817 const char* ia2_attr); | 818 const char* ia2_attr); |
| 818 | 819 |
| 820 // Get the value text, which might come from the floating-point |
| 821 // value for some roles. |
| 822 string16 GetValueText(); |
| 823 |
| 819 // Get the text of this node for the purposes of IAccessibleText - it may | 824 // Get the text of this node for the purposes of IAccessibleText - it may |
| 820 // be the name, it may be the value, etc. depending on the role. | 825 // be the name, it may be the value, etc. depending on the role. |
| 821 const string16& TextForIAccessibleText(); | 826 string16 TextForIAccessibleText(); |
| 822 | 827 |
| 823 // If offset is a member of IA2TextSpecialOffsets this function updates the | 828 // If offset is a member of IA2TextSpecialOffsets this function updates the |
| 824 // value of offset and returns, otherwise offset remains unchanged. | 829 // value of offset and returns, otherwise offset remains unchanged. |
| 825 void HandleSpecialTextOffset(const string16& text, LONG* offset); | 830 void HandleSpecialTextOffset(const string16& text, LONG* offset); |
| 826 | 831 |
| 827 // Convert from a IA2TextBoundaryType to a ui::TextBoundaryType. | 832 // Convert from a IA2TextBoundaryType to a ui::TextBoundaryType. |
| 828 ui::TextBoundaryType IA2TextBoundaryToTextBoundary(IA2TextBoundaryType type); | 833 ui::TextBoundaryType IA2TextBoundaryToTextBoundary(IA2TextBoundaryType type); |
| 829 | 834 |
| 830 // Search forwards (direction == 1) or backwards (direction == -1) | 835 // Search forwards (direction == 1) or backwards (direction == -1) |
| 831 // from the given offset until the given boundary is found, and | 836 // from the given offset until the given boundary is found, and |
| 832 // return the offset of that boundary. | 837 // return the offset of that boundary. |
| 833 LONG FindBoundary(const string16& text, | 838 LONG FindBoundary(const string16& text, |
| 834 IA2TextBoundaryType ia2_boundary, | 839 IA2TextBoundaryType ia2_boundary, |
| 835 LONG start_offset, | 840 LONG start_offset, |
| 836 ui::TextBoundaryDirection direction); | 841 ui::TextBoundaryDirection direction); |
| 837 | 842 |
| 838 // Return a pointer to the object corresponding to the given renderer_id, | 843 // Return a pointer to the object corresponding to the given renderer_id, |
| 839 // does not make a new reference. | 844 // does not make a new reference. |
| 840 BrowserAccessibilityWin* GetFromRendererID(int32 renderer_id); | 845 BrowserAccessibilityWin* GetFromRendererID(int32 renderer_id); |
| 841 | 846 |
| 842 // Windows-specific unique ID (unique within the browser process), | 847 // Windows-specific unique ID (unique within the browser process), |
| 843 // used for get_accChild, NotifyWinEvent, and as the unique ID for | 848 // used for get_accChild, NotifyWinEvent, and as the unique ID for |
| 844 // IAccessible2 and ISimpleDOM. | 849 // IAccessible2 and ISimpleDOM. |
| 845 LONG unique_id_win_; | 850 LONG unique_id_win_; |
| 846 | 851 |
| 847 // IAccessible role and state. | 852 // IAccessible role and state. |
| 848 int32 ia_role_; | 853 int32 ia_role_; |
| 849 int32 ia_state_; | 854 int32 ia_state_; |
| 855 string16 role_name_; |
| 850 | 856 |
| 851 // IAccessible2 role and state. | 857 // IAccessible2 role and state. |
| 852 int32 ia2_role_; | 858 int32 ia2_role_; |
| 853 int32 ia2_state_; | 859 int32 ia2_state_; |
| 854 | 860 |
| 855 // IAccessible2 attributes. | 861 // IAccessible2 attributes. |
| 856 std::vector<string16> ia2_attributes_; | 862 std::vector<string16> ia2_attributes_; |
| 857 | 863 |
| 858 // True in Initialize when the object is first created, and false | 864 // True in Initialize when the object is first created, and false |
| 859 // subsequent times. | 865 // subsequent times. |
| (...skipping 30 matching lines...) Expand all Loading... |
| 890 // Give BrowserAccessibility::Create access to our constructor. | 896 // Give BrowserAccessibility::Create access to our constructor. |
| 891 friend class BrowserAccessibility; | 897 friend class BrowserAccessibility; |
| 892 friend class BrowserAccessibilityRelation; | 898 friend class BrowserAccessibilityRelation; |
| 893 | 899 |
| 894 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityWin); | 900 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityWin); |
| 895 }; | 901 }; |
| 896 | 902 |
| 897 } // namespace content | 903 } // namespace content |
| 898 | 904 |
| 899 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_WIN_H_ | 905 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_WIN_H_ |
| OLD | NEW |