| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 CHROME_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_WIN_H_ | 5 #ifndef CHROME_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_WIN_H_ |
| 6 #define CHROME_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_WIN_H_ | 6 #define CHROME_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 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 // should be performed on a particular child ID, rather than this object. | 450 // should be performed on a particular child ID, rather than this object. |
| 451 // This method tries to figure out the target object from |var_id| and | 451 // This method tries to figure out the target object from |var_id| and |
| 452 // returns a pointer to the target object if it exists, otherwise NULL. | 452 // returns a pointer to the target object if it exists, otherwise NULL. |
| 453 // Does not return a new reference. | 453 // Does not return a new reference. |
| 454 BrowserAccessibilityWin* GetTargetFromChildID(const VARIANT& var_id); | 454 BrowserAccessibilityWin* GetTargetFromChildID(const VARIANT& var_id); |
| 455 | 455 |
| 456 // Initialize the role and state metadata from the role enum and state | 456 // Initialize the role and state metadata from the role enum and state |
| 457 // bitmasks defined in webkit/glue/webaccessibility.h. | 457 // bitmasks defined in webkit/glue/webaccessibility.h. |
| 458 void InitRoleAndState(); | 458 void InitRoleAndState(); |
| 459 | 459 |
| 460 // Return true if this attribute is in the attributes map. | |
| 461 bool HasAttribute(WebAccessibility::Attribute attribute); | |
| 462 | |
| 463 // Retrieve the string value of an attribute from the attribute map and | |
| 464 // returns true if found. | |
| 465 bool GetAttribute(WebAccessibility::Attribute attribute, string16* value); | |
| 466 | |
| 467 // Retrieve the string value of an attribute from the attribute map and | 460 // Retrieve the string value of an attribute from the attribute map and |
| 468 // if found and nonempty, allocate a new BSTR (with SysAllocString) | 461 // if found and nonempty, allocate a new BSTR (with SysAllocString) |
| 469 // and return S_OK. If not found or empty, return S_FALSE. | 462 // and return S_OK. If not found or empty, return S_FALSE. |
| 470 HRESULT GetAttributeAsBstr( | 463 HRESULT GetAttributeAsBstr( |
| 471 WebAccessibility::Attribute attribute, BSTR* value_bstr); | 464 WebAccessibility::Attribute attribute, BSTR* value_bstr); |
| 472 | 465 |
| 473 // Retrieve the value of an attribute from the attribute map and | |
| 474 // if found and nonempty, try to convert it to an integer. | |
| 475 // Returns true only if both the attribute was found and it was successfully | |
| 476 // converted to an integer. | |
| 477 bool GetAttributeAsInt( | |
| 478 WebAccessibility::Attribute attribute, int* value_int); | |
| 479 | |
| 480 // Escape a string like it would be escaped for a URL or HTML form. | 466 // Escape a string like it would be escaped for a URL or HTML form. |
| 481 string16 Escape(string16 str); | 467 string16 Escape(string16 str); |
| 482 | 468 |
| 483 // Get the text of this node for the purposes of IAccessibleText - it may | 469 // Get the text of this node for the purposes of IAccessibleText - it may |
| 484 // be the name, it may be the value, etc. depending on the role. | 470 // be the name, it may be the value, etc. depending on the role. |
| 485 const string16& TextForIAccessibleText(); | 471 const string16& TextForIAccessibleText(); |
| 486 | 472 |
| 487 // Search forwards (direction == 1) or backwards (direction == -1) from | 473 // Search forwards (direction == 1) or backwards (direction == -1) from |
| 488 // the given offset until the given IAccessible2 boundary (like word, | 474 // the given offset until the given IAccessible2 boundary (like word, |
| 489 // sentence) is found, and return its offset. | 475 // sentence) is found, and return its offset. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 507 int32 ia2_role_; | 493 int32 ia2_role_; |
| 508 int32 ia2_state_; | 494 int32 ia2_state_; |
| 509 | 495 |
| 510 // Give BrowserAccessibility::Create access to our constructor. | 496 // Give BrowserAccessibility::Create access to our constructor. |
| 511 friend class BrowserAccessibility; | 497 friend class BrowserAccessibility; |
| 512 | 498 |
| 513 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityWin); | 499 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityWin); |
| 514 }; | 500 }; |
| 515 | 501 |
| 516 #endif // CHROME_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_WIN_H_ | 502 #endif // CHROME_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_WIN_H_ |
| OLD | NEW |