net.rim.device.api.im
Interface IInputLocationRequests

All Known Subinterfaces:
ITextInputConnector

public interface IInputLocationRequests

Defines the methods that the input method uses to receive information from the text component.

Since:
BlackBerry API 6.0.0

Method Summary
 TextHitInfo getLocationOffset(int x, int y)
          Retrieves the offset within the composed text for the specified absolute x and y coordinates on the screen.
 void getTextLocation(TextHitInfo offset, XYRect aResult)
          Returns the location (absolute x and y coordinates on the screen) of a specified offset within the current composed text, or of the selection in committed text.
 



Method Detail

getLocationOffset

TextHitInfo getLocationOffset(int x,
                              int y)
Retrieves the offset within the composed text for the specified absolute x and y coordinates on the screen.

This information is used, for example to handle touch events. The offset is relative to the composed text, so offset 0 indicates the beginning of the composed text.

Parameters:
x - Absolute x coordinate on screen.
y - Absolute y coordinate on screen.
Returns:
Text hit info describing the offset in the composed text.
Since:
BlackBerry API 6.0.0

getTextLocation

void getTextLocation(TextHitInfo offset,
                     XYRect aResult)
Returns the location (absolute x and y coordinates on the screen) of a specified offset within the current composed text, or of the selection in committed text. This method is used to control lookup popup position on an application screen.

The offset 0 is relative to the first character in the text if the component contains composed text. IllegalArgumentException is thrown in case offset is outside composed text boundaries

If the component doesn't have composed text, the beginning of the the highlight in the last line containing selected text is returned. For example, for horizontal left-to-right text, the character position to the left of the left-most character on the last line that contains selected text is returned.

The value is represented as a zero-thickness caret. In other words, it has no width if the text is drawn horizontally, and no height if the text is drawn vertically. The rectangle uses absolute screen coordinates.

Note that this implementation of the getTextLocation method, passes in the XYRect instance to populate it with data. As such, the method does not return anything.

Parameters:
offset - The location of the text or null if no composed text exists. IllegalArgumentException is thrown in case offset is outside composed text boundaries
aResult - A rectangle (x,y,width,height) representing the location.
Since:
BlackBerry API 6.0.0





Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.