com.dynamixsoftware.intentapi
Interface IDocument

All Known Implementing Classes:
IDocument.Stub

public interface IDocument

Interface is used for document description.


Nested Class Summary
static class IDocument.Stub
          Local-side IPC implementation stub class.
 
Method Summary
 java.lang.String getDescription()
          Shows text for user(usually document name, document path, etc)
 android.graphics.Bitmap getPageThumbnail(int pageNum)
          Gets page thumbnail.
 int getTotalPages()
          Returns total pages
 void initDeviceContext(IPrinterContext printerContext, int thumbnailWidth, int thumbnailHeight)
          Initializes printers context.
 android.graphics.Bitmap renderPageFragment(int num, android.graphics.Rect fragment)
          Gets page fragment.
 

Method Detail

initDeviceContext

void initDeviceContext(IPrinterContext printerContext,
                       int thumbnailWidth,
                       int thumbnailHeight)
                       throws android.os.RemoteException
Initializes printers context. It is called every time settings are changed.

Parameters:
printerContext - printers context
thumbnailWidth - Maximum thumbnail width in pixels
thumbnailHeight - Maximum thumbnail height in pixels
Throws:
android.os.RemoteException

getDescription

java.lang.String getDescription()
                                throws android.os.RemoteException
Shows text for user(usually document name, document path, etc)

Returns:
description string
Throws:
android.os.RemoteException

getPageThumbnail

android.graphics.Bitmap getPageThumbnail(int pageNum)
                                         throws android.os.RemoteException
Gets page thumbnail. Application goes to infinite loop if OutOfMemoryError happens. It calls initDeviceContext() with less thumbnail width and heigth. Null can be returned to stop loop. This page thumbnail won't be shown.

Parameters:
pageNum - page number
Returns:
bitmap of the thumbnail or null
Throws:
android.os.RemoteException

getTotalPages

int getTotalPages()
                  throws android.os.RemoteException
Returns total pages

Returns:
number of pages
Throws:
android.os.RemoteException

renderPageFragment

android.graphics.Bitmap renderPageFragment(int num,
                                           android.graphics.Rect fragment)
                                           throws android.os.RemoteException
Gets page fragment.

Parameters:
num - page number
fragment - rect of the fragment
Returns:
bitmap of the fragment
Throws:
android.os.RemoteException