Editor:
Robin Berjon (Joost™) <robin@joost.com>
Revision:
0.9, last modified: 2008-01-16T14:34:23+01:00

Abstract

This document specifies the API with which widgets can place user settings into permanent storage such that widgets may have preferences.

Any and all use of the Joost API is subject to the Joost API Terms of Use

The API may change and although we will try and keep these changes to a minimum, some API calls may be deprecated in the future.

Table of Contents

1. Overview

This document provides the simple and straightforward documentation for the Preferences API. Please note that this API may be extended in the future.

2. Preferences

The Preferences API is exposed as a globally available object called, surprisingly enough, Preferences. There is no need to instantiate it, its methods are directly available.

The Preferences interface

interface Preferences {
  String  getString(in String name);
  void    setString(in String name, in String value);
  Boolean getBool(in String name);
  void    setBool(in String name, in Boolean value);
};

Methods

getBool

Gets a boolean preference given its name.

Parameters
name of type String
The name of the preference.
Return Value
The value of the preference.
No Exceptions
getString

Gets a string preference given its name.

Parameters
name of type String
The name of the preference.
Return Value
The value of the preference.
No Exceptions
setBool

Sets a boolean preference given its name and value.

Parameters
name of type String
The name of the preference.
value of type Boolean
The value of the preference.
No Return Value
No Exceptions
setString

Sets a string preference given its name and value.

Parameters
name of type String
The name of the preference.
value of type String
The value of the preference.
No Return Value
No Exceptions

3. References