Files
JiboOs/docs/rendering/gui/ViewProcess.js

194 lines
6.1 KiB
JavaScript
Raw Normal View History

2026-03-16 13:53:01 +02:00
/**
* Process is currently in the queue.
* @type {string}
* @name jibo.face.views.ViewProcess#QUEUED
* @readOnly
*/
/**
* Process has been started.
* @type {string}
* @name jibo.face.views.ViewProcess#STARTED
* @readOnly
*/
/**
* Process has successfully completed.
* @type {string}
* @name jibo.face.views.ViewProcess#COMPLETED
* @readOnly
*/
/**
* Process was interrupted by another process.
* @type {string}
* @name jibo.face.views.ViewProcess#INTERRUPTED
* @readOnly
*/
/**
* Process failed.
* @type {string}
* @name jibo.face.views.ViewProcess#FAILED
* @readOnly
*/
/**
* Get flag to determine if views currently in process.
* If a new process is requested while active the active process will be interrupted.applied.
* @name jibo.face.views.ViewProcess#active
* @type {Boolean}
* @readOnly
*/
/**
* Options for current view change.
* @name jibo.face.views.ViewProcess#changeOptions
* @type {jibo.face.views~ChangeOptions}
*/
/**
* Callback for process completes.
* @name jibo.face.views.ViewProcess#_onComplete
* @type {jibo.face.views~ViewCallback}
*/
/**
* Callback for process fails, due to error or interruption.
* @name jibo.face.views.ViewProcess#onFailure
* @type {Function}
*/
/**
* Callback for when next view in process has loaded.
* Use to access view prior to it being added to display and opened.
* @name jibo.face.views.ViewProcess#onLoaded
* @type {jibo.face.views~ViewCallback}
*/
/**
* Queue of view change processes.
* @name jibo.face.views.ViewProcess#processQueue
* @type {jibo.face.views.ViewProcess[]}
*/
/**
* Current state of process.
* @name jibo.face.views.ViewProcess#status
* @type {String}
*/
/**
* Flag to determine if views currently in process.
* If a new process is requested while active the active process will be interrupted.
* @name jibo.face.views.ViewProcess#_active
* @type {Function}
* @private
*/
/**
* Array of Views involved in the current process.
* A reference is kept so that views can be destroyed if process is interrupted.
* @name jibo.face.views.ViewProcess#_activeViews
* @type {Array<jibo.face.views.View>}
* @private
*/
/**
* Currently active view in display.
* @name jibo.face.views.ViewProcess#_currentView
* @type {jibo.face.views.View}
* @private
*/
/**
* Currently active view in display.
* @name jibo.face.views.ViewProcess#currentView
* @type {jibo.face.views.View}
*/
/**
* View that was previously current but is now in process of closing.
* @name jibo.face.views.ViewProcess#_closingView
* @type {jibo.face.views.View}
* @private
*/
/**
* View that was previously current but is now in process of closing.
* @name jibo.face.views.ViewProcess#closingView
* @type {jibo.face.views.View}
*/
/**
* Flag for process interruption, if 'true' process has been interrupted.
* @name jibo.face.views.ViewProcess#_interrupted
* @type {boolean}
* @private
*/
/**
* Flag for process interruption, if 'true' process has been interrupted.
* @name jibo.face.views.ViewProcess#interrupted
* @type {boolean}
* @readOnly
*/
/**
* Prepare change options for logging
* @method jibo.face.views.ViewProcess#serializeOptions
* @param {jibo.face.views~ChangeOptions} changeOptions - Options for the change view process being queued.
* @public
*/
/**
* Start the view process.
* Before starting a process should check for interrupt.
* @method jibo.face.views.ViewProcess#start
* @param {jibo.face.views~ViewCallback} onComplete Callback for process completes.
* @param {Function} onFailure Callback for process fails, due to error or interruption.
* @param {jibo.face.views~ViewCallback} onLoaded - Callback for when next view in process has loaded.
* @param {jibo.face.views~ChangeOptions} changeOptions - Options for the change view process being queued.
*/
/**
* Adds View to Array of Views involved in the current process.
* A reference is kept so that views can be destroyed if process is interrupted.
* @method jibo.face.views.ViewProcess#storeView
* @param {jibo.face.views.View} view View to keep reference to for current process.
*/
/**
* Call to complete process.
* Completion callbacks are triggered and process is cleared.
* @method jibo.face.views.ViewProcess#complete
* @param {jibo.face.views.View} [view] View established by process, not all processes will return a view.
*/
/**
* Fail current process, call appropriate callbacks and clean up.
* @method jibo.face.views.ViewProcess#fail
* @param {Boolean} retainCurrent - if `true` prevents currentView from being destroyed.
*/
/**
* Check for active process, if active sets the interrupted flag to `true`.
* @method jibo.face.views.ViewProcess#interrupt
* @param {jibo.face.views~ChangeOptions} changeOptions - Options for the process being queued. Identifier for interrupting process, useful in debugging.
* @returns {boolean} `true` if a process is interrupted.
*/
/**
* Add a change view process to the queue.
* @method jibo.face.views.ViewProcess#addProcessToQueue
* @param {jibo.face.views~ChangeOptions} changeOptions - Options for the process being queued.
* @param {jibo.face.views~ViewCallback} [onComplete] - Callback if process completes, returns current view as param.
* @param {Function} [onFailure] - Callback if queued process fails, gets interrupted, or does not get to execute.
* @param {jibo.face.views~ViewCallback} [onLoaded] Called when next view has loaded, can be used to augment View prior to it being displayed.
*/
/**
* Clear the view process references.
* @method jibo.face.views.ViewProcess#clear
* @private
*/