Interface IWindow4
interface IWindow4
Extends IWindow3
Revision 4 of IWindow. Please see [IWindow], [IWindow2] and [IWindow3].
One can retrieve IWindow4 interface by calling window.TryQueryInterface<IWindow4>()
assuming ‘window’ object implemented IWindow4 interface.
Methods
getPosX()
i32 getPosX()
Return X position of window. This is w.r.t the top left corner of the current display
where the window is positioned. Origin in case of top level window and w.r.t parent window in case
of child windows.
Returns
i32
X position
Throws
DeviceError— if IWindow is not in valid state
getPosY()
i32 getPosY()
Return Y position of window. This is in w.r.t Display
origin in case of top level window and w.r.t parent window in case
of child windows.
Returns
i32
Y position
Throws
DeviceError— if IWindow is not in valid state
isChildWindow()
bool isChildWindow()
Returns
bool
Whether current window is a child window.
Throws
DeviceError— if IWindow is not in valid state
setFullScreen()
void setFullScreen()
Make a request to let display server to set current Window to full screen.
Window will be set to fullscreen state and the size will set to screen size.
[IWindow#addResizeListener] will be called when size changed. Any
setSize is ignored after this unless [IWindow4#unsetFullScreen] is called.
Clients can subscribe [IWindow#addResizeListener] and call this method, after
window set to fullscreen and size changed, the callback of addResizeListener will
be triggered which has new window size information.
This call is asynchronous call.
Throws
DeviceError— if IWindow is not in valid stateInvalidOperationError— if Window cannot be set to fullscreen
unsetFullScreen()
void unsetFullScreen()
Make a request to let display server to set current Window to non-full screen.
Window will be restore to previous size. [IWindow#addResizeListener] will be
called when size changed. This call is asynchronous call.
Throws
DeviceError— if IWindow is not in valid stateInvalidOperationError— if Window cannot be unset from fullscreen
updateChildWindowZorder()
Update window zordervoidupdateChildWindowZorder(IWindow*refWindow,ZorderPositionpos)
Parameters
refWindow
IWindow* — Required
The reference window has to be already a child of the parent
window or the parent itself. “refWindow” is only used to indicate the relative z-order
position of this child window relative to the reference window.
pos
ZorderPosition — Required
Child window creation parameter “ABOVE_ZPOS” indicates position
above reference window & “BELOW_ZPOS” indicates position below reference window.
Throws
DeviceError— if IWindow is not in valid stateNullPointerError— if any input argument is null pointer while a non-null one is expectedInvalidArgumentError— if any input argument is invalid
setSecureWindowState()
Set window security state.voidsetSecureWindowState(boolsecure)
Parameters
secure
bool — Required
when set to true, window is treated as presenting secure content.
By default window is created as non-secure. Any attempt to take a screenshot when
a secure window is visible on the screen will fail.
Throws
DeviceError— if IWindow is not in valid stateInvalidArgumentError— if any input argument is invalid, or window cannot set to secure state
addGameControllerEventListener()
Adds window game controller event listener. If a client doesn’t know how to handle (or doesn’t want to handle) game controller specific events then it shouldn’t subscribe for IGameControllerEventListener, otherwise their process will be killed due to ANR. Not subscribing for EvtGameController will allow system to convert a set of ‘primary’ game controller events into a set of ‘secondary’ key board events (need to subscribe for IKeyEvent though). This mechanism automatically enables interactive applications to receive basic navigational key events from game controller hardware without actually writing any game controller specific code. To know more about the mapping of game controller primary events into ‘secondary’ key board events, please see https://developer.amazon.com/docs/fire-tv/game-controller-input.html#primary_and_secondary Once subscribed, the listener will continue to receive gaming events until ISubscription#unsubscribe() is called or until the event source is destroyed.com.amazon.apmf.ISubscription*addGameControllerEventListener(IGameControllerEventListener*listener)
Parameters
listener
IGameControllerEventListener* — Required
IGameControllerEventListener interface
Returns
com.amazon.apmf.ISubscription*
ISubscription related to this listener interface
[IGameControllerEventListener]
Throws
DeviceError— if IWindow is not in valid stateNullPointerError— if any input argument is null pointer while a non-null one is expected

