Home | History | Annotate | Download | only in accessibility
      1 // Copyright 2013 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #ifndef CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_ANDROID_H_
      6 #define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_ANDROID_H_
      7 
      8 #include "base/android/scoped_java_ref.h"
      9 #include "content/browser/accessibility/browser_accessibility.h"
     10 
     11 namespace content {
     12 
     13 class BrowserAccessibilityAndroid : public BrowserAccessibility {
     14  public:
     15   // Overrides from BrowserAccessibility.
     16   virtual void OnDataChanged() OVERRIDE;
     17   virtual bool IsNative() const OVERRIDE;
     18 
     19   virtual bool PlatformIsLeaf() const OVERRIDE;
     20 
     21   bool IsCheckable() const;
     22   bool IsChecked() const;
     23   bool IsClickable() const;
     24   bool IsCollection() const;
     25   bool IsCollectionItem() const;
     26   bool IsContentInvalid() const;
     27   bool IsDismissable() const;
     28   bool IsEnabled() const;
     29   bool IsFocusable() const;
     30   bool IsFocused() const;
     31   bool IsHeading() const;
     32   bool IsHierarchical() const;
     33   bool IsLink() const;
     34   bool IsMultiLine() const;
     35   bool IsPassword() const;
     36   bool IsRangeType() const;
     37   bool IsScrollable() const;
     38   bool IsSelected() const;
     39   bool IsVisibleToUser() const;
     40 
     41   bool CanOpenPopup() const;
     42 
     43   bool HasFocusableChild() const;
     44 
     45   const char* GetClassName() const;
     46   base::string16 GetText() const;
     47 
     48   int GetItemIndex() const;
     49   int GetItemCount() const;
     50 
     51   int GetScrollX() const;
     52   int GetScrollY() const;
     53   int GetMaxScrollX() const;
     54   int GetMaxScrollY() const;
     55 
     56   int GetTextChangeFromIndex() const;
     57   int GetTextChangeAddedCount() const;
     58   int GetTextChangeRemovedCount() const;
     59   base::string16 GetTextChangeBeforeText() const;
     60 
     61   int GetSelectionStart() const;
     62   int GetSelectionEnd() const;
     63   int GetEditableTextLength() const;
     64 
     65   int AndroidInputType() const;
     66   int AndroidLiveRegionType() const;
     67   int AndroidRangeType() const;
     68 
     69   int RowCount() const;
     70   int ColumnCount() const;
     71 
     72   int RowIndex() const;
     73   int RowSpan() const;
     74   int ColumnIndex() const;
     75   int ColumnSpan() const;
     76 
     77   float RangeMin() const;
     78   float RangeMax() const;
     79   float RangeCurrentValue() const;
     80 
     81  private:
     82   // This gives BrowserAccessibility::Create access to the class constructor.
     83   friend class BrowserAccessibility;
     84 
     85   BrowserAccessibilityAndroid();
     86 
     87   bool HasOnlyStaticTextChildren() const;
     88   bool IsIframe() const;
     89 
     90   void NotifyLiveRegionUpdate(base::string16& aria_live);
     91 
     92   int CountChildrenWithRole(ui::AXRole role) const;
     93 
     94   base::string16 cached_text_;
     95   bool first_time_;
     96   base::string16 old_value_;
     97   base::string16 new_value_;
     98 
     99   DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityAndroid);
    100 };
    101 
    102 }  // namespace content
    103 
    104 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_ANDROID_H_
    105