25 #ifndef __SB_BASEDEVICEFIRMWAREHANDLER_H__
26 #define __SB_BASEDEVICEFIRMWAREHANDLER_H__
28 #include <sbIDeviceFirmwareHandler.h>
30 #include <nsIMutableArray.h>
33 #include <nsIXMLHttpRequest.h>
36 #include <nsStringGlue.h>
39 #include <sbIDevice.h>
40 #include <sbIDeviceEvent.h>
41 #include <sbIDeviceEventListener.h>
42 #include <sbIDeviceManager.h>
49 NS_DECL_NSITIMERCALLBACK
50 NS_DECL_SBIDEVICEFIRMWAREHANDLER
67 const PRUint32 aDeviceVendorID,
68 const PRUint32 aDeviceProductID);
71 const PRUint32 aDeviceProductID);
100 const nsACString &aUrl,
101 const nsAString &aUsername = EmptyString(),
102 const nsAString &aPassword = EmptyString(),
103 const nsACString &aContentType = EmptyCString(),
104 nsIVariant *aRequestBody = nsnull);
129 PRBool aAsync = PR_TRUE);
150 nsIVariant *
aData = nsnull);
153 virtual nsresult
OnInit();
174 PRUint32 aDeviceVendorID,
175 PRUint32 aDeviceProductID,
179 PRUint32 aDeviceProductID);
virtual nsresult OnCancel()
virtual nsresult OnCanUpdate(sbIDevice *aDevice, PRUint32 aDeviceVendorID, PRUint32 aDeviceProductID, PRBool *_retval)
virtual nsresult OnRefreshInfo()
virtual nsresult OnBeginRecoveryModeSwitch(PRUint32 aDeviceVendorID, PRUint32 aDeviceProductID)
PRUint32 mDefaultFirmwareVersion
virtual nsresult OnEndRecoveryModeSwitch()
nsCOMPtr< nsIURI > mSupportLocation
nsresult AppendSupportedDeviceProductID(const nsAString &aDeviceFriendlyName, const PRUint32 aDeviceProductID)
nsCOMPtr< nsIURI > mDefaultFirmwareLocation
nsCOMPtr< sbIDevice > mDevice
nsCOMPtr< sbIDeviceEventListener > mProxiedListener
virtual nsresult OnInit()
nsCOMPtr< nsIURI > mFirmwareLocation
nsresult SetState(handlerstate_t aState)
Get internal state.
virtual nsresult OnRebind(sbIDevice *aDevice, sbIDeviceEventListener *aListener, PRBool *_retval)
nsresult CheckForError(const nsresult &aResult, PRUint32 aEventType, nsIVariant *aData=nsnull)
Check nsresult value, send error event if nsresult value is an error.
PRPackedBool mNeedsRecoveryMode
nsCOMPtr< nsITimer > mXMLHttpRequestTimer
virtual nsresult OnGetCurrentFirmwareVersion(PRUint32 *aCurrentFirmwareVersion)
nsCOMPtr< nsIURI > mResetInstructionsLocation
virtual nsresult OnGetRecoveryMode(PRBool *aRecoveryMode)
PRUint32 mFirmwareVersion
handlerstate_t GetState()
Set internal state.
nsCOMPtr< nsIURI > mDefaultReleaseNotesLocation
nsresult AbortHttpRequest()
Abort an HTTP request.
nsresult SendDeviceEvent(sbIDeviceEvent *aEvent, PRBool aAsync=PR_TRUE)
Send a device event.
virtual nsresult OnGetDeviceVendor(nsAString &aDeviceVendor)
handlerstate_t mHandlerState
nsresult AppendSupportedDevice(const nsAString &aDeviceFriendlyName, const PRUint32 aDeviceVendorID, const PRUint32 aDeviceProductID)
Append an entry to the list of supported devices.
nsCOMPtr< nsIXMLHttpRequest > mXMLHttpRequest
nsString mRecoveryModeKeyCombination
nsString mDefaultReadableFirmwareVersion
virtual nsresult OnGetDeviceModelVersion(nsAString &aModelVersion)
virtual nsresult OnVerifyUpdate(sbIDeviceFirmwareUpdate *aFirmwareUpdate)
virtual nsresult OnVerifyDevice()
PRPackedBool mRecoveryMode
sbBaseDeviceFirmwareHandler()
nsCOMPtr< nsIURI > mRegisterLocation
nsCOMPtr< nsIMutableArray > mSupportedDevices
virtual nsresult OnGetSupportedDevices(nsISimpleEnumerator **aSupportedDevices)
virtual nsresult OnRecover(sbIDeviceFirmwareUpdate *aFirmwareUpdate)
virtual ~sbBaseDeviceFirmwareHandler()
nsresult CreateDeviceEvent(PRUint32 aType, nsIVariant *aData, sbIDeviceEvent **aEvent)
Create a device event.
nsresult CreateProxiedURI(const nsACString &aURISpec, nsIURI **aURI)
Create an nsIURI from a spec string (e.g. http://some.url.com/path) in a thread-safe manner...
virtual nsresult OnGetCurrentFirmwareReadableVersion(nsAString &aCurrentFirmwareReadableVersion)
nsCOMPtr< sbIDeviceEventListener > mListener
virtual nsresult OnGetDeviceModelNumber(nsAString &aModelNumber)
nsCOMPtr< nsIURI > mReleaseNotesLocation
virtual nsresult OnUpdate(sbIDeviceFirmwareUpdate *aFirmwareUpdate)
virtual nsresult OnHttpRequestCompleted()
nsString mReadableFirmwareVersion
nsresult SendHttpRequest(const nsACString &aMethod, const nsACString &aUrl, const nsAString &aUsername=EmptyString(), const nsAString &aPassword=EmptyString(), const nsACString &aContentType=EmptyCString(), nsIVariant *aRequestBody=nsnull)
Send an HTTP request.
_updateTextAndScrollDataForFrame aData