|
1 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
2 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
4 |
|
5 package org.mozilla.gecko; |
|
6 |
|
7 import android.app.Activity; |
|
8 |
|
9 public interface Driver { |
|
10 /** |
|
11 * Find the first Element using the given method. |
|
12 * |
|
13 * @param activity The activity the element belongs to |
|
14 * @param id The resource id of the element |
|
15 * @return The first matching element on the current context, or null if not found. |
|
16 */ |
|
17 Element findElement(Activity activity, int id); |
|
18 |
|
19 /** |
|
20 * Sets up scroll handling so that data is received from the extension. |
|
21 */ |
|
22 void setupScrollHandling(); |
|
23 |
|
24 int getPageHeight(); |
|
25 int getScrollHeight(); |
|
26 int getHeight(); |
|
27 int getGeckoTop(); |
|
28 int getGeckoLeft(); |
|
29 int getGeckoWidth(); |
|
30 int getGeckoHeight(); |
|
31 |
|
32 void startFrameRecording(); |
|
33 int stopFrameRecording(); |
|
34 |
|
35 void startCheckerboardRecording(); |
|
36 float stopCheckerboardRecording(); |
|
37 |
|
38 /** |
|
39 * Get a copy of the painted content region. |
|
40 * @return A 2-D array of pixels (indexed by y, then x). The pixels |
|
41 * are in ARGB-8888 format. |
|
42 */ |
|
43 PaintedSurface getPaintedSurface(); |
|
44 } |