Packagefin.desktop
Classpublic class System
InheritanceSystem Inheritance Object



Public Methods
 MethodDefined By
  
System
  
addEventListener(type:String, listener:Function, callback:Function = null, errorCallback:Function = null):void
Registers an event listener on the specified event
System
  
clearCache(cashe:Boolean = false, cookies:Boolean = false, localStorage:Boolean = false, appCache:Boolean = false, userData:Boolean = false, callback:Function = null, errorCallback:Function = null):void
Clears cached data containing window state/positions, application resource files (images, HTML, JavaScript files) cookies, and items stored in the Local Storage.
System
  
deleteCacheOnRestart(callback:Function, errorCallback:Function = null):void
Clears all cached data when App Desktop is restarted
System
  
exit(callback:Function, errorCallback:Function = null):void
Exits App Desktop
System
  
getAllApplications(callBack:Function, errorCallback:Function = null):void
Retrieves an array of data (uuid, running/active state) for all application windows The object passed to callback takes the form: [ { uuid: (string) uuid of the application, isRunning: (bool) true when the application is running/active }, ...
System
  
getAllWindows(callBack:Function, errorCallback:Function = null):void
The object passed to callback takes the form: [ { uuid: (string) uuid of the application, mainWindow: { name: (string) name of the main window, top: (integer) top-most coordinate of the main window, right: (integer) right-most coordinate of the main window, bottom: (integer) bottom-most coordinate of the main window, left: (integer) left-most coordinate of the main window }, childWindows: [{ name: (string) name of the child window, top: (integer) top-most coordinate of the child window, right: (integer) right-most coordinate of the child window, bottom: (integer) bottom-most coordinate of the child window, left: (integer) left-most coordinate of the child window }, ...
System
  
getCommandLineArguments(callback:Function, errorCallback:Function = null):void
Retrieves the command line argument string that started the App
System
  
getDeviceId(callBack:Function, errorCallback:Function = null):void
Gets Device ID
System
  
[static] Gets and instance of the System
System
  
getLog(options:Object, callback:Function, errorCallback:Function = null):void
Retrieves the contents of the log with the specified filenamener
System
  
getLogList(callBack:Function, errorCallback:Function = null):void
Retrieves an array of data objects for all available logs Each object in the returned array takes the form: { name: (string) the filename of the log, size: (integer) the size of the log in bytes, date: (integer) the unix time at which the log was created }
System
  
getMonitorInfo(callback:Function, errorCallback:Function = null):void
System
  
getMousePosition(callBack:Function, errorCallback:Function = null):void
Returns the mouse in virtual screen coordinates (left, top) The returned object takes the form: { top: (integer) the top position of the mouse in virtual screen coordinates, left: (integer) the left position of the mouse in virtual screen coordinates }
System
  
getProcessList(callBack:Function, errorCallback:Function = null):void
Retrieves an array of all processes that are currently running Each element in the array is an object containing the uuid and the name of the application to which the process belongs.
System
  
getVersion(callBack:Function, errorCallback:Function = null):void
Gets AppDesktop version number
System
  
launchExternalProcess(path:String, commandLine:String, callback:Function, errorCallback:Function = null):void
Runs an executable or batch file.
System
  
log(level:String, message:String, callback:Function, errorCallback:Function = null):void
Writes a message to the log
System
  
openUrlWithBrowser(url:String, callback:Function, errorCallback:Function = null):void
Opens the passed URL
System
  
releaseExternalProcess(processUuid:String, callback:Function, errorCallback:Function = null):void
Removes the process entry for the passed UUID
System
  
removeEventListener(type:String, listener:Function, callback:Function = null, errorCallback:Function = null):void
Removes a previously registered event listener from the specified event
System
  
terminateExternalProcess(processUuid:String, timeout:int, killTree:Boolean, callback:Function, errorCallback:Function = null):void
Attempts to cleanly close an external process and terminates it if the close has not occured after the elapsed timeout in milliseconds.
System
Constructor Detail
System()Constructor
public function System()



Method Detail
addEventListener()method
public function addEventListener(type:String, listener:Function, callback:Function = null, errorCallback:Function = null):void

Registers an event listener on the specified event

Parameters

type:String — Type of the event
 
listener:Function — The listener function for the event
 
callback:Function (default = null) — A function that is called if successful in registering the event
 
errorCallback:Function (default = null) — A function that is called if the method fails

See also

fin.desktop.events.SystemEvent
removeEventListener()
clearCache()method 
public function clearCache(cashe:Boolean = false, cookies:Boolean = false, localStorage:Boolean = false, appCache:Boolean = false, userData:Boolean = false, callback:Function = null, errorCallback:Function = null):void

Clears cached data containing window state/positions, application resource files (images, HTML, JavaScript files) cookies, and items stored in the Local Storage.

Parameters

cashe:Boolean (default = false) — If true, clears chrome caches
 
cookies:Boolean (default = false) — If true, deletes all cookies
 
localStorage:Boolean (default = false) — If true, clear application caches
 
appCache:Boolean (default = false) — If true, clears local storage
 
userData:Boolean (default = false) — If true, clears user data
 
callback:Function (default = null) — A function that is called if successful
 
errorCallback:Function (default = null) — A function that is called if the method fails

deleteCacheOnRestart()method 
public function deleteCacheOnRestart(callback:Function, errorCallback:Function = null):void

Clears all cached data when App Desktop is restarted

Parameters

callback:Function — A function that is called if successful
 
errorCallback:Function (default = null) — A function that is called if the method fails

exit()method 
public function exit(callback:Function, errorCallback:Function = null):void

Exits App Desktop

Parameters

callback:Function — A function that is called if successful
 
errorCallback:Function (default = null) — A function that is called if the method fails

getAllApplications()method 
public function getAllApplications(callBack:Function, errorCallback:Function = null):void

Retrieves an array of data (uuid, running/active state) for all application windows The object passed to callback takes the form: [ { uuid: (string) uuid of the application, isRunning: (bool) true when the application is running/active }, ... ]

Parameters

callBack:Function — A function that is called if successful
 
errorCallback:Function (default = null) — A function that is called if the method fails

getAllWindows()method 
public function getAllWindows(callBack:Function, errorCallback:Function = null):void

The object passed to callback takes the form: [ { uuid: (string) uuid of the application, mainWindow: { name: (string) name of the main window, top: (integer) top-most coordinate of the main window, right: (integer) right-most coordinate of the main window, bottom: (integer) bottom-most coordinate of the main window, left: (integer) left-most coordinate of the main window }, childWindows: [{ name: (string) name of the child window, top: (integer) top-most coordinate of the child window, right: (integer) right-most coordinate of the child window, bottom: (integer) bottom-most coordinate of the child window, left: (integer) left-most coordinate of the child window }, ... ] }, ... ]

Parameters

callBack:Function — A function that is called if successful
 
errorCallback:Function (default = null) — A function that is called if the method fails

getCommandLineArguments()method 
public function getCommandLineArguments(callback:Function, errorCallback:Function = null):void

Retrieves the command line argument string that started the App

Parameters

callback:Function — A function that is called if successful
 
errorCallback:Function (default = null) — A function that is called if the method fails

getDeviceId()method 
public function getDeviceId(callBack:Function, errorCallback:Function = null):void

Gets Device ID

Parameters

callBack:Function — A function that is called if successful with device id passed to it.
 
errorCallback:Function (default = null) — A function that is called if the method fails

getInstance()method 
public static function getInstance():System

Gets and instance of the System

Returns
System
getLog()method 
public function getLog(options:Object, callback:Function, errorCallback:Function = null):void

Retrieves the contents of the log with the specified filenamener

Parameters

options:Object — A function that is called if successful
 
callback:Function — A function that is called if the method fails
 
errorCallback:Function (default = null)

getLogList()method 
public function getLogList(callBack:Function, errorCallback:Function = null):void

Retrieves an array of data objects for all available logs Each object in the returned array takes the form: { name: (string) the filename of the log, size: (integer) the size of the log in bytes, date: (integer) the unix time at which the log was created }

Parameters

callBack:Function — A function that is called if successful
 
errorCallback:Function (default = null) — A function that is called if the method fails

getMonitorInfo()method 
public function getMonitorInfo(callback:Function, errorCallback:Function = null):void

Parameters

callback:Function
 
errorCallback:Function (default = null)

getMousePosition()method 
public function getMousePosition(callBack:Function, errorCallback:Function = null):void

Returns the mouse in virtual screen coordinates (left, top) The returned object takes the form: { top: (integer) the top position of the mouse in virtual screen coordinates, left: (integer) the left position of the mouse in virtual screen coordinates }

Parameters

callBack:Function — A function that is called if successful
 
errorCallback:Function (default = null) — A function that is called if the method fails

getProcessList()method 
public function getProcessList(callBack:Function, errorCallback:Function = null):void

Retrieves an array of all processes that are currently running Each element in the array is an object containing the uuid and the name of the application to which the process belongs.

Parameters

callBack:Function — A function that is called if successful
 
errorCallback:Function (default = null) — A function that is called if the method fails

getVersion()method 
public function getVersion(callBack:Function, errorCallback:Function = null):void

Gets AppDesktop version number

Parameters

callBack:Function — A function that is called if successful, with version number passed to it.
 
errorCallback:Function (default = null) — A function that is called if the method fails

launchExternalProcess()method 
public function launchExternalProcess(path:String, commandLine:String, callback:Function, errorCallback:Function = null):void

Runs an executable or batch file.

Parameters

path:String — The path of the file to launch via the command line
 
commandLine:String — The command line arguments to pass
 
callback:Function — A function that is called if the method succeeds
 
errorCallback:Function (default = null) — A function that is called if the method fails

log()method 
public function log(level:String, message:String, callback:Function, errorCallback:Function = null):void

Writes a message to the log

Parameters

level:String — The log level for the entry. Can be either "info", "warning" or "error"
 
message:String — The log message text
 
callback:Function — A function that is called if successful
 
errorCallback:Function (default = null) — A function that is called if the method fails

openUrlWithBrowser()method 
public function openUrlWithBrowser(url:String, callback:Function, errorCallback:Function = null):void

Opens the passed URL

Parameters

url:String
 
callback:Function
 
errorCallback:Function (default = null)

releaseExternalProcess()method 
public function releaseExternalProcess(processUuid:String, callback:Function, errorCallback:Function = null):void

Removes the process entry for the passed UUID

Parameters

processUuid:String — The UUID for a process
 
callback:Function — function that is called if successful
 
errorCallback:Function (default = null) — A function that is called if the method fails

removeEventListener()method 
public function removeEventListener(type:String, listener:Function, callback:Function = null, errorCallback:Function = null):void

Removes a previously registered event listener from the specified event

Parameters

type:String — Type of the event
 
listener:Function — The listener function for the event
 
callback:Function (default = null) — A function that is called if successful in un-registering the event
 
errorCallback:Function (default = null) — A function that is called if the method fails

See also

terminateExternalProcess()method 
public function terminateExternalProcess(processUuid:String, timeout:int, killTree:Boolean, callback:Function, errorCallback:Function = null):void

Attempts to cleanly close an external process and terminates it if the close has not occured after the elapsed timeout in milliseconds.

Parameters

processUuid:String — The UUID for a process launched by DesktopSystem.launchExternalProcess()
 
timeout:int — The time in milliseconds to wait for a close to occur before terminating
 
killTree:Boolean
 
callback:Function — A function that is called if the method succeed with result code being passed
 
errorCallback:Function (default = null) — A function that is called if the method fails