sbMockDeviceFirmwareHandler.h
Go to the documentation of this file.
1 /* vim: set sw=2 :miv */
2 /*
3 //
4 // BEGIN SONGBIRD GPL
5 //
6 // This file is part of the Songbird web player.
7 //
8 // Copyright(c) 2005-2010 POTI, Inc.
9 // http://songbirdnest.com
10 //
11 // This file may be licensed under the terms of of the
12 // GNU General Public License Version 2 (the "GPL").
13 //
14 // Software distributed under the License is distributed
15 // on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
16 // express or implied. See the GPL for the specific language
17 // governing rights and limitations.
18 //
19 // You should have received a copy of the GPL along with this
20 // program. If not, go to http://www.gnu.org/licenses/gpl.html
21 // or write to the Free Software Foundation, Inc.,
22 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 //
24 // END SONGBIRD GPL
25 //
26 */
27 
28 #ifndef __SB_MOCKDEVICEFIRMWAREHANDLER_H__
29 #define __SB_MOCKDEVICEFIRMWAREHANDLER_H__
30 
32 #include <sbPIMockFirmwareHandlerURLService.h>
33 #include <nsIStreamListener.h>
34 
35 
37  public nsIStreamListener
38 {
39 public:
41  NS_DECL_NSISTREAMLISTENER
42  NS_DECL_NSIREQUESTOBSERVER
43 
45 
46  virtual nsresult OnInit();
47  virtual nsresult OnGetCurrentFirmwareVersion(PRUint32 *aCurrentFirmwareVersion);
48  virtual nsresult OnGetCurrentFirmwareReadableVersion(nsAString &aCurrentFirmwareReadableVersion);
49  virtual nsresult OnGetRecoveryMode(PRBool *aRecoveryMode);
50 
51  virtual nsresult OnGetDeviceModelNumber(nsAString &aModelNumber);
52  virtual nsresult OnGetDeviceModelVersion(nsAString &aModelVersion);
53  virtual nsresult OnGetDeviceVendor(nsAString &aDeviceVendor);
54 
55  virtual nsresult OnCanUpdate(sbIDevice *aDevice,
56  PRUint32 aDeviceVendorID,
57  PRUint32 aDeviceProductID,
58  PRBool *_retval);
59  virtual nsresult OnRebind(sbIDevice *aDevice,
60  sbIDeviceEventListener *aListener,
61  PRBool *_retval);
62  virtual nsresult OnCancel();
63  virtual nsresult OnRefreshInfo();
64  virtual nsresult OnUpdate(sbIDeviceFirmwareUpdate *aFirmwareUpdate);
65  virtual nsresult OnRecover(sbIDeviceFirmwareUpdate *aFirmwareUpdate);
66  virtual nsresult OnVerifyDevice();
67  virtual nsresult OnVerifyUpdate(sbIDeviceFirmwareUpdate *aFirmwareUpdate);
68  virtual nsresult OnHttpRequestCompleted();
69 
70 private:
71  virtual ~sbMockDeviceFirmwareHandler();
72 
73 protected:
74  nsresult HandleRefreshInfoRequest();
75  nsCOMPtr<sbPIMockFirmwareHandlerURLService> mHandlerURLService;
76  PRInt32 mComplete;
77 };
78 
79 #endif /*__SB_MOCKDEVICEFIRMWAREHANDLER_H__*/
virtual nsresult OnGetCurrentFirmwareVersion(PRUint32 *aCurrentFirmwareVersion)
virtual nsresult OnGetDeviceModelNumber(nsAString &aModelNumber)
virtual nsresult OnRecover(sbIDeviceFirmwareUpdate *aFirmwareUpdate)
virtual nsresult OnRebind(sbIDevice *aDevice, sbIDeviceEventListener *aListener, PRBool *_retval)
virtual nsresult OnCanUpdate(sbIDevice *aDevice, PRUint32 aDeviceVendorID, PRUint32 aDeviceProductID, PRBool *_retval)
nsCOMPtr< sbPIMockFirmwareHandlerURLService > mHandlerURLService
virtual nsresult OnVerifyUpdate(sbIDeviceFirmwareUpdate *aFirmwareUpdate)
virtual nsresult OnGetRecoveryMode(PRBool *aRecoveryMode)
virtual nsresult OnGetDeviceModelVersion(nsAString &aModelVersion)
virtual nsresult OnGetDeviceVendor(nsAString &aDeviceVendor)
virtual nsresult OnGetCurrentFirmwareReadableVersion(nsAString &aCurrentFirmwareReadableVersion)
NS_DECL_ISUPPORTS NS_DECL_NSISTREAMLISTENER NS_DECL_NSIREQUESTOBSERVER sbMockDeviceFirmwareHandler()
virtual nsresult OnUpdate(sbIDeviceFirmwareUpdate *aFirmwareUpdate)