9package org.libreoffice;
12import android.app.ActivityManager;
13import android.content.Context;
14import android.graphics.PointF;
15import android.graphics.RectF;
16import android.os.Handler;
17import android.util.DisplayMetrics;
18import android.view.KeyEvent;
27 public static float getDpi(Context context) {
29 if (tileProvider !=
null && tileProvider.isSpreadsheet())
31 DisplayMetrics metrics = context.getResources().getDisplayMetrics();
32 return metrics.density * 160;
59 ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
60 return activityManager.getMemoryClass() * 1024 * 1024;
83 public static void sendTouchEvent(String touchType, PointF documentTouchCoordinate) {
Events and data that is queued and processed by LOKitThread.
static final int LOAD_NEW
static final int CHANGE_PART
static final int TILE_INVALIDATION
static final int SAVE_COPY_AS
static final int NAVIGATION_CLICK
static final int SWIPE_RIGHT
static final int SIZE_CHANGED
static final int SWIPE_LEFT
static final int KEY_EVENT
static final int CHANGE_HANDLE_POSITION
static final int THUMBNAIL
static final int TILE_REEVALUATION_REQUEST
Common static LOKit functions, functions to send events.
static void sendSwipeLeftEvent()
static void sendSaveAsEvent(String filePath, String fileFormat)
static void sendChangeHandlePositionEvent(SelectionHandle.HandleType handleType, PointF documentCoordinate)
Send change handle position event to LOKitThread.
static boolean isEditingEnabled()
static void sendNewDocumentLoadEvent(String newDocumentPath, String newDocumentType)
static void sendTileInvalidationRequest(RectF rect)
Send tile invalidation to LOKitThread.
static void sendEvent(LOEvent event)
Make sure LOKitThread is running and send event to it.
static void sendChangePartEvent(int part)
static void sendKeyEvent(KeyEvent event)
Send key event to LOKitThread.
static void sendTileReevaluationRequest(ComposedTileLayer composedTileLayer)
Send tile reevaluation to LOKitThread.
static void hideProgressSpinner(final LibreOfficeMainActivity context)
static void sendTouchEvent(String touchType, PointF documentTouchCoordinate)
Send touch event to LOKitThread.
static float getDpi(Context context)
static void sendLoadEvent(String inputFilePath)
static Handler getMainHandler()
static void sendSizeChangedEvent(int width, int height)
static void sendThumbnailEvent(ThumbnailCreator.ThumbnailCreationTask task)
static void sendSwipeRightEvent()
static void moveViewportTo(final LibreOfficeMainActivity context, final PointF position, final Float zoom)
Move the viewport to the desired point (top-left), and change the zoom level.
static int getMemoryClass(Context context)
static void sendNavigationClickEvent()
static void sendSaveCopyAsEvent(String filePath, String fileFormat)
static void sendCloseEvent()
static void showProgressSpinner(final LibreOfficeMainActivity context)
static Handler getMainHandler()
Main activity of the LibreOffice App.
GeckoLayerClient getLayerClient()
static boolean isReadOnlyMode()
void hideProgressSpinner()
static LOKitThread loKitThread
void showProgressSpinner()
Create thumbnails for the parts of the document.
Selection handle is a common class for "start", "middle" and "end" types of selection handles.
void moveTo(PointF point, Float zoom)
Move the viewport to the desired point, and change the zoom level.
boolean post(Runnable action)
Implementation of PanZoomTarget.
def run(arg=None, arg2=-1)