The Battle for Wesnoth  1.15.2+dev
mp_login.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2008 - 2018 by Mark de Wever <koraq@xs4all.nl>
3  Part of the Battle for Wesnoth Project https://www.wesnoth.org/
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY.
11 
12  See the COPYING file for more details.
13 */
14 
15 #pragma once
16 
18 
19 namespace gui2
20 {
21 class field_text;
22 
23 namespace dialogs
24 {
25 
26 class mp_login : public modal_dialog
27 {
28 public:
29  mp_login(const std::string& host, const std::string& label, const bool focus_password);
30 
31 private:
32  /** Inherited from modal_dialog, implemented by REGISTER_DIALOG. */
33  virtual const std::string& window_id() const override;
34 
35  /** Inherited from modal_dialog. */
36  virtual void pre_show(window& window) override;
37 
38  /** Inherited from modal_dialog. */
39  virtual void post_show(window& window) override;
40 
41  void load_password(window& win) const;
42  void save_password(window& win) const;
43 
44  const std::string host_;
47 };
48 
49 } // namespace dialogs
50 } // namespace gui2
field_text * username_
Definition: mp_login.hpp:45
const std::string host_
Definition: mp_login.hpp:44
Label showing a text.
Definition: label.hpp:32
Generic file dialog.
Definition: field-fwd.hpp:22
virtual void pre_show(window &window) override
Inherited from modal_dialog.
Definition: mp_login.cpp:91
virtual const std::string & window_id() const override
Inherited from modal_dialog, implemented by REGISTER_DIALOG.
void load_password(window &win) const
Definition: mp_login.cpp:79
Various uncategorised dialogs.
mp_login(const std::string &host, const std::string &label, const bool focus_password)
Definition: mp_login.cpp:65
void save_password(window &win) const
Definition: mp_login.cpp:85
Abstract base class for all modal dialogs.
Specialized field class for text.
Definition: field.hpp:592
base class of top level items, the only item which needs to store the final canvases to draw on ...
Definition: window.hpp:62
virtual void post_show(window &window) override
Inherited from modal_dialog.
Definition: mp_login.cpp:106