The Battle for Wesnoth  1.15.2+dev
uninstall_list.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2011 - 2018 by Iris Morelle <shadowm2006@gmail.com>
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 #include <map>
20 
21 namespace gui2
22 {
23 namespace dialogs
24 {
25 
27 {
28 public:
29  /**
30  * Constructor.
31  *
32  * @param addon_titles_map
33  * Internal id <-> user-visible title mappings for
34  * the add-ons to display.
35  */
37  const std::map<std::string, std::string>& addon_titles_map)
38  : titles_map_(addon_titles_map), ids_(), selections_()
39  {
40  }
41 
42  std::vector<std::string> selected_addons() const;
43 
44 private:
45  std::map<std::string, std::string> titles_map_;
46  std::vector<std::string> ids_;
47  std::map<std::string, bool> selections_;
48 
49  /** Inherited from modal_dialog, implemented by REGISTER_DIALOG. */
50  virtual const std::string& window_id() const override;
51 
52  /** Inherited from modal_dialog. */
53  virtual void pre_show(window& window) override;
54 
55  /** Inherited from modal_dialog. */
56  virtual void post_show(window& window) override;
57 };
58 
59 } // namespace dialogs
60 } // namespace gui2
addon_uninstall_list(const std::map< std::string, std::string > &addon_titles_map)
Constructor.
std::vector< std::string > selected_addons() const
virtual const std::string & window_id() const override
Inherited from modal_dialog, implemented by REGISTER_DIALOG.
Generic file dialog.
Definition: field-fwd.hpp:22
std::vector< std::string > ids_
std::map< std::string, std::string > titles_map_
Various uncategorised dialogs.
virtual void pre_show(window &window) override
Inherited from modal_dialog.
std::map< std::string, bool > selections_
Abstract base class for all modal dialogs.
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.