27 #include <nsIClassInfoImpl.h>
28 #include <nsIProgrammingLanguage.h>
35 #define SB_DATAREMOTE_CID \
36 { 0xe0990420, 0xe9c0, 0x11dd, \
37 { 0xba, 0x2f, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66 } }
51 sbDataRemoteWrapper::sbDataRemoteWrapper()
52 : mInnerDataRemote(nsnull),
56 sbDataRemoteWrapper::~sbDataRemoteWrapper()
63 NS_ASSERTION(NS_SUCCEEDED(rv),
"Failed to unbind");
65 mInnerDataRemote = nsnull;
73 do_CreateInstance(kDataRemoteCID, &rv);
74 NS_ENSURE_SUCCESS(rv, rv);
88 NS_ENSURE_STATE(mInnerDataRemote);
89 return mInnerDataRemote->GetAsString(aStringValue);
93 NS_ENSURE_STATE(mInnerDataRemote);
94 return mInnerDataRemote->SetAsString(aStringValue);
100 NS_ENSURE_STATE(mInnerDataRemote);
101 return mInnerDataRemote->GetAsBool(aBoolValue);
105 NS_ENSURE_STATE(mInnerDataRemote);
106 return mInnerDataRemote->SetAsBool(aBoolValue);
112 NS_ENSURE_STATE(mInnerDataRemote);
113 return mInnerDataRemote->GetAsInt(aIntValue);
117 NS_ENSURE_STATE(mInnerDataRemote);
118 return mInnerDataRemote->SetAsInt(aIntValue);
124 NS_ENSURE_STATE(mInnerDataRemote);
125 NS_ENSURE_ARG_POINTER(aObserver);
126 mObserver = aObserver;
127 return mInnerDataRemote->BindObserver(
this, aSuppressFirst);
133 NS_ENSURE_STATE(mInnerDataRemote);
134 NS_ENSURE_ARG_POINTER(aObserver);
138 return mInnerDataRemote->BindRemoteObserver(aObserver, aSuppressFirst);
144 NS_ENSURE_STATE(mInnerDataRemote);
145 nsresult rv = mInnerDataRemote->Unbind();
157 NS_IMETHODIMP sbDataRemoteWrapper::Observe(
nsISupports *aSubject,
159 const PRUnichar *
aData )
161 NS_ENSURE_STATE(mObserver);
164 return mObserver->Observe(NS_ISUPPORTS_CAST(
sbIDataRemote*,
this), aTopic, aData);
NS_SCRIPTABLE NS_IMETHOD BindObserver(nsIObserver *aObserver, PRBool aSuppressFirst)
An interface for accessing, and binding to, stored data.
static NS_DEFINE_CID(kDataRemoteCID,{0xe0990420, 0xe9c0, 0x11dd,{0xba, 0x2f, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66}})
NS_SCRIPTABLE NS_IMETHOD GetStringValue(nsAString &aStringValue)
NS_SCRIPTABLE NS_IMETHOD SetIntValue(PRInt64 aIntValue)
NS_SCRIPTABLE NS_IMETHOD GetIntValue(PRInt64 *aIntValue)
NS_IMPL_ISUPPORTS3(sbLibraryConstraint, sbILibraryConstraint, nsISerializable, nsIClassInfo) NS_IMPL_CI_INTERFACE_GETTER3(sbLibraryConstraint
NS_SCRIPTABLE NS_IMETHOD Unbind(void)
NS_SCRIPTABLE NS_IMETHOD BindRemoteObserver(sbIRemoteObserver *aObserver, PRBool aSuppressFirst)
NS_SCRIPTABLE NS_IMETHOD SetBoolValue(PRBool aBoolValue)
NS_IMPL_CI_INTERFACE_GETTER2(sbDataRemoteWrapper, sbIDataRemote, nsIClassInfo) sbDataRemoteWrapper
NS_SCRIPTABLE NS_IMETHOD GetBoolValue(PRBool *aBoolValue)
NS_SCRIPTABLE NS_IMETHOD SetStringValue(const nsAString &aStringValue)
#define SB_DATAREMOTE_CID
Lightweight Observer style interface for use with sbIRemotePlayer::addListener.
_updateTextAndScrollDataForFrame aData