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

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

Issue 8416034: Support IAccessibleHypertext. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Add unit tests. Created 9 years, 1 month 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) 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 22 matching lines...) Expand all
33 // communication of accessibility information, providing accessibility 33 // communication of accessibility information, providing accessibility
34 // to be used by screen readers and other assistive technology (AT). 34 // to be used by screen readers and other assistive technology (AT).
35 // 35 //
36 //////////////////////////////////////////////////////////////////////////////// 36 ////////////////////////////////////////////////////////////////////////////////
37 class __declspec(uuid("562072fe-3390-43b1-9e2c-dd4118f5ac79")) 37 class __declspec(uuid("562072fe-3390-43b1-9e2c-dd4118f5ac79"))
38 BrowserAccessibilityWin 38 BrowserAccessibilityWin
39 : public BrowserAccessibility, 39 : public BrowserAccessibility,
40 public CComObjectRootEx<CComMultiThreadModel>, 40 public CComObjectRootEx<CComMultiThreadModel>,
41 public IDispatchImpl<IAccessible2, &IID_IAccessible2, 41 public IDispatchImpl<IAccessible2, &IID_IAccessible2,
42 &LIBID_IAccessible2Lib>, 42 &LIBID_IAccessible2Lib>,
43 public IAccessibleHyperlink,
dmazzoni 2011/11/01 05:08:34 Add IAccessibleAction here?
David Tseng 2011/11/01 19:38:04 IAccessibleHyperlink : IAccessibleAction
44 public IAccessibleHypertext,
43 public IAccessibleImage, 45 public IAccessibleImage,
44 public IAccessibleTable, 46 public IAccessibleTable,
45 public IAccessibleTable2, 47 public IAccessibleTable2,
46 public IAccessibleTableCell, 48 public IAccessibleTableCell,
47 public IAccessibleText,
48 public IAccessibleValue, 49 public IAccessibleValue,
49 public IServiceProvider, 50 public IServiceProvider,
50 public ISimpleDOMDocument, 51 public ISimpleDOMDocument,
51 public ISimpleDOMNode, 52 public ISimpleDOMNode,
52 public ISimpleDOMText { 53 public ISimpleDOMText {
53 public: 54 public:
54 BEGIN_COM_MAP(BrowserAccessibilityWin) 55 BEGIN_COM_MAP(BrowserAccessibilityWin)
55 COM_INTERFACE_ENTRY2(IDispatch, IAccessible2) 56 COM_INTERFACE_ENTRY2(IDispatch, IAccessible2)
56 COM_INTERFACE_ENTRY2(IAccessible, IAccessible2) 57 COM_INTERFACE_ENTRY2(IAccessible, IAccessible2)
58 COM_INTERFACE_ENTRY2(IAccessibleText, IAccessibleHypertext)
57 COM_INTERFACE_ENTRY(IAccessible2) 59 COM_INTERFACE_ENTRY(IAccessible2)
60 COM_INTERFACE_ENTRY(IAccessibleHyperlink)
61 COM_INTERFACE_ENTRY(IAccessibleHypertext)
58 COM_INTERFACE_ENTRY(IAccessibleImage) 62 COM_INTERFACE_ENTRY(IAccessibleImage)
59 COM_INTERFACE_ENTRY(IAccessibleTable) 63 COM_INTERFACE_ENTRY(IAccessibleTable)
60 COM_INTERFACE_ENTRY(IAccessibleTable2) 64 COM_INTERFACE_ENTRY(IAccessibleTable2)
61 COM_INTERFACE_ENTRY(IAccessibleTableCell) 65 COM_INTERFACE_ENTRY(IAccessibleTableCell)
62 COM_INTERFACE_ENTRY(IAccessibleText)
63 COM_INTERFACE_ENTRY(IAccessibleValue) 66 COM_INTERFACE_ENTRY(IAccessibleValue)
64 COM_INTERFACE_ENTRY(IServiceProvider) 67 COM_INTERFACE_ENTRY(IServiceProvider)
65 COM_INTERFACE_ENTRY(ISimpleDOMDocument) 68 COM_INTERFACE_ENTRY(ISimpleDOMDocument)
66 COM_INTERFACE_ENTRY(ISimpleDOMNode) 69 COM_INTERFACE_ENTRY(ISimpleDOMNode)
67 COM_INTERFACE_ENTRY(ISimpleDOMText) 70 COM_INTERFACE_ENTRY(ISimpleDOMText)
68 END_COM_MAP() 71 END_COM_MAP()
69 72
73 // Represents a non-static text node in IAccessibleHypertext.
dmazzoni 2011/11/01 05:08:34 Add a tiny bit more detail so someone new to this
David Tseng 2011/11/01 19:38:04 Done.
74 static const char16 kEmbeddedCharacter[];
75
70 CONTENT_EXPORT BrowserAccessibilityWin(); 76 CONTENT_EXPORT BrowserAccessibilityWin();
71 77
72 CONTENT_EXPORT virtual ~BrowserAccessibilityWin(); 78 CONTENT_EXPORT virtual ~BrowserAccessibilityWin();
73 79
74 // 80 //
75 // BrowserAccessibility methods. 81 // BrowserAccessibility methods.
76 // 82 //
77 CONTENT_EXPORT virtual void Initialize(); 83 CONTENT_EXPORT virtual void Initialize();
78 CONTENT_EXPORT virtual void SendNodeUpdateEvents(); 84 CONTENT_EXPORT virtual void SendNodeUpdateEvents();
79 CONTENT_EXPORT virtual void NativeAddReference(); 85 CONTENT_EXPORT virtual void NativeAddReference();
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 return E_NOTIMPL; 477 return E_NOTIMPL;
472 } 478 }
473 CONTENT_EXPORT STDMETHODIMP scrollSubstringToPoint(LONG start_index, 479 CONTENT_EXPORT STDMETHODIMP scrollSubstringToPoint(LONG start_index,
474 LONG end_index, 480 LONG end_index,
475 enum IA2CoordinateType coordinate_type, 481 enum IA2CoordinateType coordinate_type,
476 LONG x, LONG y) { 482 LONG x, LONG y) {
477 return E_NOTIMPL; 483 return E_NOTIMPL;
478 } 484 }
479 485
480 // 486 //
487 // IAccessibleHypertext methods.
488 //
489
490 CONTENT_EXPORT STDMETHODIMP get_nHyperlinks(long* hyperlinkCount);
dmazzoni 2011/11/01 05:08:34 Nit: Convert all of the method parameters to hacke
David Tseng 2011/11/01 19:38:04 Done.
491
492 CONTENT_EXPORT STDMETHODIMP get_hyperlink(
493 long index,
494 IAccessibleHyperlink** hyperlink);
495
496 CONTENT_EXPORT STDMETHODIMP get_hyperlinkIndex(long char_index,
497 long* hyperlink_index);
498
499 // IAccessibleHyperlink not implemented.
500 CONTENT_EXPORT STDMETHODIMP get_anchor(long index, VARIANT* anchor) {
501 return E_NOTIMPL;
502 }
503 CONTENT_EXPORT STDMETHODIMP get_anchorTarget(
504 long index,
505 VARIANT* anchorTarget) {
506 return E_NOTIMPL;
507 }
508 CONTENT_EXPORT STDMETHODIMP get_startIndex( long* index) {
509 return E_NOTIMPL;
510 }
511 CONTENT_EXPORT STDMETHODIMP get_endIndex( long* index) {
512 return E_NOTIMPL;
513 }
514 CONTENT_EXPORT STDMETHODIMP get_valid(boolean* valid) {
515 return E_NOTIMPL;
516 }
517
518 // IAccessibleAction not implemented.
519 CONTENT_EXPORT STDMETHODIMP nActions(long* nActions) {
520 return E_NOTIMPL;
521 }
522 CONTENT_EXPORT STDMETHODIMP doAction(long actionIndex) {
523 return E_NOTIMPL;
524 }
525 CONTENT_EXPORT STDMETHODIMP get_description(
526 long actionIndex,
527 BSTR* description) {
528 return E_NOTIMPL;
529 }
530 CONTENT_EXPORT STDMETHODIMP get_keyBinding(
531 long actionIndex,
532 long nMaxBindings,
533 BSTR** keyBindings,
534 long* nBindings) {
535 return E_NOTIMPL;
536 }
537 CONTENT_EXPORT STDMETHODIMP get_name(long actionIndex, BSTR* name) {
538 return E_NOTIMPL;
539 }
540 CONTENT_EXPORT STDMETHODIMP get_localizedName(
541 long actionIndex,
542 BSTR* localizedName) {
543 return E_NOTIMPL;
544 }
545
546 //
481 // IAccessibleValue methods. 547 // IAccessibleValue methods.
482 // 548 //
483 549
484 CONTENT_EXPORT STDMETHODIMP get_currentValue(VARIANT* value); 550 CONTENT_EXPORT STDMETHODIMP get_currentValue(VARIANT* value);
485 551
486 CONTENT_EXPORT STDMETHODIMP get_minimumValue(VARIANT* value); 552 CONTENT_EXPORT STDMETHODIMP get_minimumValue(VARIANT* value);
487 553
488 CONTENT_EXPORT STDMETHODIMP get_maximumValue(VARIANT* value); 554 CONTENT_EXPORT STDMETHODIMP get_maximumValue(VARIANT* value);
489 555
490 CONTENT_EXPORT STDMETHODIMP setCurrentValue(VARIANT new_value); 556 CONTENT_EXPORT STDMETHODIMP setCurrentValue(VARIANT new_value);
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
708 string16 previous_text_; 774 string16 previous_text_;
709 775
710 // The old text to return in IAccessibleText::get_oldText - this is like 776 // The old text to return in IAccessibleText::get_oldText - this is like
711 // previous_text_ except that it's NOT updated when the object 777 // previous_text_ except that it's NOT updated when the object
712 // is initialized again but the text doesn't change. 778 // is initialized again but the text doesn't change.
713 string16 old_text_; 779 string16 old_text_;
714 780
715 // Relationships between this node and other nodes. 781 // Relationships between this node and other nodes.
716 std::vector<BrowserAccessibilityRelation*> relations_; 782 std::vector<BrowserAccessibilityRelation*> relations_;
717 783
784 // The text of this node including embedded hyperlink characters.
785 string16 hypertext_;
786
787 // Maps the |hypertext_| embedded character offset to a child of |children_|.
788 std::map<int32, int32> hyperlink_offset_to_index_;
789
718 // Give BrowserAccessibility::Create access to our constructor. 790 // Give BrowserAccessibility::Create access to our constructor.
719 friend class BrowserAccessibility; 791 friend class BrowserAccessibility;
720 friend class BrowserAccessibilityRelation; 792 friend class BrowserAccessibilityRelation;
721 793
722 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityWin); 794 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityWin);
723 }; 795 };
724 796
725 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_WIN_H_ 797 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698