sbIDataRemote Interface Reference

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

import"sbIDataRemote.idl";

Inheritance diagram for sbIDataRemote:
[legend]
Collaboration diagram for sbIDataRemote:
[legend]

Public Member Functions

void init (in AString aKey, [optional] 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. More...
 
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. More...
 
void bindObserver (in nsIObserver aObserver, [optional] 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. More...
 
void bindRemoteObserver (in sbIRemoteObserver aObserver, [optional] 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, and the key to which the data belongs. More...
 
void bindProperty (in nsIDOMElement aElement, in AString aProperty, [optional] in boolean aIsBool, [optional] in boolean aIsNot, [optional] in AString aEvalString)
 When the key associated with the sbDataRemote changes the property of the element will be modified appropriately. More...
 
void bindAttribute (in nsIDOMElement aElement, in AString aProperty, [optional] in boolean aIsBool, [optional] in boolean aIsNot, [optional] in AString aEvalString)
 When the key associated with the sbDataRemote changes the attribute of the element will be modified appropriately. More...
 
void deleteBranch ()
 Called to remove the data remote and all its children. More...
 

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. More...
 
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. More...
 
attribute long 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. More...
 

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 57 of file sbIDataRemote.idl.

Member Function Documentation

void sbIDataRemote::bindAttribute ( in nsIDOMElement  aElement,
in AString  aProperty,
[optional] in boolean  aIsBool,
[optional] in boolean  aIsNot,
[optional] 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_INITIALIZEDif init has not been called
void sbIDataRemote::bindObserver ( in nsIObserver  aObserver,
[optional] 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_INITIALIZEDif init has not been called
void sbIDataRemote::bindProperty ( in nsIDOMElement  aElement,
in AString  aProperty,
[optional] in boolean  aIsBool,
[optional] in boolean  aIsNot,
[optional] 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::bindRemoteObserver ( in sbIRemoteObserver  aObserver,
[optional] 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, and the key to which the data belongs.

This method is specifically for registering remote api observers.

Parameters
aObserver
aSuppressFirst
Exceptions
NS_ERROR_NOT_INITIALIZEDif init has not been called
void sbIDataRemote::deleteBranch ( )

Called to remove the data remote and all its children.

void sbIDataRemote::init ( in AString  aKey,
[optional] 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_FAILUREif unable to initialize properly
NS_ERROR_UNEXPECTEDif init has already been called
void sbIDataRemote::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_INITIALIZEDif init has not 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 173 of file sbIDataRemote.idl.

attribute long 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 186 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 160 of file sbIDataRemote.idl.


The documentation for this interface was generated from the following file: