SuperTuxKart
server_info_dialog.hpp
1 // SuperTuxKart - a fun racing game with go-kart
2 // Copyright (C) 2013-2015 Glenn De Jonghe
3 //
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // as published by the Free Software Foundation; either version 3
7 // of the License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
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 #ifndef HEADER_SERVER_INFO_DIALOG_HPP
20 #define HEADER_SERVER_INFO_DIALOG_HPP
21 
22 #include "guiengine/modaldialog.hpp"
23 #include "utils/types.hpp"
24 
25 namespace GUIEngine
26 {
27  class LabelWidget;
28  class RibbonWidget;
29  class IconButtonWidget;
30  class TextBoxWidget;
31 }
32 
33 #include <memory>
34 #include <irrString.h>
35 
36 class Server;
37 
42 {
43 
44 private:
45  bool m_self_destroy, m_join_server;
46 
47  const std::shared_ptr<Server> m_server;
48 
49  GUIEngine::RibbonWidget *m_options_widget;
50 
53 
56 
59 
60 public:
61  ServerInfoDialog(std::shared_ptr<Server> server);
63 
65  GUIEngine::EventPropagation processEvent(const std::string& eventSource);
66 
67  virtual bool onEscapePressed();
68  virtual void onUpdate(float dt);
69  void requestJoin();
70 }; // class ServerInfoDialog
71 
72 #endif
Definition: server.hpp:43
Contains all GUI engine related classes and functions.
Definition: abstract_state_manager.hpp:31
ServerInfoDialog(std::shared_ptr< Server > server)
Dialog constructor.
Definition: server_info_dialog.cpp:49
A text field widget.
Definition: text_box_widget.hpp:52
Declares the general types that are used by the network.
virtual void onUpdate(float dt)
Override to be notified of updates.
Definition: server_info_dialog.cpp:220
GUIEngine::TextBoxWidget * m_password
Specify server password if needed.
Definition: server_info_dialog.hpp:58
GUIEngine::IconButtonWidget * m_join_widget
The join button.
Definition: server_info_dialog.hpp:52
A button widget with an icon and optionnaly a label beneath.
Definition: icon_button_widget.hpp:43
GUIEngine::IconButtonWidget * m_cancel_widget
The cancel button.
Definition: server_info_dialog.hpp:55
virtual bool onEscapePressed()
Override to change what happens on escape pressed.
Definition: server_info_dialog.cpp:212
Dialog that allows a user to sign in.
Definition: server_info_dialog.hpp:41
GUIEngine::EventPropagation processEvent(const std::string &eventSource)
Returns whether to block event propagation (usually, you will want to block events you processed)
Definition: server_info_dialog.cpp:177
A static text/icons/tabs bar widget.
Definition: ribbon_widget.hpp:59
Abstract base class representing a modal dialog.
Definition: modaldialog.hpp:55
void onEnterPressedInternal()
When the player pressed enter, select 'join' as default.
Definition: server_info_dialog.cpp:200