Planeshift
pawsloginwindow.h
Go to the documentation of this file.
1 /*
2  * pawsloginwindow.h - Author: Andrew Craig
3  *
4  * Copyright (C) 2003 Atomic Blue (info@planeshift.it, http://www.atomicblue.org)
5  *
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation (version 2 of the License)
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17  *
18  */
19 
20 #ifndef PAWS_LOGIN_WINDOW
21 #define PAWS_LOGIN_WINDOW
22 
23 #include <iutil/virtclk.h>
24 #include <csutil/csstring.h>
25 #include <csutil/parray.h>
26 #include "paws/pawswidget.h"
27 #include "paws/pawscheckbox.h"
28 #include "net/serverpinger.h"
29 
30 class pawsEditTextBox;
31 class pawsTextBox;
32 class pawsListBox;
34 
39 {
40 public:
44  bool PostSetup();
46  void Show();
47  void Hide();
48  void Draw();
49  bool OnButtonPressed( int mouseButton, int keyModifier, pawsWidget* widget );
50  bool OnChange( pawsWidget* widget );
51  void OnListAction( pawsListBox* selected, int status );
52 
54  void ConnectionFailed();
55 
56 private:
57 
58  bool LoadServerList();
59  void SaveLoginInformation();
60 
61  void ConnectToServer(bool automatic = false);
62 
63  csString serverIP;
64  int serverPort;
65  pawsEditTextBox* login;
66  pawsEditTextBox* passwd;
67  pawsListBox* listBox;
68  pawsMultiLineTextBox* connectingLabel;
69  pawsCheckBox* checkBox;
70  pawsCheckBox* checkBoxC;
71 
73  csTicks timeout;
74 
76  bool connecting;
77  bool passwdChanged;
78  bool remember;
79  bool convert;
80  csString storedPasswd;
81  csString storedPasswd256;
82  csPDelArray<psServerPinger> servers;
83 
84 };
85 
87 
88 #endif
89 
The main base widget that all other widgets should inherit from.
Definition: pawswidget.h:116
A combination widget that has a check box and a text label.
Definition: pawscheckbox.h:48
void Show()
Makes widget visible and brings it to the front.
An edit box widget/.
Definition: pawstextbox.h:409
void OnListAction(pawsListBox *selected, int status)
Called whenever an item in a child list box is selected.
bool PostSetup()
This is called after the widget and all of it&#39;s children have been created.
Login Window including account, password, server list, ping of servers, save password.
A simple list box widget.
Definition: pawslistbox.h:202
void Hide()
Makes widget invisible and removes focus if widget has current focus.
bool OnChange(pawsWidget *widget)
Called whenever a widget is selected.
void UpdateUserPasswdFromConfig()
bool OnButtonPressed(int mouseButton, int keyModifier, pawsWidget *widget)
Called whenever a button is pressed.
pawsLoginWindow(const pawsLoginWindow &origin)
TODO: Copy constructor, useless currently. Would be implemented later.
void ConnectionFailed()
This method notifies the LoginWindow that connection attempt failed.
void Draw()
Draws the widget and all of it&#39;s children.
A basic text box widget.
Definition: pawstextbox.h:42
CREATE_PAWS_FACTORY(pawsLoginWindow)