sbIDataRemote Interface Reference

An interface for accessing, and binding to, stored data. More...

import "sbIDataRemote.idl";

List of all members.

Public Member Functions

void init (in AString aKey, in AString aRoot)
 Initialize the DataRemote Sets internal state, MUST be called before any other methods. All other calls will throw exceptions if init has not been called.
void unbind ()
 Disconnect the DataRemote If this DataRemote has been bound via a call to bindObserver(), bindAttribute() or bindProperty() it must be disconnected to prevent calls back to objects that may no longer be around.
Exceptions:
NS_ERROR_NOT_INITIALIZED if init has not been called.

void bindObserver (in nsIObserver aObserver, in boolean aSuppressFirst)
 When the key associated with the sbDataRemote changes the observer will get a callback to observe() with the new value for the data, a handle to the sbDataRemote and the key to which the data belongs.
void bindProperty (in nsIDOMElement aElement, in AString aProperty, in boolean aIsBool, in boolean aIsNot, in AString aEvalString)
 When the key associated with the sbDataRemote changes the property of the element will be modified appropriately.
void bindAttribute (in nsIDOMElement aElement, in AString aProperty, in boolean aIsBool, in boolean aIsNot, in AString aEvalString)
 When the key associated with the sbDataRemote changes the attribute of the element will be modified appropriately.

Public Attributes

attribute AString stringValue
 Access to the data in string format In javascript you can access the data as you would properties of a normal js object ( obj.stringValue = "foo" assigns the string foo into the DataRemote ). In c++ you need to call setStringValue("foo") and likewise for the getter.
attribute boolean boolValue
 Access to the data in boolean format In javascript you can access the data as you would properties of a normal js object ( obj.boolValue = true assigns the boolean true into the DataRemote ). In c++ you need to call setStringValue(true) and likewise for the getter.
attribute long intValue
 Access to the data in integer format In javascript you can access the data as you would properties of a normal js object ( obj.intValue = 10 assigns the integer 10 into the DataRemote ). In c++ you need to call setStringValue(10) and likewise for the getter.


Detailed Description

An interface for accessing, and binding to, stored data.

This interface defines the ability to set key-value pairs into a global data-store, and to observe changes in the value of the data. The observer can be bound to the data in one of three different ways. A callback object can be bound as an nsIObserver, or a DOM element can bind the value of an attribute or a property to the value of the data.

The attribute and property bindings can be done as string, integer or boolean, and in the case of boolean binding the value can be the inverse of the data value. In addition the actual value for the attribute or property can be defined by additional script executed in the notification step.

See also:
DataRemote

Definition at line 58 of file sbIDataRemote.idl.


Member Function Documentation

void sbIDataRemote::bindAttribute ( in nsIDOMElement  aElement,
in AString  aProperty,
in boolean  aIsBool,
in boolean  aIsNot,
in AString  aEvalString 
)

When the key associated with the sbDataRemote changes the attribute of the element will be modified appropriately.

Parameters:
aElement 
aProperty 
aIsBool 
aIsNot 
aEvalString 
Exceptions:
NS_ERROR_NOT_INITIALIZED if init has not been called

void sbIDataRemote::bindObserver ( in nsIObserver  aObserver,
in boolean  aSuppressFirst 
)

When the key associated with the sbDataRemote changes the observer will get a callback to observe() with the new value for the data, a handle to the sbDataRemote and the key to which the data belongs.

Parameters:
aObserver 
aSuppressFirst 
Exceptions:
NS_ERROR_NOT_INITIALIZED if init has not been called

void sbIDataRemote::bindProperty ( in nsIDOMElement  aElement,
in AString  aProperty,
in boolean  aIsBool,
in boolean  aIsNot,
in AString  aEvalString 
)

When the key associated with the sbDataRemote changes the property of the element will be modified appropriately.

Parameters:
aElement 
aProperty 
aIsBool 
aIsNot 
aEvalString \ throws NS_ERROR_NOT_INITIALIZED if init has not been called

void sbIDataRemote::init ( in AString  aKey,
in AString  aRoot 
)

Initialize the DataRemote Sets internal state, MUST be called before any other methods. All other calls will throw exceptions if init has not been called.

Parameters:
aKey - The string identifier for the data to watch
aRoot - OPTIONAL - If present this defines a prefix to the key
Exceptions:
NS_ERROR_FAILURE if unable to initialize properly
NS_ERROR_UNEXPECTED if init has already been called


Member Data Documentation

attribute boolean sbIDataRemote::boolValue

Access to the data in boolean format In javascript you can access the data as you would properties of a normal js object ( obj.boolValue = true assigns the boolean true into the DataRemote ). In c++ you need to call setStringValue(true) and likewise for the getter.

Parameters:
aBoolValue - The boolean to set as the data
Returns:
TRUE if the data converts to true

FALSE if the data converts to false or there is no data set yet.

Definition at line 154 of file sbIDataRemote.idl.

attribute long sbIDataRemote::intValue

Access to the data in integer format In javascript you can access the data as you would properties of a normal js object ( obj.intValue = 10 assigns the integer 10 into the DataRemote ). In c++ you need to call setStringValue(10) and likewise for the getter.

Parameters:
aIntValue - The integer to set as the data
Returns:
The integer stored if it actually is an interger

NaN if the the data stored is not a number.

Definition at line 167 of file sbIDataRemote.idl.

attribute AString sbIDataRemote::stringValue

Access to the data in string format In javascript you can access the data as you would properties of a normal js object ( obj.stringValue = "foo" assigns the string foo into the DataRemote ). In c++ you need to call setStringValue("foo") and likewise for the getter.

Parameters:
aStringValue - The string to set as the data
Returns:
A string containing the value of the data, or the empty string if no data has been set yet.

Definition at line 141 of file sbIDataRemote.idl.


The documentation for this interface was generated from the following file:
Generated on Mon Aug 21 21:01:55 2006 for Songbird by  doxygen 1.4.7