SuperTuxKart
change_password_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_CHANGE_PASSWORD_DIALOG_HPP
20 #define HEADER_CHANGE_PASSWORD_DIALOG_HPP
21 
22 #include "guiengine/modaldialog.hpp"
23 
24 #include <irrString.h>
25 
26 namespace GUIEngine
27 {
28  class IconButtonWidget;
29  class LabelWidget;
30  class RibbonWidget;
31 }
32 
38 {
39 
40 public:
41 
44 
45  virtual void onEnterPressedInternal();
46 
47  GUIEngine::EventPropagation processEvent(const std::string& eventSource);
48 
49  virtual bool onEscapePressed();
50  virtual void onUpdate(float dt);
51  void success();
52  void error(const irr::core::stringw & error_message);
53  void changePassword(const irr::core::stringw &current_password,
54  const irr::core::stringw &new_password);
55 
56 private:
57 
58  bool m_self_destroy;
59  bool m_success;
60 
61  GUIEngine::TextBoxWidget * m_current_password_widget;
62  GUIEngine::TextBoxWidget * m_new_password1_widget;
63  GUIEngine::TextBoxWidget * m_new_password2_widget;
64  GUIEngine::LabelWidget * m_info_widget;
65 
66  GUIEngine::RibbonWidget * m_options_widget;
67  GUIEngine::IconButtonWidget * m_submit_widget;
68  GUIEngine::IconButtonWidget * m_cancel_widget;
69 
70  void submit();
71 };
72 
73 #endif
void changePassword(const irr::core::stringw &current_password, const irr::core::stringw &new_password)
Create and submit the request to the server to change the password.
Definition: change_password_dialog.cpp:83
Contains all GUI engine related classes and functions.
Definition: abstract_state_manager.hpp:31
A text field widget.
Definition: text_box_widget.hpp:52
A button widget with an icon and optionnaly a label beneath.
Definition: icon_button_widget.hpp:43
virtual bool onEscapePressed()
Override to change what happens on escape pressed.
Definition: change_password_dialog.cpp:199
Dialog that allows a user to sign in.
Definition: change_password_dialog.hpp:37
ChangePasswordDialog()
Creates a modal dialog with given percentage of screen width and height.
Definition: change_password_dialog.cpp:42
virtual void onUpdate(float dt)
Override to be notified of updates.
Definition: change_password_dialog.cpp:231
A static text/icons/tabs bar widget.
Definition: ribbon_widget.hpp:59
A simple label widget.
Definition: label_widget.hpp:35
GUIEngine::EventPropagation processEvent(const std::string &eventSource)
Returns whether to block event propagation (usually, you will want to block events you processed)
Definition: change_password_dialog.cpp:163
Abstract base class representing a modal dialog.
Definition: modaldialog.hpp:55