1 // Emacs style mode select   -*- C++ -*-
2 //-----------------------------------------------------------------------------
3 //
4 // $Id: agol_manual.h 3342 2012-08-30 04:23:35Z hypereye $
5 //
6 // Copyright (C) 2006-2012 by The Odamex Team.
7 //
8 // This program is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU General Public License
10 // as published by the Free Software Foundation; either version 2
11 // of the License, or (at your option) any later version.
12 //
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 // GNU General Public License for more details.
17 //
18 // DESCRIPTION:
19 //	Manual Connect Dialog
20 //
21 // AUTHORS:
22 //	 Michael Wood (mwoodj at huntsvegas dot org)
23 //
24 //-----------------------------------------------------------------------------
25 
26 #ifndef _AGOL_MANUAL_H
27 #define _AGOL_MANUAL_H
28 
29 #include "event_handler.h"
30 
31 /**
32 agOdalaunch namespace.
33 
34 All code for the ag-odalaunch launcher is contained within the agOdalaunch
35 namespace.
36 */
37 namespace agOdalaunch {
38 
39 /**
40 The manual connect window.
41 
42 This class provides a manual connect window which can be used to connect to a
43 server at the provided host or IP and port.
44 */
45 class AGOL_Manual : public ODA_EventRegister
46 {
47 public:
48 	/**
49 	Constructor.
50 	*/
51 	AGOL_Manual();
52 
53 	/**
54 	Destructor.
55 	*/
56 	~AGOL_Manual();
57 
58 	/**
59 	Set the window close event.
60 
61 	The provided event handler will be called when the window closes.
62 
63 	@param handler The event handler.
64 	*/
65 	void SetWindowCloseEvent(EventHandler *handler);
66 
67 private:
68 	AG_Box       *CreateMainBox(void *parent);
69 	AG_Box       *CreateButtonBox(void *parent);
70 	AG_Textbox   *CreateServerEntry(void *parent);
71 	AG_Textbox   *CreatePasswordEntry(void *parent);
72 
73 	void          OnCancel(AG_Event *event);
74 	void          OnOK(AG_Event *event);
75 
76 	AG_Window    *ManualDialog;
77 	AG_Box       *MainBox;
78 	AG_Textbox   *ServerEntry;
79 	AG_Textbox   *PasswordEntry;
80 	AG_Box       *ButtonBox;
81 
82 	EventHandler *CloseEventHandler;
83 };
84 
85 } // namespace
86 
87 #endif
88