SuperTuxKart
recovery_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_RECOVERY_DIALOG_HPP
20 #define HEADER_RECOVERY_DIALOG_HPP
21 
22 
23 #include "guiengine/modaldialog.hpp"
24 #include "guiengine/widgets.hpp"
25 
26 namespace Online
27 {
28  class XMLRequest;
29 }
30 
36 {
37 public:
38  enum Phase
39  {
40  Input = 1,
41  Info = 2,
42  };
44  virtual ~RecoveryDialog();
45 
46  void onEnterPressedInternal();
47  GUIEngine::EventPropagation processEvent(const std::string& eventSource);
48 
49  virtual void onUpdate(float dt);
50  virtual bool onEscapePressed();
51 
52 private:
53  Phase m_phase;
54  bool m_self_destroy;
55  bool m_show_recovery_input;
56  bool m_show_recovery_info;
57 
58  std::shared_ptr<Online::XMLRequest> m_recovery_request;
59 
60  GUIEngine::TextBoxWidget * m_username_widget;
61  GUIEngine::TextBoxWidget * m_email_widget;
62 
63  GUIEngine::LabelWidget * m_info_widget;
64 
65  GUIEngine::RibbonWidget * m_options_widget;
66  GUIEngine::IconButtonWidget * m_submit_widget;
67  GUIEngine::IconButtonWidget * m_cancel_widget;
68 
69  void showRecoveryInput();
70  void showRecoveryInfo();
71  void processInput();
72 };
73 
74 #endif
A text field widget.
Definition: text_box_widget.hpp:52
Definition: input.hpp:34
A button widget with an icon and optionnaly a label beneath.
Definition: icon_button_widget.hpp:43
Dialog that allows a user to recover his account.
Definition: recovery_dialog.hpp:35
A static text/icons/tabs bar widget.
Definition: ribbon_widget.hpp:59
A simple label widget.
Definition: label_widget.hpp:35
Definition: player_manager.hpp:35
Abstract base class representing a modal dialog.
Definition: modaldialog.hpp:55