summaryrefslogtreecommitdiff
path: root/src/gui/register.h
diff options
context:
space:
mode:
authorEugenio Favalli <elvenprogrammer@gmail.com>2005-12-30 16:27:24 +0000
committerEugenio Favalli <elvenprogrammer@gmail.com>2005-12-30 16:27:24 +0000
commitea653b2e9e1b46a07440833f96b3d2b788592c61 (patch)
tree252bb23d2064d14d4aa0796aa159f94873cb6419 /src/gui/register.h
parent57d63f1dd5df0beb1a3d81f014686a2f80dfe7fc (diff)
downloadmana-ea653b2e9e1b46a07440833f96b3d2b788592c61.tar.gz
mana-ea653b2e9e1b46a07440833f96b3d2b788592c61.tar.bz2
mana-ea653b2e9e1b46a07440833f96b3d2b788592c61.tar.xz
mana-ea653b2e9e1b46a07440833f96b3d2b788592c61.zip
Added a new item, improved smooth login sequence, added a registration window (a lot of duplicated code to be removed).
Diffstat (limited to 'src/gui/register.h')
-rw-r--r--src/gui/register.h90
1 files changed, 90 insertions, 0 deletions
diff --git a/src/gui/register.h b/src/gui/register.h
new file mode 100644
index 00000000..25a867bd
--- /dev/null
+++ b/src/gui/register.h
@@ -0,0 +1,90 @@
+/*
+ * The Mana World
+ * Copyright 2004 The Mana World Development Team
+ *
+ * This file is part of The Mana World.
+ *
+ * The Mana World is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * The Mana World is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with The Mana World; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * $Id$
+ */
+
+#ifndef _TMW_REGISTER_H
+#define _TMW_REGISTER_H
+
+#include <iosfwd>
+#include <guichan/actionlistener.hpp>
+#include <SDL_events.h>
+
+#include "window.h"
+#include "login.h"
+#include "../guichanfwd.h"
+
+/**
+ * The login dialog.
+ *
+ * \ingroup Interface
+ */
+class RegisterDialog : public Window, public gcn::ActionListener {
+ public:
+ /**
+ * Constructor
+ *
+ * @see Window::Window
+ */
+ RegisterDialog();
+
+ /**
+ * Called when receiving actions from the widgets.
+ */
+ void action(const std::string& eventId);
+
+ /**
+ * Updates dialog logic.
+ */
+ void logic();
+
+ // Made them public to have the possibility to request focus
+ // from external functions.
+ gcn::TextField *userField;
+ gcn::TextField *passwordField;
+ gcn::TextField *confirmField;
+
+ private:
+ gcn::Label *userLabel;
+ gcn::Label *passwordLabel;
+ gcn::Label *confirmLabel;
+ gcn::Label *serverLabel;
+ gcn::TextField *serverField;
+ gcn::Button *registerButton;
+ gcn::Button *cancelButton;
+ gcn::RadioButton *maleButton;
+ gcn::RadioButton *femaleButton;
+ int mStatus;
+
+ void attemptRegistration(const std::string& user,
+ const std::string& pass);
+ void checkRegistration();
+
+ WrongDataNoticeListener *wrongDataNoticeListener;
+ OkDialog *wrongRegisterNotice;
+};
+
+/**
+ * Handle input
+ */
+void registerInputHandler(SDL_KeyboardEvent *keyEvent);
+
+#endif