User Tools

Site Tools


code:system:system

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

code:system:system [2011/01/30 21:39] – created jmgrcode:system:system [2011/04/20 20:28] (current) – removed jmgr
Line 1: Line 1:
-====== System ====== 
-This object allows you to get informations about the current operating system and execute some actions on it. 
  
-===== Functions ===== 
- 
-==== System ==== 
-Constructor function. 
- 
-=== Syntax === 
-<code javascript> 
-var myObject = new System(); 
-</code> 
- 
-===== Methods ===== 
- 
-==== storageLocationPath ==== 
-Returns the path of a standard storage location. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.storageLocationPath(location); 
-</code> 
- 
-=== Arguments === 
-  - location - ([[#StorageLocation|StorageLocation]]) the storage location 
- 
-=== Returns === 
-  * (string) the storage location path 
- 
-==== storageLocationName ==== 
-Returns the name of a standard storage location. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.storageLocationName(location); 
-</code> 
- 
-=== Arguments === 
-  - location - ([[#StorageLocation|StorageLocation]]) the storage location 
- 
-=== Returns === 
-  * (string) the storage location name 
- 
-==== openUrl ==== 
-Uses the default browser to open an URL. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.openUrl(url); 
-</code> 
- 
-=== Arguments === 
-  - url - (string) the URL to open 
- 
-=== Returns === 
-  * (System) this System 
- 
-=== Exceptions === 
-  * (OpenUrlError) cannot open the URL 
- 
-==== screenCount ==== 
-Returns the screen count. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.screenCount(); 
-</code> 
- 
-=== Returns === 
-  * (integer) the screen count 
- 
-==== availableGeometry ==== 
-Returns the available geometry on a screen. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.screenCount(); 
-</code> 
-<code javascript> 
-myObject.screenCount(screen); 
-</code> 
- 
-=== Arguments === 
-  - screen - (integer) the screen (default: the default screen) 
- 
-=== Returns === 
-  * ([[code:core:rect]]) the screen geometry 
- 
-==== screenGeometry ==== 
-Returns the screen geometry. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.screenGeometry(); 
-</code> 
-<code javascript> 
-myObject.screenGeometry(screen); 
-</code> 
- 
-=== Arguments === 
-  - screen - (integer) the screen (default: the default screen) 
- 
-=== Returns === 
-  * ([[code:core:rect]]) the screen geometry 
- 
-==== primaryScreen ==== 
-Returns the primary screen index. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.primaryScreen(); 
-</code> 
- 
-=== Returns === 
-  * (integer) the primary screen index 
- 
-==== isVirtualDesktop ==== 
-Returns true if the desktop is virtual. A virtual desktop may assemble multiple monitors into one screen. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.isVirtualDesktop(); 
-</code> 
- 
-=== Returns === 
-  * (boolean) true if the desktop is virtual 
- 
-==== colorDepth ==== 
-Returns the color depth of a screen. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.colorDepth(screen); 
-</code> 
- 
-=== Arguments === 
-  - screen - (integer) the screen (default: the default screen) 
- 
-=== Returns === 
-  * (integer) the color depth 
- 
-==== displayBrightness ==== 
-Returns the display brightness of a screen. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.displayBrightness(screen); 
-</code> 
- 
-=== Arguments === 
-  - screen - (integer) the screen (default: the default screen) 
- 
-=== Returns === 
-  * (integer) the display brightness 
- 
-==== currentDirectory ==== 
-Returns the current directory. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.currentDirectory(); 
-</code> 
- 
-=== Returns === 
-  * (string) the current directory 
- 
-==== username ==== 
-Returns the user name. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.username(); 
-</code> 
- 
-=== Returns === 
-  * (string) the user name 
- 
-==== variable ==== 
-Returns the value of an environment variable. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.variable(name); 
-</code> 
- 
-=== Arguments === 
-  - name - (string) the name of the environment variable 
- 
-=== Returns === 
-  * (string) the value of the environment variable 
- 
-==== timestamp ==== 
-Returns the current Unix timestamp. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.timestamp(); 
-</code> 
- 
-=== Returns === 
-  * (integer) the current Unix timestamp 
- 
-==== osName ==== 
-Returns the operating system name. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.osName(); 
-</code> 
- 
-=== Returns === 
-  * (string) the operating system name 
- 
-=== Notes === 
-This method should return "GNU/Linux" or "Windows". 
- 
-==== version ==== 
-Returns the operating system version. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.version(); 
-</code> 
- 
-=== Returns === 
-  * (string) the operating system version 
- 
-==== countryCode ==== 
-Returns the current country code. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.countryCode(); 
-</code> 
- 
-=== Returns === 
-  * (string) the current country code 
- 
-==== language ==== 
-Returns the current language. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.language(); 
-</code> 
- 
-=== Returns === 
-  * (string) the current language 
- 
-==== logicalDrives ==== 
-Returns an array of string representing the logical drives. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.logicalDrives(); 
-</code> 
- 
-=== Returns === 
-  * (array) an array of string representing the logical drives 
- 
-==== availableDiskSpace ==== 
-Returns the available disk space on a drive in bytes. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.availableDiskSpace(drive); 
-</code> 
- 
-=== Arguments === 
-  - drive - (string) the drive 
- 
-=== Returns === 
-  * (integer) the available disk space on a drive in bytes 
- 
-==== totalDiskSpace ==== 
-Returns the total disk space on a drive in bytes. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.totalDiskSpace(drive); 
-</code> 
- 
-=== Arguments === 
-  - drive - (string) the drive 
- 
-=== Returns === 
-  * (integer) the total disk space on a drive in bytes 
- 
-==== driveType ==== 
-Returns the type of a drive. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.driveType(drive); 
-</code> 
- 
-=== Arguments === 
-  - drive - (string) the drive 
- 
-=== Returns === 
-  * ([[#DriveType|DriveType]]) the drive type 
- 
-==== batteryLevel ==== 
-Returns the battery level. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.batteryLevel(); 
-</code> 
- 
-=== Returns === 
-  * (integer) the battery level (percentage) 
- 
-==== powerState ==== 
-Returns the power state. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.powerState(); 
-</code> 
- 
-=== Returns === 
-  * ([[#PowerState|PowerState]]) the power state 
- 
-==== manufacturer ==== 
-Returns the device's manufacturer name. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.manufacturer(); 
-</code> 
- 
-=== Returns === 
-  * (string) the manufacturer name 
- 
-==== model ==== 
-Returns the device's model name. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.model(); 
-</code> 
- 
-=== Returns === 
-  * (string) the model name 
- 
-==== productName ==== 
-Returns the device's product name. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.productName(); 
-</code> 
- 
-=== Returns === 
-  * (string) the product name 
- 
-==== logout ==== 
-Logouts the current user. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.logout(); 
-</code> 
-<code javascript> 
-myObject.logout(force); 
-</code> 
- 
-=== Arguments === 
-  - force - (boolean) force the logout 
- 
-=== Returns === 
-  * (System) this System 
- 
-=== Exceptions === 
-  * (LogoutError) unable to logout 
- 
-==== restart ==== 
-Restarts the computer. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.restart(); 
-</code> 
-<code javascript> 
-myObject.restart(force); 
-</code> 
- 
-=== Arguments === 
-  - force - (boolean) force the restart 
- 
-=== Returns === 
-  * (System) this System 
- 
-=== Exceptions === 
-  * (RestartError) unable to restart 
- 
-==== shutdown ==== 
-Stops the computer. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.shutdown(); 
-</code> 
-<code javascript> 
-myObject.shutdown(force); 
-</code> 
- 
-=== Arguments === 
-  - force - (boolean) force the shutdown 
- 
-=== Returns === 
-  * (System) this System 
- 
-=== Exceptions === 
-  * (ShutdownError) unable to shutdown 
- 
-==== suspend ==== 
-Suspends the computer. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.suspend(); 
-</code> 
-<code javascript> 
-myObject.suspend(force); 
-</code> 
- 
-=== Arguments === 
-  - force - (boolean) force the suspend 
- 
-=== Returns === 
-  * (System) this System 
- 
-=== Exceptions === 
-  * (SuspendError) unable to suspend 
- 
-==== hibernate ==== 
-Hibernates the computer. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.hibernate(); 
-</code> 
-<code javascript> 
-myObject.hibernate(force); 
-</code> 
- 
-=== Arguments === 
-  - force - (boolean) force the hibernation 
- 
-=== Returns === 
-  * (System) this System 
- 
-=== Exceptions === 
-  * (HibernateError) unable to hibernate 
- 
-==== lockScreen ==== 
-Locks the screen. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.lockScreen(); 
-</code> 
- 
-=== Returns === 
-  * (System) this System 
- 
-=== Exceptions === 
-  * (LockScreenError) unable to lock the screen 
- 
-==== startScreenSaver ==== 
-Starts the screen saver. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.startScreenSaver(); 
-</code> 
- 
-=== Returns === 
-  * (System) this System 
- 
-=== Exceptions === 
-  * (StartScreenSaverError) unable to start the screen saver 
- 
-===== Enumerations ===== 
- 
-==== DriveType ==== 
-A drive type. 
- 
-=== Values === 
-  - UnknownDrive: an unknown drive 
-  - InternalDrive: an internal drive 
-  - RemovableDrive: a removable drive 
-  - RemoteDrive: a remote drive 
-  - CdromDrive: a cdrom drive 
- 
-==== PowerState ==== 
-A power state. 
- 
-=== Values === 
-  - UnknownState: unknown state 
-  - BatteryPower: on battery power 
-  - WallPower: on wall power 
-  - WallPowerChargingBattery: on wall power, charging the battery 
- 
-==== StorageLocation ==== 
-A standard storage location. 
- 
-=== Values === 
-  - Desktop: the desktop 
-  - Documents: the documents folder 
-  - Fonts: the fonts folder 
-  - Applications: the applications folder 
-  - Music: the music folder 
-  - Movies: the movies folder 
-  - Pictures: the pictures folder 
-  - Temp: the temporary files folder 
-  - Home: the home folder 
-  - Data: the data folder 
-  - Cache: the cache folder 
code/system/system.1296423544.txt.gz · Last modified: 2021/02/13 11:23 (external edit)