1 #ifndef _ModeratorActionsWnd_h_
2 #define _ModeratorActionsWnd_h_
3 
4 #include <vector>
5 #include <boost/signals2/signal.hpp>
6 #include <GG/GGFwd.h>
7 
8 #include "CUIWnd.h"
9 #include "../universe/EnumsFwd.h"
10 
11 
12 class ModeratorActionsWnd : public CUIWnd {
13 public:
14     //! \name Structors //!@{
15     ModeratorActionsWnd(const std::string& config_name = "");
16     void CompleteConstruction() override;
17 
18     virtual ~ModeratorActionsWnd();
19     //!@}
20 
21     /** \name Accessors */ //@{
22     ModeratorActionSetting  SelectedAction() const;
23     PlanetType              SelectedPlanetType() const;
24     PlanetSize              SelectedPlanetSize() const;
25     StarType                SelectedStarType() const;
26     int                     SelectedEmpire() const;
27     //!@}
28 
29     /** \name Mutators */ //@{
30     void SizeMove(const GG::Pt& ul, const GG::Pt& lr) override;
31 
32     void            Refresh();
33     void            EnableActions(bool enable = true);
34     //!@}
35 
36     mutable boost::signals2::signal<void ()>           ClosingSignal;
37     mutable boost::signals2::signal<void ()>           NoActionSelectedSignal;
38     mutable boost::signals2::signal<void (StarType)>   CreateSystemActionSelectedSignal;
39     mutable boost::signals2::signal<void (PlanetType)> CreatePlanetActionSelectedSignal;
40     mutable boost::signals2::signal<void ()>           DeleteObjectActionSelectedSignal;
41     mutable boost::signals2::signal<void (int)>        SetOwnerActionSelectedSignal;
42     mutable boost::signals2::signal<void ()>           AddStarlaneActionSelectedSignal;
43 
44 private:
45     void CloseClicked() override;
46 
47     void            DoLayout();
48 
49     void            NoAction();
50     void            CreateSystem();
51     void            CreatePlanet();
52     void            DeleteObject();
53     void            SetOwner();
54     void            AddStarlane();
55     void            RemoveStarlane();
56 
57     StarType        StarTypeFromIndex(std::size_t i) const;
58     PlanetType      PlanetTypeFromIndex(std::size_t i) const;
59     PlanetSize      PlanetSizeFromIndex(std::size_t i) const;
60     int             EmpireIDFromIndex(std::size_t i) const;
61 
62     bool                    m_actions_enabled;
63     ModeratorActionSetting  m_selected_action;
64     std::shared_ptr<GG::Button>             m_no_action_button;
65     std::shared_ptr<GG::Button>             m_create_system_button;
66     std::shared_ptr<GG::DropDownList>       m_star_type_drop;
67     std::shared_ptr<GG::Button>             m_create_planet_button;
68     std::shared_ptr<GG::DropDownList>       m_planet_type_drop;
69     std::shared_ptr<GG::DropDownList>       m_planet_size_drop;
70     std::shared_ptr<GG::Button>             m_delete_object_button;
71     std::shared_ptr<GG::Button>             m_set_owner_button;
72     std::shared_ptr<GG::DropDownList>       m_empire_drop;
73     std::shared_ptr<GG::Button>             m_add_starlane_button;
74     std::shared_ptr<GG::Button>             m_remove_starlane_button;
75 };
76 
77 #endif // _ModeratorActionsWnd_h_
78