SuperTuxKart
user_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_USER_INFO_DIALOG_HPP
20 #define HEADER_USER_INFO_DIALOG_HPP
21 
22 #include "guiengine/modaldialog.hpp"
23 #include "guiengine/widgets.hpp"
24 #include "utils/types.hpp"
25 
26 #include <irrString.h>
27 
28 namespace Online
29 {
30  class OnlineProfile;
31 }
32 
38 {
39 
40 private:
41 
42  bool m_self_destroy;
43  bool m_enter_profile;
44  bool m_processing;
45 
46  bool m_error;
47  irr::core::stringw m_info;
48 
49  const uint32_t m_showing_id;
50  Online::OnlineProfile * m_online_profile;
51 
52  GUIEngine::LabelWidget * m_desc_widget;
53  GUIEngine::LabelWidget * m_info_widget;
54 
55  GUIEngine::RibbonWidget * m_options_widget;
56  GUIEngine::IconButtonWidget * m_remove_widget;
57  GUIEngine::IconButtonWidget * m_friend_widget;
58  GUIEngine::IconButtonWidget * m_accept_widget;
59  GUIEngine::IconButtonWidget * m_decline_widget;
60  GUIEngine::IconButtonWidget * m_enter_widget;
61  GUIEngine::IconButtonWidget * m_cancel_widget;
62 
63  void requestJoin();
64  void activate();
65  void deactivate();
66  void sendFriendRequest();
67  void acceptFriendRequest();
68  void declineFriendRequest();
69  void removeExistingFriend();
70  void removePendingFriend();
71 
72 public:
73  UserInfoDialog(uint32_t showing_id, const core::stringw info = "", bool error = false, bool from_queue = false);
74 
75  virtual void beforeAddingWidgets();
76  virtual void load();
77 
78  void onEnterPressedInternal();
79  GUIEngine::EventPropagation processEvent(const std::string& eventSource);
80 
81  virtual bool onEscapePressed();
82  virtual void onUpdate(float dt);
83  virtual void init();
84 };
85 
86 #endif
void removeExistingFriend()
Removes an existing friend.
Definition: user_info_dialog.cpp:301
GUIEngine::EventPropagation processEvent(const std::string &eventSource)
Returns whether to block event propagation (usually, you will want to block events you processed)
Definition: user_info_dialog.cpp:392
virtual void beforeAddingWidgets()
Optional callback invoked very early, before widgets have been added (contrast with init(),...
Definition: user_info_dialog.cpp:64
Declares the general types that are used by the network.
void acceptFriendRequest()
Sends an AcceptFriend request to the server.
Definition: user_info_dialog.cpp:196
A button widget with an icon and optionnaly a label beneath.
Definition: icon_button_widget.hpp:43
void sendFriendRequest()
Sends a friend request to the server.
Definition: user_info_dialog.cpp:141
A static text/icons/tabs bar widget.
Definition: ribbon_widget.hpp:59
void declineFriendRequest()
A request to the server, to decline a friend request.
Definition: user_info_dialog.cpp:251
virtual void onUpdate(float dt)
Override to be notified of updates.
Definition: user_info_dialog.cpp:477
A simple label widget.
Definition: label_widget.hpp:35
Dialog that allows a user to sign in.
Definition: user_info_dialog.hpp:37
Class that represents an online profile.
Definition: online_profile.hpp:41
void removePendingFriend()
Removes a pending friend request.
Definition: user_info_dialog.cpp:348
Abstract base class representing a modal dialog.
Definition: modaldialog.hpp:55
virtual bool onEscapePressed()
Override to change what happens on escape pressed.
Definition: user_info_dialog.cpp:467
virtual void init()
Optional callback invoked after widgets have been add()ed.
Definition: user_info_dialog.cpp:131