mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-05 08:35:26 +00:00
77 lines
2.4 KiB
Java
77 lines
2.4 KiB
Java
#filter substitution
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
package @ANDROID_PACKAGE_NAME@;
|
|
import java.util.List;
|
|
import java.util.ArrayList;
|
|
|
|
import android.database.Cursor;
|
|
|
|
public interface Actions {
|
|
|
|
/** Special keys supported by sendSpecialKey() */
|
|
public enum SpecialKey {
|
|
DOWN, UP, LEFT, RIGHT, ENTER, MENU, BACK
|
|
}
|
|
|
|
public interface EventExpecter {
|
|
/** Blocks until the event has been received. Subsequent calls will return immediately. */
|
|
public void blockForEvent();
|
|
|
|
/** Polls to see if the event has been received. Once this returns true, subsequent calls will also return true. */
|
|
public boolean eventReceived();
|
|
}
|
|
|
|
public interface RepeatedEventExpecter extends EventExpecter {
|
|
/** Blocks until at least one event has been received, and no events have been received in the last <code>millis</code> milliseconds. */
|
|
public void blockUntilClear(long millis);
|
|
}
|
|
|
|
/**
|
|
* Sends an event to Gecko.
|
|
*
|
|
* @param geckoEvent The geckoEvent JSONObject's type
|
|
*/
|
|
void sendGeckoEvent(String geckoEvent, String data);
|
|
|
|
/**
|
|
* Listens for a gecko event to be sent from the Gecko instance.
|
|
* The returned object can be used to test if the event has been
|
|
* received. Note that only one event is listened for.
|
|
*
|
|
* @param geckoEvent The geckoEvent JSONObject's type
|
|
*/
|
|
EventExpecter expectGeckoEvent(String geckoEvent);
|
|
|
|
/**
|
|
* Listens for a paint event. Note that calling expectPaint() will
|
|
* invalidate the event expecters returned from any previous calls
|
|
* to expectPaint(); calling any methods on those invalidated objects
|
|
* will result in undefined behaviour.
|
|
*/
|
|
RepeatedEventExpecter expectPaint();
|
|
|
|
/**
|
|
* Send a string to the application
|
|
*
|
|
* @param keysToSend The string to send
|
|
*/
|
|
void sendKeys(String keysToSend);
|
|
|
|
/**
|
|
* Send a special keycode to the element
|
|
*
|
|
* @param key The special key to send
|
|
*/
|
|
void sendSpecialKey(SpecialKey key);
|
|
|
|
void drag(int startingX, int endingX, int startingY, int endingY);
|
|
|
|
/**
|
|
* Run a sql query on the specified database
|
|
*/
|
|
public Cursor querySql(String dbPath, String sql);
|
|
}
|