Main Page | Class List | File List | Class Members | Related Pages

dlgupdate.h

00001 /***************************************************************************
00002                            dlgupdate.h
00003                            -------------------
00004     begin                : 2004-10-30 12:44
00005     copyright            : (C) 2004-2005 by Dominik Haumann
00006     email                : dhaumann@users.sourceforge.net
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  This program is free software; you can redistribute it and/or
00011  modify it under the terms of the GNU General Public License
00012  as published by the Free Software Foundation; either version 2
00013  of the License, or (at your option) any later version.
00014 
00015  This program is distributed in the hope that it will be useful,
00016  but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  GNU General Public License for more details.
00019 
00020  You should have received a copy of the GNU General Public License
00021  along with this program; if not, write to the Free Software
00022  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00023  ***************************************************************************/
00024 
00025 #ifndef DLGUPDATE_H
00026 #define DLGUPDATE_H
00027 
00028 #include "global.h"
00029 #include "httprequest.h"
00030 #include <wx/statline.h>
00031 #include <wx/gauge.h>
00032 #include <wx/timer.h>
00033 
00034 namespace WDS
00035 {
00036 
00037 class CProfile;
00061 class CDlgUpdate : public wxDialog
00062 {
00063 public:
00069     CDlgUpdate( wxWindow *pParent, CProfile* profile );
00070     ~CDlgUpdate();
00071 
00072     string GetUpdateString( ) {
00073         return m_strUpdate;
00074     }
00075 
00081     const HTTP::GetRequest* GetHTTPRequest();
00082 
00083 protected:
00084     void OnTimer( wxTimerEvent& event );
00085     void OnCancel( wxCommandEvent &event );
00086     void OnOK( wxCommandEvent &event );
00087     bool CheckDownload( );
00088 
00089 private:
00090     enum UPDATE_STATE {
00091         US_INIT = 0,
00092         US_CONNECT,
00093         US_REQUEST,
00094         US_PROCESS_DATA,
00095         US_MAYBE_SUCCESS,
00096         US_ERROR
00097     };
00098 
00099     UPDATE_STATE  m_state;
00100     wxTimer       m_timer;
00101 
00102     wxGauge*      m_pProgessBar;
00103     wxStaticText* m_pLblTransferred;
00104     wxStaticText* m_pLblAverageSpeed;
00105     wxStaticText* m_pLblStatus;
00106     wxButton*     m_pBtnCancel;
00107     wxButton*     m_pBtnOK;
00108 
00109     HTTP::GetRequest* m_httpRequest;
00110     CProfile*    m_pProfile;
00111 
00112     string m_strUpdate;
00113 
00114     enum {
00115         IDC_PROGRESS_BAR,
00116         IDT_TIMER
00117     };
00118 
00119     DECLARE_EVENT_TABLE()
00120 };
00121 
00122 }
00123 
00124 #endif // DLGUPDATE_H
00125 
00126 // kate: space-indent off; tab-width 4; replace-tabs off;

Generated on Sun Jan 16 18:20:26 2005 for WDSMap by  doxygen 1.3.9.1