Interface PlatformProvider

This class handles Platform actions. It does not need to be used directly by developers. However, its methods can be overriden by passing an overrideCallback to Platform#init Platform.init in order to implement custom Platform behavior. (See {@tutorial Platform.init})

For an overview of Provider customization, see https://developers.openfin.co/docs/platform-customization#section-customizing-platform-behavior.

Hierarchy

  • PlatformProvider

Methods

  • Handles requests to apply a snapshot to the current Platform.

    Returns

    Parameters

    • payload: ApplySnapshotPayload

      Payload containing the snapshot to be applied, as well as any options.

    • Optional identity: Identity

      Identity of the entity that called Platform.applySnapshot. Undefined if called internally (e.g. when opening the initial snapshot).

    Returns Promise<void>

  • It takes in an array of Views and returns an object specifying which of them are trying to prevent an unload and which are not.

    Returns

    Parameters

    Returns Promise<ViewStatuses>

  • Closes a Window. By default it will fire any before unload handler set by a View in the Window. This can be disabled by setting skipBeforeUnload in the options object of the payload. This method is called by Platform.closeWindow.

    Returns

    Parameters

    Returns Promise<void>

  • Handles requests to fetch manifests in the current platform.

    Parameters

    • payload: FetchManifestPayload

      Payload containing the manifestUrl to be fetched.

    • callerIdentity: Identity

      If Platform.fetchManifest was called, the identity of the caller will be here. If fetchManifest was called internally, callerIdentity will be the provider's identity.

    Returns Promise<any>

  • Gets the current state of windows and their views and returns a snapshot object containing that info.

    Returns

    Snapshot of current platform state.

    Parameters

    • payload: undefined

      Undefined unless you've defined a custom getSnapshot protocol.

    • identity: Identity

      Identity of the entity that called Platform.getSnapshot.

    Returns Promise<Snapshot>

  • Gets all the Views attached to a Window that should close along with it. This is meant to be overridable in the case where you want to return other Views that may not be attached to the Window that is closing.

    Returns

    Parameters

    Returns Promise<OpenFin.View[]>

  • Handles requests to get a window's context. target may be a window or a view. If it is a window, that window's customContext will be returned. If it is a view, the customContext of that view's current host window will be returned.

    Returns

    The new context.

    Parameters

    • payload: GetWindowContextPayload

      Object containing the requested context update, the target's identity, and the target's entityType.

    • Optional identity: Identity

      Identity of the entity that called Platform.getWindowContext. Undefined when getWindowContext is called internally (e.g. when getting a window's context for the purpose of raising a "host-context-changed" event on a reparented view).

    Returns Promise<any>

  • Called when a window's customContext is updated. Responsible for raising the host-context-updated event on that window's child views.

    Returns

    The event that it raised.

    Parameters

    • payload: WindowOptionsChangedEvent

      The event payload for the window whose context has changed. The new context will be contained as payload.diff.customContext.newVal.

    Returns Promise<undefined | HostContextChangedPayload>

  • Called when a snapshot is being applied and some windows in that snapshot would be fully or partially off-screen. Returns an array of windows with modified positions, such that any off-screen windows are positioned in the top left corner of the main monitor.

    Returns

    An array of WindowOptions with their position modified to fit on screen.

    Parameters

    • snapshot: Snapshot

      The snapshot to be applied.

    • outOfBoundsWindows: WindowCreationOptions[]

      An array of WindowOptions for any windows that would be off-screen.

    Returns Promise<WindowCreationOptions[]>

  • Closes the current Platform and all child windows and views.

    Returns

    Parameters

    • payload: undefined

      Undefined unless you have implemented a custom quite protocol.

    • identity: Identity

      Identity of the entity that called Platform.quit.

    Returns Promise<void>

  • Replaces a Platform window's layout with a new layout. Any views that were in the old layout but not the new layout will be destroyed.

    Returns

    Parameters

    • payload: ReplaceLayoutPayload

      Contains the target window and an opts object with a layout property to apply.

    • Optional identity: Identity

      Identity of the entity that called Platform#replaceLayout Platform.replaceLayout. Undefined if replaceLayout is called internally (e.g. while applying a snapshot).

    Returns Promise<void>

  • Handles requests to set a window's context. target may be a window or a view. If it is a window, that window's customContext will be updated. If it is a view, the customContext of that view's current host window will be updated.

    Returns

    The new context.

    Parameters

    • payload: SetWindowContextPayload

      Object containing the requested context update, the target's identity, and the target's entityType.

    • Optional identity: Identity

      Identity of the entity that called Platform.setWindowContext. Undefined if setWindowContext is called internally (e.g. while applying a snapshot).

    Returns Promise<any>

Generated using TypeDoc