Planeshift

pawsloginwindow.h

Go to the documentation of this file.
00001 /*
00002  * pawsloginwindow.h - Author: Andrew Craig
00003  *
00004  * Copyright (C) 2003 Atomic Blue ([email protected], http://www.atomicblue.org)
00005  *
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation (version 2 of the License)
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00017  *
00018  */
00019 
00020 #ifndef PAWS_LOGIN_WINDOW
00021 #define PAWS_LOGIN_WINDOW
00022 
00023 #include <iutil/virtclk.h>
00024 #include <csutil/csstring.h>
00025 #include <csutil/parray.h>
00026 #include "paws/pawswidget.h"
00027 #include "paws/pawscheckbox.h"
00028 #include "net/serverpinger.h"
00029 
00030 class pawsEditTextBox;
00031 class pawsTextBox;
00032 class pawsListBox;
00033 class pawsMultiLineTextBox;
00034     
00035 class pawsLoginWindow : public pawsWidget
00036 {
00037 public:
00038     pawsLoginWindow();
00040     pawsLoginWindow(const pawsLoginWindow& origin){}
00041     bool PostSetup();
00042     void UpdateUserPasswdFromConfig();
00043     void Show();
00044     void Hide();
00045     void Draw();
00046     bool OnButtonPressed( int mouseButton, int keyModifier, pawsWidget* widget );
00047     bool OnChange( pawsWidget* widget );
00048     void OnListAction( pawsListBox* selected, int status );
00049     
00051     void ConnectionFailed();
00052     
00053 private:
00054 
00055     bool LoadServerList();
00056     void SaveLoginInformation();
00057     
00058     void ConnectToServer(bool automatic = false);
00059 
00060     csString serverIP;
00061     int serverPort;
00062     pawsEditTextBox* login;
00063     pawsEditTextBox* passwd;    
00064     pawsListBox* listBox;
00065     pawsMultiLineTextBox* connectingLabel;
00066     pawsCheckBox* checkBox;
00067     pawsCheckBox* checkBoxC;
00068 
00070     csTicks timeout;
00071     
00073     bool connecting;
00074     bool passwdChanged;
00075     bool remember;
00076     bool convert;
00077     csString storedPasswd;
00078     csString storedPasswd256; 
00079     csPDelArray<psServerPinger> servers;
00080     
00081 };
00082 
00083 CREATE_PAWS_FACTORY( pawsLoginWindow );
00084 
00085 #endif
00086