Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

ScreenPackages.h

Go to the documentation of this file.
00001 #ifndef ScreenPackages_H 00002 #define ScreenPackages_H 00003 00004 #include "ScreenWithMenuElements.h" 00005 #include "BitmapText.h" 00006 #include "ezsockets.h" 00007 #include "RageFileManager.h" 00008 00009 #if !defined(WITHOUT_NETWORKING) 00010 00011 class ScreenPackages : public ScreenWithMenuElements 00012 { 00013 public: 00014 ScreenPackages( CString sName ); 00015 00016 virtual void Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI ); 00017 virtual void HandleScreenMessage( const ScreenMessage SM ); 00018 00019 virtual void MenuStart( PlayerNumber pn ); 00020 virtual void MenuUp( PlayerNumber pn, const InputEventType type ); 00021 virtual void MenuDown( PlayerNumber pn, const InputEventType type ); 00022 virtual void MenuLeft( PlayerNumber pn, const InputEventType type ); 00023 virtual void MenuRight( PlayerNumber pn, const InputEventType type ); 00024 virtual void MenuBack( PlayerNumber pn ); 00025 00026 virtual void TweenOffScreen( ); 00027 virtual void Update(float f); 00028 00029 private: 00030 void UpdatePackagesList(); 00031 void UpdateLinksList(); 00032 void RefreshPackages(); 00033 00034 void HTMLParse(); 00035 00036 CString URLEncode( const CString &URL ); //Encode any string in URL-style 00037 CString StripOutContainers( const CString & In ); //Strip off "'s and ''s 00038 00039 Sprite m_sprExistingBG; 00040 Sprite m_sprWebBG; 00041 00042 Sprite m_sprWebSel; 00043 00044 BitmapText m_textPackages; 00045 BitmapText m_textWeb; 00046 00047 CStringArray m_Packages; 00048 00049 vector <CString> m_Links; 00050 vector <CString> m_LinkTitles; 00051 BitmapText m_textURL; 00052 00053 int m_iPackagesPos; 00054 int m_iLinksPos; 00055 00056 int m_iDLorLST; 00057 int m_bCanDL; 00058 00059 //HTTP portion 00060 void CancelDownload( ); 00061 void EnterURL( const CString & sURL ); 00062 void HTTPUpdate( ); 00063 00064 //True if proper string, false if improper 00065 bool ParseHTTPAddress( const CString & URL, CString & Proto, CString & Server, int & Port, CString & Addy ); 00066 00067 Sprite m_sprDL; 00068 Sprite m_sprDLBG; 00069 void UpdateProgress(); 00070 00071 bool m_bIsDownloading; 00072 float m_fLastUpdate; 00073 long m_bytesLastUpdate; 00074 00075 CString m_sStatus; 00076 BitmapText m_textStatus; 00077 00078 EzSockets m_wSocket; 00079 00080 bool m_bGotHeader; 00081 00082 RageFile m_fOutputFile; 00083 CString m_sEndName; 00084 bool m_bIsPackage; 00085 00086 CString m_sBaseAddress; 00087 //HTTP Header information responce 00088 long m_iTotalBytes; 00089 long m_iDownloaded; 00090 00091 long m_iResponseCode; 00092 CString m_sResponseName; 00093 00094 //Raw HTTP Buffer 00095 CString m_sBUFFER; 00096 }; 00097 00098 #endif 00099 00100 #endif 00101 /* 00102 * (c) 2004 Charles Lohr 00103 * All rights reserved. 00104 * 00105 * Permission is hereby granted, free of charge, to any person obtaining a 00106 * copy of this software and associated documentation files (the 00107 * "Software"), to deal in the Software without restriction, including 00108 * without limitation the rights to use, copy, modify, merge, publish, 00109 * distribute, and/or sell copies of the Software, and to permit persons to 00110 * whom the Software is furnished to do so, provided that the above 00111 * copyright notice(s) and this permission notice appear in all copies of 00112 * the Software and that both the above copyright notice(s) and this 00113 * permission notice appear in supporting documentation. 00114 * 00115 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 00116 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00117 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF 00118 * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS 00119 * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT 00120 * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS 00121 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 00122 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 00123 * PERFORMANCE OF THIS SOFTWARE. 00124 */

Generated on Thu Jan 27 20:57:32 2005 for StepMania by doxygen 1.3.7