Kaydet (Commit) b0537786 authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl Kaydeden (comit) Miklos Vajna

android: set graphic selection via TileProvider

Change-Id: I26c3eb03ad3bcc23bed380e873d353bc2941de9a
üst 93fbb736
......@@ -457,6 +457,28 @@ public class LOKitTileProvider implements TileProvider {
setTextSelection(Document.SET_TEXT_SELECTION_RESET, documentCoordinate);
}
/**
* @see org.libreoffice.TileProvider#setGraphicSelectionStart(android.graphics.PointF)
*/
@Override
public void setGraphicSelectionStart(PointF documentCoordinate) {
setGraphicSelection(Document.SET_GRAPHIC_SELECTION_START, documentCoordinate);
}
/**
* @see org.libreoffice.TileProvider#setGraphicSelectionEnd(android.graphics.PointF)
*/
@Override
public void setGraphicSelectionEnd(PointF documentCoordinate) {
setGraphicSelection(Document.SET_GRAPHIC_SELECTION_END, documentCoordinate);
}
private void setGraphicSelection(int type, PointF documentCoordinate) {
int x = (int) pixelToTwip(documentCoordinate.x, mDPI);
int y = (int) pixelToTwip(documentCoordinate.y, mDPI);
mDocument.setGraphicSelection(type, x, y);
}
@Override
protected void finalize() throws Throwable {
close();
......
......@@ -125,6 +125,14 @@ public class MockTileProvider implements TileProvider {
public void setTextSelectionReset(PointF documentCoordinate) {
}
@Override
public void setGraphicSelectionStart(PointF documentCoordinate) {
}
@Override
public void setGraphicSelectionEnd(PointF documentCoordinate) {
}
@Override
public void changePart(int partIndex) {
}
......
......@@ -134,6 +134,16 @@ public interface TileProvider {
* @param documentCoordinate
*/
void setTextSelectionReset(PointF documentCoordinate);
/**
* Send a request to change start the change of graphic selection.
*/
void setGraphicSelectionStart(PointF documentCoordinate);
/**
* Send a request to change end the change of graphic selection..
*/
void setGraphicSelectionEnd(PointF documentCoordinate);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment