Methods
__cancelModalAction(e){undefined}
Parameters
Name |
Type |
Description |
e |
Event
|
Optional event passed to method |
Default cancel/close modal action - do not change
__confirmModalAction(e){undefined}
Parameters
Name |
Type |
Description |
e |
Event
|
Optional event passed to method |
Default confirm modal action - do not change
_cancelModalAction(e){mixed}
Parameters
Name |
Type |
Description |
e |
Event
|
Optional event passed to method |
Internal method that is overwritten when particular modal is opened.
Overwritten method contains all logic for modal cancelling or closing
_confirmModalAction(e){mixed}
Parameters
Name |
Type |
Description |
e |
Event
|
Optional event passed to method |
Internal method that is overwritten when particular modal is opened.
Overwritten method contains all logic for modal confirmation
_doLog(debugMessage){undefined}
Parameters
Name |
Type |
Description |
debugMessage |
Object
|
Message object to be logged (returned by this.getMessageObject method) |
Does actual logging to console (and log file is file logging is enabled)
_getStack(){array}
Helper method for getting call stack array for debug or user message objects
addBoundMethods(){undefined}
Method that sets up this.boundMethods property by binding this objects
functions to itself to be used as event listener handlers
addDesktopNotification(message, data, dontTranslate, options, callbacks){undefined}
Parameters
Name |
Type |
Description |
message |
string
|
Notification message |
data |
array
|
An array of data strings that are to be applied to notification |
dontTranslate |
Boolean
|
Flag to prevent automatic notification translation |
options |
Object
|
Desktop notification options (passed to HTML5 Notification object constructor) |
callbacks |
Object
|
Object with onshow, onClicked, onClosed and onerror notification handlers |
Displays desktop notification
Notification message is being interpolated by replacing placeholders
such as '{1}', '{2}' etc. by corresponding values from 'data' argument
addEventListeners(){undefined}
Adds event listeners for this object
addModalMessage(message, type, data, important, dontTranslate, force, passToDebug){undefined}
Parameters
Name |
Type |
Description |
message |
string
|
Message to be logged |
type |
string
|
Type of log message (debug, info, warning, error) |
data |
array
|
An array of data strings that are to be applied to logging message |
important |
Boolean
|
Flag to indicate message importance |
dontTranslate |
Boolean
|
Flag to prevent automatic message translation |
force |
Boolean
|
Flag to force message output even if configuration wouldn't allow it |
passToDebug |
Boolean
|
Flag to force passing same message to debug log |
Adds modal message to currently open modal dialog
Message is being interpolated by replacing placeholders
such as '{1}', '{2}' etc. by corresponding values from 'data' argument
addNotification(message, type, data, dontTranslate, options){undefined}
Parameters
Name |
Type |
Description |
message |
string
|
Notification message |
type |
string
|
Notification message type |
data |
array
|
An array of data strings that are to be applied to notification |
dontTranslate |
Boolean
|
Flag to prevent automatic notification translation |
options |
Object
|
Additional notification options |
Displays app notification
Notification message is being interpolated by replacing placeholders
such as '{1}', '{2}' etc. by corresponding values from 'data' argument
addUserMessage(message, type, data, important, dontTranslate, force, passToDebug){undefined}
Parameters
Name |
Type |
Description |
message |
string
|
Message to be logged |
type |
string
|
Type of log message (debug, info, warning, error) |
data |
array
|
An array of data strings that are to be applied to logging message |
important |
Boolean
|
Flag to indicate message importance |
dontTranslate |
Boolean
|
Flag to prevent automatic message translation |
force |
Boolean
|
Flag to force message output even if configuration wouldn't allow it |
passToDebug |
Boolean
|
Flag to force passing same message to debug log |
Logs user message if conditions are met
Message is being interpolated by replacing placeholders
such as '{1}', '{2}' etc. by corresponding values from 'data' argument
addWrapperEventListeners(){undefined}
Adds event listeners for the AppWrapper instance
asyncMessage(data){mixed}
Parameters
Name |
Type |
Description |
data |
Object
|
Message data object |
Emits 'asyncMessage' global event, listened by main script
asyncMessageInfo(data, verboseOutput){Object}
Parameters
Name |
Type |
Description |
data |
Object
|
Message data.data object |
verboseOutput |
Boolean
|
Toggles verbose output |
Returns info on async messages that can be passed to mainScript
beforeUnload(){undefined}
Handler that is triggered before application window is reloaded (available only with debug enabled)
beforeWindowClose(){undefined}
Handler that performs necessary operations before application window gets closed
callObjMethod(methodString, methodArgs, context){mixed}
Parameters
Name |
Type |
Description |
methodString |
string
|
String that represents method path (i.e. 'app.appObject.method') |
methodArgs |
array
|
An array of arguments to be applied to the returned method reference |
context |
Object
|
Context that will be applied as 'this' to returned method reference |
Finds and calls method of the object based on passed parameters
callViewHandler(e){undefined}
Parameters
Name |
Type |
Description |
e |
Event
|
Event that triggered the handler |
Generic frontend event listener for calling methods within app scope (but not within current Vue cmponent scope)
cancelModalAction(e){mixed}
Parameters
Name |
Type |
Description |
e |
Event
|
Optional event passed to method |
Placeholder method that handles modal cancel/close action
changeLanguage(selectedLanguageName, selectedLanguage, selectedLocale, skipOtherWindow){boolean}
Parameters
Name |
Type |
Description |
selectedLanguageName |
string
|
Name of new app language |
selectedLanguage |
Object
|
Object representing new app language |
selectedLocale |
string
|
Locale of new app language |
skipOtherWindow |
boolean
|
Flag that triggers language change in other app windows (if any) |
Handler for changing current application language
cleanup(){boolean}
Cleanup method - calls cleanup/shutdown methods for all eligible dependencies, cleaning
the app state so it can be safely closed
clearIntervals(){undefined}
Clears all intervals bound to this AppWrapper instance
clearTimeouts(){undefined}
Clears all timeouts bound to this AppWrapper instance
confirmModalAction(e){mixed}
Parameters
Name |
Type |
Description |
e |
Event
|
Optional event passed to method |
Placeholder method that handles modal confirm action
destroy(){undefined}
Destructor method - cleans up references for this instance
freeing memory upon object destruction
exitApp(force){undefined}
Parameters
Name |
Type |
Description |
force |
Boolean
|
Force window closing |
Exits the app, closing app window
finalize(){booelan}
Finalizes appWrapper and its dependencies. This method is called once
frontend application is created, so code here has all references that
are available to the application
finalizeDebugMessageLog(){boolean}
Finalizes debug log file if debug logging to file is enabled
finalizeLogs(){boolean}
Finalizes log files if logging to file is enabled
finalizeUserMessageLog(){boolean}
Initializes debug log file if debug logging to file is enabled
getAppDir(){string}
Determines and returns absolute path to app directory.
Takes into consideration OS platform and way that app is
being run (whether by calling nwjs or running finished packaged app)
getAppState(){Object}
Returns appState object if exists, initializing it and returning it if it doesn't
getAppWrapper(){AppWrapper}
Helper method to get appWrapper instance
getConfig(name, defaultValue){mixed}
Parameters
Name |
Type |
Description |
name |
string
|
String representing path to requested var (i.e. 'appConfig.appInfo.name') |
defaultValue |
mixed
|
Default value to be returned if configuration var is not found |
Returns configuration var value
getDebugMessageFileLine(message){string}
Parameters
Name |
Type |
Description |
message |
obj
|
Message object to be logged (returned by this.getMessageObject method) |
Returns string representing log line for appending
to debug log file
getDebugMessageFilePath(){string}
Returns path to debug message log file
getExecPath(){string}
Returns base exec path (root dir of the app)
getHelper(helperName){Object}
Parameters
Name |
Type |
Description |
helperName |
string
|
Name of the helper |
Returns instance of helper object based on passed parameter (or false if helper can't be found)
getInitialAppConfig(defaultAppConfig){Object}
Parameters
Name |
Type |
Description |
defaultAppConfig |
Object
|
Default application config |
Loads config overrides if present, and returns config object for the app
getMessageFileLine(message){string}
Parameters
Name |
Type |
Description |
message |
obj
|
Message object to be logged (returned by this.getMessageObject method) |
Gets JSON represenation of message object for saving into log file,
removing unneccessary properties and adding necessary ones
getMessageObject(messageLevel, message, type, data, important, dontTranslate, force){Object}
Parameters
Name |
Type |
Description |
messageLevel |
int
|
Number representing current message level (0=debug, 1=info, 2=warning, 3=error) |
message |
string
|
Message to be logged |
type |
string
|
Type of log message (debug, info, warning, error) |
data |
array
|
An array of data strings that are to be applied to logging message |
important |
Boolean
|
Flag to indicate message importance |
dontTranslate |
Boolean
|
Flag to prevent automatic message translation |
force |
Boolean
|
Flag to force message output even if configuration wouldn't allow it |
Returns prepared message object based on passed arguments.
Message is being interpolated by replacing placeholders
such as '{1}', '{2}' etc. by corresponding values from 'data' argument
getMessageObjectRow(index, messageRowData){Object}
Parameters
Name |
Type |
Description |
index |
mixed
|
Key or array index |
messageRowData |
Object
|
Message row data for logging |
Gets single row for tabular message logging
getObjMethod(methodString, methodArgs, context, silent){function}
Parameters
Name |
Type |
Description |
methodString |
string
|
String that represents method path (i.e. 'app.appObject.method') |
methodArgs |
array
|
An array of arguments to be applied to the returned method reference |
context |
Object
|
Context that will be applied as 'this' to returned method reference |
silent |
boolean
|
Flag to control logging output |
Finds and returns method of the object based on passed parameters
getPlatformData(){Object}
Returns platform data for current platform
getStateVar(varPath, defaultValue){mixed}
Parameters
Name |
Type |
Description |
varPath |
string
|
String representing path to requested var (i.e. 'appData.appMainData.cancelable') |
defaultValue |
mixed
|
Default value to be returned if appState var is not found |
Returns appState var value
getTableMessageData(message){Object}
Parameters
Name |
Type |
Description |
message |
Object
|
Tabular data |
Prepares table data for tabular message logging
getUserMessageFileLine(message){string}
Parameters
Name |
Type |
Description |
message |
obj
|
Message object to be logged (returned by this.getMessageObject method) |
Returns string representing log line for appending
to user message log file
getUserMessageFilePath(){string}
Returns path to user message log file
globalEmit(eventName, data){undefined}
Parameters
Name |
Type |
Description |
eventName |
String
|
Name of the event |
data |
Object
|
Event data object |
Emits event to globalEmitter (listened by both main script and app code)
handleMainMessage(data){undefined}
Parameters
Name |
Type |
Description |
data |
Object
|
Message data |
Handles messages from main script
handleMessageResponse(messageData){undefined}
Parameters
Name |
Type |
Description |
messageData |
Object
|
Message response data |
Handles message responses from main script
initialize(){AppWrapper}
Initializes appWrapper and its dependencies, preparing the wrapper
to start the application itself
initializeApp(){undefined}
Initializes app object
initializeDebugMessageLog(){boolean}
Initializes debug message log file if debug message logging to file is enabled
initializeFeApp(noFinalize){Vue}
Parameters
Name |
Type |
Description |
noFinalize |
Boolean
|
Flag to prevent finalization (used when reinitializing) |
Initializes frontend part of the app, creating Vue instance
initializeHelpers(helperDirs){Object}
Parameters
Name |
Type |
Description |
helperDirs |
Array.<string>
|
An array of absolute paths where helper files are located |
Loads and initializes helpers from directories passed in argument
initializeLanguage(){Object}
Loads language and translation data and initializes language and
translation systems used in the app
Parameters
Name |
Type |
Description |
options |
Object
|
Options for logging initialization (currently only 'silent' property is used, determining whether warnings should be printed if no config found) |
Determines whether logging for this class is regulated through
configuration, setting the logging by it (or warning if there
are no configuration settings for this class)
initializeSystemHelpers(){undefined}
Initializes wrapper system helpers
initializeUserMessageLog(){boolean}
Initializes user message log file if user message logging to file is enabled
initializeWrapperHelpers(){undefined}
Initializes wrapper helpers
isDebugEnabled(){Boolean}
Checks whether debug mode is on
isLinux(){Boolean}
Checks whether current platform is linux
isMac(){Boolean}
Checks whether current platform is mac
isWindows(){Boolean}
Checks whether current platform is windows
loadHelpers(helperDirs){Object}
Parameters
Name |
Type |
Description |
helperDirs |
Array.<string>
|
An array of absolute paths where helper files are located |
Loads and helpers from directories passed in argument
log(message, type, data, force){undefined}
Parameters
Name |
Type |
Description |
message |
string
|
Message to be logged |
type |
string
|
Type of log message (debug, info, warning, error, group, groupCollaped, groupend) |
data |
array
|
An array of data strings that are to be applied to logging message |
force |
Boolean
|
Flag to force logging output even if config does not allow it |
Logs debug message if conditions are met
Message is being interpolated by replacing placeholders
such as '{1}', '{2}' etc. by corresponding values from 'data' argument
mergeDeep(){Object}
Helper method for deep object merging
First passed parameter is destination object, all other parameters are source
objects that will be merged with destination clone.
This method does NOT mutate original object.
message(data){undefined}
Parameters
Name |
Type |
Description |
data |
Object
|
Event data object |
Emits 'message' global event, listened by main script
messageInfo(data, verboseOutput){Object}
Parameters
Name |
Type |
Description |
data |
Object
|
Message data.data object |
verboseOutput |
Boolean
|
Toggles verbose output |
Returns info on messages that can be passed to mainScript
messageInfoOutput(messageData, verboseOutput){undefined}
Parameters
Name |
Type |
Description |
messageData |
Object
|
Message response data |
verboseOutput |
Boolean
|
Toggles verbose output |
Logs messages info to console
messageResponseLog(messageData){undefined}
Parameters
Name |
Type |
Description |
messageData |
Object
|
Message response data |
Logs eventual user and debug messages and displays eventual notifications from message response
nextTick(){boolean}
Helper methods that waits for process.nexTick to happen before allowing
code execution
onDebugWindowClose(){undefined}
Handler that is triggered before application window is closed (available only with debug enabled)
onDebugWindowUnload(){undefined}
Handler that is triggered before application debug window is reloaded (available only with debug enabled)
onNextTick(callable){mixed}
Parameters
Name |
Type |
Description |
callable |
function
|
Function that will be called after nextTick |
Helper methods that calls function passed in argument upon process.nextTick
onWindowClose(){undefined}
Handler that performs necessary operations when application window gets closed
processCommandParams(){undefined}
Process eventual command line params
reinitializeFeApp(){Vue}
Reinitializes frontend app by destroying it and initializing it again
removeBoundMethods(){undefined}
Method that cleans up this.boundMethods property
set in this.addBoundMethods method
removeEventListeners(){undefined}
Removes event listeners for this object
removeWrapperEventListeners(){undefined}
Removes event listeners for the AppWrapper instance
resetAppError(){undefined}
Resets (turns off) application error, removing app-error component
resetAppStatus(){undefined}
Resets app status to not busy/idle state
setAppError(title, text, debugText, data, doNotTranslate, messageType, omitIcon){undefined}
Parameters
Name |
Type |
Description |
title |
String
|
App error title |
text |
String
|
App error text |
debugText |
String
|
App error debug text (shown only if debug is enabled) |
data |
Array.<String>
|
An array with replacement data for error title, text and debugText |
doNotTranslate |
Boolean
|
Flag to prevent automatic traslation of title and text |
messageType |
String
|
null
|
Type of messages to show in app-error ('user', 'debug' or null) |
omitIcon |
Boolean
|
Flag to control app-error icon rendering |
Sets (turns on) application error, triggering rendering of app-error component
setAppInstance(){undefined}
Loads and instantiates app instance
setAppStatus(appBusy, appStatus){undefined}
Parameters
Name |
Type |
Description |
appBusy |
boolean
|
Flag that indicates whether entire app should be considered as 'busy' |
appStatus |
string
|
String that indicates current app status (for display in app header live info component) |
Helper function to set app status variables in app state
setDynamicAppStateValues(){undefined}
Sets dynamic (calculated) appState values (mainly language related)
setGlobalKeyHandlers(){undefined}
Sets global key handler listeners for config global keys
showAppInfo(){undefined}
Opens app info modal
shutdownApp(){boolean}
Shuts down application, removing menus, tray icons and eventual other functionalities
that were initializes upon application start
translate(text, currentLanguage, data){string}
Parameters
Name |
Type |
Description |
text |
string
|
Text to be translated |
currentLanguage |
string
|
Curent language code |
data |
array
|
An array of data strings that are to be applied to translated message |
Returns translated value for passed arguments
Translation is being interpolated by replacing placeholders
such as '{1}', '{2}' etc. by corresponding values from 'data' argument
wait(duration){boolean}
Parameters
Name |
Type |
Description |
duration |
Integer
|
Pause duration in milliseconds |
Helper method that stops execution for time determined by passed parameter