Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(249)

Side by Side Diff: chrome/browser/accessibility/browser_accessibility_win.h

Issue 3550017: Implement additional IAccessibleText methods to return the nearest... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 LONG* x, LONG* y); 223 LONG* x, LONG* y);
224 224
225 STDMETHODIMP get_imageSize(LONG* height, LONG* width); 225 STDMETHODIMP get_imageSize(LONG* height, LONG* width);
226 226
227 // 227 //
228 // IAccessibleText methods. 228 // IAccessibleText methods.
229 // 229 //
230 230
231 STDMETHODIMP get_nCharacters(LONG* n_characters); 231 STDMETHODIMP get_nCharacters(LONG* n_characters);
232 232
233 STDMETHODIMP get_text(LONG start_offset, LONG end_offset, BSTR* text);
234
235 STDMETHODIMP get_caretOffset(LONG* offset); 233 STDMETHODIMP get_caretOffset(LONG* offset);
236 234
237 STDMETHODIMP get_nSelections(LONG* n_selections); 235 STDMETHODIMP get_nSelections(LONG* n_selections);
238 236
239 STDMETHODIMP get_selection(LONG selection_index, 237 STDMETHODIMP get_selection(LONG selection_index,
240 LONG* start_offset, 238 LONG* start_offset,
241 LONG* end_offset); 239 LONG* end_offset);
242 240
241 STDMETHODIMP get_text(LONG start_offset, LONG end_offset, BSTR* text);
242
243 STDMETHODIMP get_textAtOffset(LONG offset,
244 enum IA2TextBoundaryType boundary_type,
245 LONG* start_offset, LONG* end_offset,
246 BSTR* text);
247
248 STDMETHODIMP get_textBeforeOffset(LONG offset,
249 enum IA2TextBoundaryType boundary_type,
250 LONG* start_offset, LONG* end_offset,
251 BSTR* text);
252
253 STDMETHODIMP get_textAfterOffset(LONG offset,
254 enum IA2TextBoundaryType boundary_type,
255 LONG* start_offset, LONG* end_offset,
256 BSTR* text);
243 257
244 // IAccessibleText methods not implemented. 258 // IAccessibleText methods not implemented.
245 STDMETHODIMP addSelection(LONG start_offset, LONG end_offset) { 259 STDMETHODIMP addSelection(LONG start_offset, LONG end_offset) {
246 return E_NOTIMPL; 260 return E_NOTIMPL;
247 } 261 }
248 STDMETHODIMP get_attributes(LONG offset, LONG* start_offset, LONG* end_offset, 262 STDMETHODIMP get_attributes(LONG offset, LONG* start_offset, LONG* end_offset,
249 BSTR* text_attributes) { 263 BSTR* text_attributes) {
250 return E_NOTIMPL; 264 return E_NOTIMPL;
251 } 265 }
252 STDMETHODIMP get_characterExtents(LONG offset, 266 STDMETHODIMP get_characterExtents(LONG offset,
253 enum IA2CoordinateType coord_type, 267 enum IA2CoordinateType coord_type,
254 LONG* x, LONG* y, 268 LONG* x, LONG* y,
255 LONG* width, LONG* height) { 269 LONG* width, LONG* height) {
256 return E_NOTIMPL; 270 return E_NOTIMPL;
257 } 271 }
258 STDMETHODIMP get_offsetAtPoint(LONG x, LONG y, 272 STDMETHODIMP get_offsetAtPoint(LONG x, LONG y,
259 enum IA2CoordinateType coord_type, 273 enum IA2CoordinateType coord_type,
260 LONG* offset) { 274 LONG* offset) {
261 return E_NOTIMPL;
262 }
263 STDMETHODIMP get_textBeforeOffset(LONG offset,
264 enum IA2TextBoundaryType boundary_type,
265 LONG* start_offset, LONG* end_offset,
266 BSTR* text) {
267 return E_NOTIMPL;
268 }
269 STDMETHODIMP get_textAfterOffset(LONG offset,
270 enum IA2TextBoundaryType boundary_type,
271 LONG* start_offset, LONG* end_offset,
272 BSTR* text) {
273 return E_NOTIMPL;
274 }
275 STDMETHODIMP get_textAtOffset(LONG offset,
276 enum IA2TextBoundaryType boundary_type,
277 LONG* start_offset, LONG* end_offset,
278 BSTR* text) {
279 return E_NOTIMPL; 275 return E_NOTIMPL;
280 } 276 }
281 STDMETHODIMP removeSelection(LONG selection_index) { 277 STDMETHODIMP removeSelection(LONG selection_index) {
282 return E_NOTIMPL; 278 return E_NOTIMPL;
283 } 279 }
284 STDMETHODIMP setCaretOffset(LONG offset) { 280 STDMETHODIMP setCaretOffset(LONG offset) {
285 return E_NOTIMPL; 281 return E_NOTIMPL;
286 } 282 }
287 STDMETHODIMP setSelection(LONG selection_index, 283 STDMETHODIMP setSelection(LONG selection_index,
288 LONG start_offset, 284 LONG start_offset,
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 // Retrieve the value of an attribute from the attribute map and 473 // Retrieve the value of an attribute from the attribute map and
478 // if found and nonempty, try to convert it to an integer. 474 // if found and nonempty, try to convert it to an integer.
479 // Returns true only if both the attribute was found and it was successfully 475 // Returns true only if both the attribute was found and it was successfully
480 // converted to an integer. 476 // converted to an integer.
481 bool GetAttributeAsInt( 477 bool GetAttributeAsInt(
482 WebAccessibility::Attribute attribute, int* value_int); 478 WebAccessibility::Attribute attribute, int* value_int);
483 479
484 // Escape a string like it would be escaped for a URL or HTML form. 480 // Escape a string like it would be escaped for a URL or HTML form.
485 string16 Escape(string16 str); 481 string16 Escape(string16 str);
486 482
483 // 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.
485 const string16& TextForIAccessibleText();
486
487 // Search forwards (direction == 1) or backwards (direction == -1) from
488 // the given offset until the given IAccessible2 boundary (like word,
489 // sentence) is found, and return its offset.
490 LONG FindBoundary(const string16& text,
491 IA2TextBoundaryType boundary,
492 LONG start_offset,
493 LONG direction);
494
487 // COM objects are reference-counted. When we're done with this object 495 // COM objects are reference-counted. When we're done with this object
488 // and it's removed from our accessibility tree, a client may still be 496 // and it's removed from our accessibility tree, a client may still be
489 // holding onto a pointer to this object, so we mark it as inactive 497 // holding onto a pointer to this object, so we mark it as inactive
490 // so that calls to any of this object's methods immediately return 498 // so that calls to any of this object's methods immediately return
491 // failure. 499 // failure.
492 bool instance_active_; 500 bool instance_active_;
493 501
494 // IAccessible role and state. 502 // IAccessible role and state.
495 int32 ia_state_; 503 int32 ia_state_;
496 int32 ia_role_; 504 int32 ia_role_;
497 505
498 // IAccessible2 role and state. 506 // IAccessible2 role and state.
499 int32 ia2_role_; 507 int32 ia2_role_;
500 int32 ia2_state_; 508 int32 ia2_state_;
501 509
502 // Give BrowserAccessibility::Create access to our constructor. 510 // Give BrowserAccessibility::Create access to our constructor.
503 friend class BrowserAccessibility; 511 friend class BrowserAccessibility;
504 512
505 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityWin); 513 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityWin);
506 }; 514 };
507 515
508 #endif // CHROME_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_WIN_H_ 516 #endif // CHROME_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698