An interface for accessing, and binding to, stored data. More...
import"sbIDataRemote.idl";
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... | |
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.
Definition at line 57 of file sbIDataRemote.idl.
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.
aElement | |
aProperty | |
aIsBool | |
aIsNot | |
aEvalString |
NS_ERROR_NOT_INITIALIZED | if 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.
aObserver | |
aSuppressFirst |
NS_ERROR_NOT_INITIALIZED | if 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.
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.
aObserver | |
aSuppressFirst |
NS_ERROR_NOT_INITIALIZED | if 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.
aKey | - The string identifier for the data to watch |
aRoot | - OPTIONAL - If present this defines a prefix to the key |
NS_ERROR_FAILURE | if unable to initialize properly |
NS_ERROR_UNEXPECTED | if 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.
NS_ERROR_NOT_INITIALIZED | if init has not been called |
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.
aBoolValue | - The boolean to set as the data |
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.
aIntValue | - The integer to set as the data |
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.
aStringValue | - The string to set as the data |
Definition at line 160 of file sbIDataRemote.idl.