Changes

Jump to: navigation, search

WebAPI/SettingsAPI

58 bytes added, 14:02, 22 November 2011
improving the proposal
const DOMString FOOBAR = "foobar";
// Setters. SettingsRequest.result is always nullcontains the new value of the setting.
SettingsRequest set(DOMString name, DOMString value);
SettingsRequest set(DOMString name, long value);
SettingsRequest set(DOMString name, long long value);
SettingsRequest set(DOMString name, float value);
// Getters. SettingsRequest.result will be contains the value of the requested type if the success event is sentsetting. SettingsRequest getStringget(DOMString name); }  /* Similar to SmsRequest. */ interface SettingsRequest { SettingsRequest getIntreadonly attribute DOMString readyState; // "processing" or "done" readonly attribute DOMError? error; attribute EventListener onsuccess; attribute EventListener onerror; attribute readonly any? result; };  [Constructor(DOMString nametype, optional SettingsEventInit settingsEventInitDict)] interface SettingsEvent : Event { readonly attribute DOMString settingName; SettingsRequest getLong(readonly attribute DOMString settingValue; }; dictionary SettingsEventInit : EventInit { DOMString name)settingName; SettingsRequest getFloat(DOMString name)settingValue;
}
* SettingsRequest will be similar to SMSRequest described in [[WebAPI/WebSMS|WebSMS specification]].
* As for BatteryAPI, SettingsManager object might be in window.navigator, window.navigator.devices or even could be created with ''new''.* The allowed types are restricted to the type we know we will be using in the first implementation. Those could be extended.* If a setting is unknownby the platform, it should fail.
* But some platforms might not know some settings. Do we want to add a method that checks if the platform knows a specific setting?
Confirm
368
edits

Navigation menu