SuperTuxKart
Loading...
Searching...
No Matches
register_screen.hpp
1// SuperTuxKart - a fun racing game with go-kart
2// Copyright (C) 2014-2015 Joerg Henrichs
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#ifndef HEADER_REGISTER_SCREEN_HPP
19#define HEADER_REGISTER_SCREEN_HPP
20
21#include "guiengine/screen.hpp"
22
23namespace GUIEngine { class Widget; class LabelWidget;
24 class RibbonWidget; class TextBoxWidget; }
25namespace Online { class XMLRequest; }
26
27class PlayerProfile;
28class BaseUserScreen;
29
35 public GUIEngine::ScreenSingleton<RegisterScreen>
36{
37private:
39
41 void handleLocalName(const irr::core::stringw &local_name);
42 void doRegister();
43 void init() OVERRIDE;
45
48
51
54
56 std::shared_ptr<Online::XMLRequest> m_signup_request;
57
61
64
67 enum { ACCOUNT_NEW_ONLINE,
68 ACCOUNT_EXISTING_ONLINE,
69 ACCOUNT_OFFLINE } m_account_mode;
70
74
75public:
76
78 virtual void loadedFromFile() OVERRIDE {};
79 virtual void onUpdate(float dt) OVERRIDE;
80 virtual bool onEscapePressed() OVERRIDE;
81 virtual void onDialogClose() OVERRIDE;
82 virtual void onFocusChanged(GUIEngine::Widget *previous,
83 GUIEngine::Widget *focus,
84 int playerID) OVERRIDE;
85 void setRename(PlayerProfile *player);
86
87 void acceptTerms();
89 virtual void eventCallback(GUIEngine::Widget* widget,
90 const std::string& name,
91 const int playerID) OVERRIDE;
92
93 // ------------------------------------------------------------------------
96}; // class RegisterScreen
97
98#endif
The user management screen.
Definition: user_screen.hpp:49
A simple label widget.
Definition: label_widget.hpp:36
A static text/icons/tabs bar widget.
Definition: ribbon_widget.hpp:60
Declares a class to be a singleton.
Definition: screen.hpp:59
Represents a single GUI screen.
Definition: screen.hpp:97
A text field widget.
Definition: text_box_widget.hpp:53
Class for managing player profiles (name, usage frequency, etc.).
Definition: player_profile.hpp:54
Screen to register an online account.
Definition: register_screen.hpp:36
void doRegister()
Handles the actual registration process.
Definition: register_screen.cpp:298
void init() OVERRIDE
Callback invoked when entering this menu (after the widgets have been added).
Definition: register_screen.cpp:68
void acceptTerms()
Called from the registration info dialog when 'accept' is clicked.
Definition: register_screen.cpp:422
enum RegisterScreen::@17 m_account_mode
Which kind of account to create: new online account, new account using an existing online account,...
void handleLocalName(const irr::core::stringw &local_name)
If necessary creates the local user.
Definition: register_screen.cpp:255
std::shared_ptr< Online::XMLRequest > m_signup_request
The XML request to the server.
Definition: register_screen.hpp:56
void makeEntryFieldsVisible()
Shows or hides the entry fields for online registration, depending on online mode.
Definition: register_screen.cpp:221
GUIEngine::RibbonWidget * m_options_widget
Save the pointer to the options widget, it is widely used.
Definition: register_screen.hpp:50
BaseUserScreen * m_parent_screen
A pointer to the parent UserScreen, in order to allow this screen to pass information back.
Definition: register_screen.hpp:73
PlayerProfile * m_existing_player
Pointer to an existing player if the screen is doing a rename, NULL otherwise.
Definition: register_screen.hpp:60
virtual void onFocusChanged(GUIEngine::Widget *previous, GUIEngine::Widget *focus, int playerID) OVERRIDE
Callback called when focus changes.
Definition: register_screen.cpp:204
virtual void eventCallback(GUIEngine::Widget *widget, const std::string &name, const int playerID) OVERRIDE
implement callback from parent class GUIEngine::Screen
Definition: register_screen.cpp:484
virtual void onDialogClose() OVERRIDE
Will be called first time STK is started, when the 'internet yes/no' dialog is closed.
Definition: register_screen.cpp:183
GUIEngine::LabelWidget * m_info_widget
Save the pointer to the info widget, it is widely used.
Definition: register_screen.hpp:47
virtual void onUpdate(float dt) OVERRIDE
optional callback you can override to be notified at every frame.
Definition: register_screen.cpp:443
bool m_info_message_shown
True if the info message (email was sent...) is shown.
Definition: register_screen.hpp:63
void setParent(BaseUserScreen *us)
Set the parent screen.
Definition: register_screen.hpp:95
GUIEngine::TextBoxWidget * m_password_widget
Save the pointer to the options widget, it is widely used.
Definition: register_screen.hpp:53
virtual bool onEscapePressed() OVERRIDE
Called when escape is pressed.
Definition: register_screen.cpp:537
virtual void loadedFromFile() OVERRIDE
implement callback from parent class GUIEngine::Screen
Definition: register_screen.hpp:78
Contains all GUI engine related classes and functions.
Definition: abstract_state_manager.hpp:33