Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / content / browser / accessibility / browser_accessibility_android.h
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   const char* GetClassName() const;
44   base::string16 GetText() const;
45
46   int GetItemIndex() const;
47   int GetItemCount() const;
48
49   int GetScrollX() const;
50   int GetScrollY() const;
51   int GetMaxScrollX() const;
52   int GetMaxScrollY() const;
53
54   int GetTextChangeFromIndex() const;
55   int GetTextChangeAddedCount() const;
56   int GetTextChangeRemovedCount() const;
57   base::string16 GetTextChangeBeforeText() const;
58
59   int GetSelectionStart() const;
60   int GetSelectionEnd() const;
61   int GetEditableTextLength() const;
62
63   int AndroidInputType() const;
64   int AndroidLiveRegionType() const;
65   int AndroidRangeType() const;
66
67   int RowCount() const;
68   int ColumnCount() const;
69
70   int RowIndex() const;
71   int RowSpan() const;
72   int ColumnIndex() const;
73   int ColumnSpan() const;
74
75   float RangeMin() const;
76   float RangeMax() const;
77   float RangeCurrentValue() const;
78
79  private:
80   // This gives BrowserAccessibility::Create access to the class constructor.
81   friend class BrowserAccessibility;
82
83   BrowserAccessibilityAndroid();
84
85   bool HasFocusableChild() const;
86   bool HasOnlyStaticTextChildren() const;
87   bool IsIframe() const;
88
89   void NotifyLiveRegionUpdate(base::string16& aria_live);
90
91   int CountChildrenWithRole(ui::AXRole role) const;
92
93   base::string16 cached_text_;
94   bool first_time_;
95   base::string16 old_value_;
96   base::string16 new_value_;
97
98   DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityAndroid);
99 };
100
101 }  // namespace content
102
103 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_ANDROID_H_