package org.libreoffice;


import android.graphics.Bitmap;
import android.graphics.RectF;
import android.view.KeyEvent;

import org.mozilla.gecko.gfx.CairoImage;
import org.mozilla.gecko.gfx.IntSize;

public interface TileProvider {
    int getPageWidth();

    int getPageHeight();

    boolean isReady();

    CairoImage createTile(float x, float y, IntSize tileSize, float zoom);

    /**
     * Rerender and overwrite tile's image buffer directly
     */
    void rerenderTile(CairoImage image, float x, float y, IntSize tileSize, float zoom);

    void changePart(int partIndex);

    int getCurrentPartNumber();

    Bitmap thumbnail(int size);

    void close();

    boolean isTextDocument();

    void registerInvalidationCallback(TileProvider.TileInvalidationCallback tileInvalidationCallback);

    void keyPress(KeyEvent keyEvent);

    /**
     * Callback to retrieve invalidation calls
     */
    public interface TileInvalidationCallback {
        /**
         * Invoked when a region is invalidated.
         * @param rect area in pixels which was invalidated and needs to be redrawn
         */
        void invalidate(RectF rect);
    }
}

@@ -234,28 +234,143 @@
     
-int getPageWidth();%0A
+/**%0A     * Returns the page width in pixels.%0A     */%0A    int getPageWidth();%0A%0A    /**%0A     * Returns the page height in pixels.%0A     */
 %0A   
@@ -665,156 +665,697 @@
     
-void changePart(int partIndex);%0A%0A    int getCurrentPartNumber();%0A%0A    Bitmap thumbnail(int size);%0A%0A    void close();%0A%0A    boolean isTextDocument();%0A
+/**%0A     * Change the document part to the one specified by the partIndex input parameter.%0A     * @param partIndex - part index to change to%0A     */%0A    void changePart(int partIndex);%0A%0A    /**%0A     * Get the current document part number.%0A     * @return%0A     */%0A    int getCurrentPartNumber();%0A%0A    Bitmap thumbnail(int size);%0A%0A    /**%0A     * Closes the document.%0A     */%0A    void close();%0A%0A    /**%0A     * Returns true if the current open document is a text document.%0A     */%0A    boolean isTextDocument();%0A%0A    /**%0A     * Register a callback that is invoked when a tile invalidation is%0A     * required.%0A     *%0A     * @param tileInvalidationCallback - the tile invalidation callback%0A     */
 %0A   
@@ -1451,24 +1451,106 @@
 Callback);%0A%0A
+    /**%0A     * Trigger a key press.%0A     * @param keyEvent - contains the%0A     */%0A
     void key

add some comments to TileProvider interface