1/*
2 * Copyright (C) 2014 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.support.v4.view.accessibility;
18
19import android.graphics.Rect;
20import android.view.accessibility.AccessibilityWindowInfo;
21
22/**
23 * Api21-specific AccessibilityWindowInfo API implementation.
24 */
25class AccessibilityWindowInfoCompatApi21 {
26
27    public static Object obtain() {
28        return AccessibilityWindowInfo.obtain();
29    }
30
31    public static Object obtain(Object info) {
32        return AccessibilityWindowInfo.obtain((AccessibilityWindowInfo) info);
33
34    }
35
36    public static int getType(Object info) {
37        return ((AccessibilityWindowInfo) info).getType();
38    }
39
40    public static int getLayer(Object info) {
41        return ((AccessibilityWindowInfo) info).getLayer();
42    }
43
44    public static Object getRoot(Object info) {
45        return ((AccessibilityWindowInfo) info).getRoot();
46    }
47
48    public static Object getParent(Object info) {
49        return ((AccessibilityWindowInfo) info).getParent();
50    }
51
52    public static int getId(Object info) {
53        return ((AccessibilityWindowInfo) info).getId();
54    }
55
56    public static void getBoundsInScreen(Object info, Rect outBounds) {
57        ((AccessibilityWindowInfo) info).getBoundsInScreen(outBounds);
58    }
59
60    public static boolean isActive(Object info) {
61        return ((AccessibilityWindowInfo) info).isActive();
62    }
63
64    public static boolean isFocused(Object info) {
65        return ((AccessibilityWindowInfo) info).isFocused();
66    }
67
68    public static boolean isAccessibilityFocused(Object info) {
69        return ((AccessibilityWindowInfo) info).isAccessibilityFocused();
70    }
71
72    public static int getChildCount(Object info) {
73        return ((AccessibilityWindowInfo) info).getChildCount();
74    }
75
76    public static Object getChild(Object info, int index) {
77        return ((AccessibilityWindowInfo) info).getChild(index);
78    }
79
80    public static void recycle(Object info) {
81        ((AccessibilityWindowInfo) info).recycle();
82    }
83}
84