/**@class android.widget.Magnifier @extends java.lang.Object Android magnifier widget. Can be used by any view which is attached to a window. */ var Magnifier = { /** A source bound that will extend as much as possible, while remaining within the surface the content is copied from. */ SOURCE_BOUND_MAX_IN_SURFACE : "0", /** A source bound that will extend as much as possible, while remaining within the visible region of the magnified view, as determined by {@link View#getGlobalVisibleRect(Rect)}. */ SOURCE_BOUND_MAX_VISIBLE : "1", /**Shows the magnifier on the screen. The method takes the coordinates of the center of the content source going to be magnified and copied to the magnifier. The coordinates are relative to the top left corner of the magnified view. The magnifier will be positioned such that its center will be at the default offset from the center of the source. The default offset can be specified using the method {@link android.widget.Magnifier.Builder#setDefaultSourceToMagnifierOffset(int, int)}. If the offset should be different across calls to this method, you should consider to use method {@link #show(float, float, float, float)} instead. @param {Number} sourceCenterX horizontal coordinate of the source center, relative to the view @param {Number} sourceCenterY vertical coordinate of the source center, relative to the view @see Builder#setDefaultSourceToMagnifierOffset(int, int) @see Builder#getDefaultHorizontalSourceToMagnifierOffset() @see Builder#getDefaultVerticalSourceToMagnifierOffset() @see #show(float, float, float, float) */ show : function( ) {}, /**Shows the magnifier on the screen at a position that is independent from its content position. The first two arguments represent the coordinates of the center of the content source going to be magnified and copied to the magnifier. The last two arguments represent the coordinates of the center of the magnifier itself. All four coordinates are relative to the top left corner of the magnified view. If you consider using this method such that the offset between the source center and the magnifier center coordinates remains constant, you should consider using method {@link #show(float, float)} instead. @param {Number} sourceCenterX horizontal coordinate of the source center relative to the view @param {Number} sourceCenterY vertical coordinate of the source center, relative to the view @param {Number} magnifierCenterX horizontal coordinate of the magnifier center, relative to the view @param {Number} magnifierCenterY vertical coordinate of the magnifier center, relative to the view */ show : function( ) {}, /**Dismisses the magnifier from the screen. Calling this on a dismissed magnifier is a no-op. */ dismiss : function( ) {}, /**Asks the magnifier to update its content. It uses the previous coordinates passed to {@link #show(float, float)} or {@link #show(float, float, float, float)}. The method only has effect if the magnifier is currently showing. */ update : function( ) {}, /** @return {Number} the width of the magnifier window, in pixels @see Magnifier.Builder#setSize(int, int) */ getWidth : function( ) {}, /** @return {Number} the height of the magnifier window, in pixels @see Magnifier.Builder#setSize(int, int) */ getHeight : function( ) {}, /** @return {Number} the initial width of the content magnified and copied to the magnifier, in pixels @see Magnifier.Builder#setSize(int, int) @see Magnifier.Builder#setInitialZoom(float) */ getSourceWidth : function( ) {}, /** @return {Number} the initial height of the content magnified and copied to the magnifier, in pixels @see Magnifier.Builder#setSize(int, int) @see Magnifier.Builder#setInitialZoom(float) */ getSourceHeight : function( ) {}, /**Sets the zoom to be applied to the chosen content before being copied to the magnifier popup. The change will become effective at the next #show or #update call. @param {Number} zoom the zoom to be set */ setZoom : function( ) {}, /**Returns the zoom to be applied to the magnified view region copied to the magnifier. If the zoom is x and the magnifier window size is (width, height), the original size of the content being magnified will be (width / x, height / x). @return {Number} the zoom applied to the content @see Magnifier.Builder#setInitialZoom(float) */ getZoom : function( ) {}, /** @return {Number} the elevation set for the magnifier window, in pixels @see Magnifier.Builder#setElevation(float) */ getElevation : function( ) {}, /** @return {Number} the corner radius of the magnifier window, in pixels @see Magnifier.Builder#setCornerRadius(float) */ getCornerRadius : function( ) {}, /**Returns the horizontal offset, in pixels, to be applied to the source center position to obtain the magnifier center position when {@link #show(float, float)} is called. The value is ignored when {@link #show(float, float, float, float)} is used instead. @return {Number} the default horizontal offset between the source center and the magnifier @see Magnifier.Builder#setDefaultSourceToMagnifierOffset(int, int) @see Magnifier#show(float, float) */ getDefaultHorizontalSourceToMagnifierOffset : function( ) {}, /**Returns the vertical offset, in pixels, to be applied to the source center position to obtain the magnifier center position when {@link #show(float, float)} is called. The value is ignored when {@link #show(float, float, float, float)} is used instead. @return {Number} the default vertical offset between the source center and the magnifier @see Magnifier.Builder#setDefaultSourceToMagnifierOffset(int, int) @see Magnifier#show(float, float) */ getDefaultVerticalSourceToMagnifierOffset : function( ) {}, /**Returns the overlay to be drawn on the top of the magnifier, or {@code null} if no overlay should be drawn. @return {Object {android.graphics.drawable.Drawable}} the overlay @see Magnifier.Builder#setOverlay(Drawable) */ getOverlay : function( ) {}, /**Returns whether the magnifier position will be adjusted such that the magnifier will be fully within the bounds of the main application window, by also avoiding any overlap with system insets (such as the one corresponding to the status bar) i.e. whether the area where the magnifier can be positioned will be clipped to the main application window and the system insets. @return {Boolean} whether the magnifier position will be adjusted @see Magnifier.Builder#setClippingEnabled(boolean) */ isClippingEnabled : function( ) {}, /**Returns the top left coordinates of the magnifier, relative to the main application window. They will be determined by the coordinates of the last {@link #show(float, float)} or {@link #show(float, float, float, float)} call, adjusted to take into account any potential clamping behavior. The method can be used immediately after a #show call to find out where the magnifier will be positioned. However, the position of the magnifier will not be updated visually in the same frame, due to the async nature of the content copying and of the magnifier rendering. The method will return {@code null} if #show has not yet been called, or if the last operation performed was a #dismiss. @return {Object {android.graphics.Point}} the top left coordinates of the magnifier */ getPosition : function( ) {}, /**Returns the top left coordinates of the magnifier source (i.e. the view region going to be magnified and copied to the magnifier), relative to the window or surface the content is copied from. The content will be copied: - if the magnified view is a {@link SurfaceView}, from the surface backing it - otherwise, from the surface backing the main application window, and the coordinates returned will be relative to the main application window The method will return {@code null} if #show has not yet been called, or if the last operation performed was a #dismiss. @return {Object {android.graphics.Point}} the top left coordinates of the magnifier source */ getSourcePosition : function( ) {}, /**Sets a callback which will be invoked at the end of the next {@link #show(float, float)} or {@link #update}() operation. @hide */ setOnOperationCompleteCallback : function( ) {}, /** @return {Object {android.graphics.Bitmap}} the drawing being currently displayed in the magnifier, as bitmap @hide */ getContent : function( ) {}, /**Returns a bitmap containing the content that was magnified and drew to the magnifier, at its original size, without the overlay applied. @return {Object {android.graphics.Bitmap}} the content that is magnified, as bitmap @hide */ getOriginalContent : function( ) {}, /** @return {Object {android.graphics.PointF}} the size of the magnifier window in dp @hide */ getMagnifierDefaultSize : function( ) {}, };