CanPreventSleep |
|
|
AccessDoze AccessSleep CanSleep Copying Finalize Init Reinitialize ReleaseDoze ReleasePowerAndSleep ReleaseSleep |
|
DozeCount SleepCount |
| Field | Type | |
|---|---|---|
| CanPreventSleep: | dozeCount: | Signed |
| sleepCount: | Signed |
Define Class CanPreventSleep; // a class inheriting from CanPreventSleep must somehow inherit from HasReinitialize mixes in with Object, HasReinitialize; // mixed in by objects that want to be able to prevent the device // from going into low-power mode (dozing), and/or the device from going // to sleep (turn off). field dozeCount: Signed, getter; // number of doze accesses of this instance remaining before system can doze field sleepCount: Signed, getter; // number of sleep accesses of this instance remaining before system can doze attribute DozeCount: Signed; // number of doze accesses of this instance remaining before system can doze attribute SleepCount: Signed; // number of sleep accesses of this instance remaining before system can doze operation AccessDoze(); // increase the doze access count for this instance operation ReleaseDoze(); // decrease the doze access count for this instance operation AccessSleep(); // increase the sleep access count for this instance operation ReleaseSleep(); // decrease the sleep access count for this instance operation CanSleep(userInitiated: Boolean): Boolean; // called by the power manager to see if its O.K. to turn off the main power // to the device // sometimes overriden operation ReleasePowerAndSleep(); // ReleaseDoze and ReleaseSleep on the object, then TryToSleep overrides Init, Reinitialize, Copying; // overriden to register the object with the power manager overrides Finalize; // overriden to unregister the object end class;