1 #ifndef _ResearchWnd_h_ 2 #define _ResearchWnd_h_ 3 4 #include "CUIWnd.h" 5 6 #include <GG/ListBox.h> 7 8 class TechTreeWnd; 9 class ResourceInfoPanel; 10 class ResearchQueueWnd; 11 12 /** Contains a TechTreeWnd, some stats on the empire-wide research queue, and the queue itself. */ 13 class ResearchWnd : public GG::Wnd { 14 public: 15 /** \name Structors */ //@{ 16 ResearchWnd(GG::X w, GG::Y h, bool initially_hidden = true); 17 ~ResearchWnd(); 18 //@} 19 void CompleteConstruction() override; 20 21 /** \name Accessors */ //@{ 22 int ShownEmpireID() const; 23 bool PediaVisible(); 24 //@} 25 26 /** \name Mutators */ //@{ 27 void SizeMove(const GG::Pt& ul, const GG::Pt& lr) override; 28 29 void Render() override; 30 31 void SetEmpireShown(int empire_id); 32 33 void Refresh(); 34 void Reset(); 35 void Update(); 36 37 void CenterOnTech(const std::string& tech_name); 38 /** Set encyclopedia entry to tech article for @p tech_name 39 * Selects and centers tech @p tech_name if tech is initially visible 40 * or if @p force is true(default). */ 41 void ShowTech(const std::string& tech_name, bool force = true); 42 void QueueItemMoved(const GG::ListBox::iterator& row_it, const GG::ListBox::iterator& original_position_it); 43 void Sanitize(); 44 45 void ShowPedia(); 46 void HidePedia(); 47 void TogglePedia(); 48 49 /** Enables, or disables if \a enable is false, issuing orders via this ResearchWnd. */ 50 void EnableOrderIssuing(bool enable = true); 51 //@} 52 53 private: 54 void DoLayout(bool init = false); 55 void ResearchQueueChangedSlot(); 56 void UpdateQueue(); 57 void UpdateInfoPanel(); ///< Updates research summary at top left of production screen, and signals that the empire's minerals research pool has changed (propagates to the mapwnd to update indicator) 58 void DeleteQueueItem(GG::ListBox::iterator it); 59 void AddTechsToQueueSlot(const std::vector<std::string>& tech_vec, int pos = -1); 60 void QueueItemClickedSlot(GG::ListBox::iterator it, const GG::Pt& pt, const GG::Flags<GG::ModKey>& modkeys); 61 void QueueItemDoubleClickedSlot(GG::ListBox::iterator it, const GG::Pt& pt, const GG::Flags<GG::ModKey>& modkeys); 62 void QueueItemPaused(GG::ListBox::iterator it, bool pause); 63 64 std::shared_ptr<ResourceInfoPanel> m_research_info_panel; 65 std::shared_ptr<ResearchQueueWnd> m_queue_wnd; 66 std::shared_ptr<TechTreeWnd> m_tech_tree_wnd; 67 68 bool m_enabled; 69 int m_empire_shown_id; 70 boost::signals2::connection m_empire_connection; 71 }; 72 73 #endif // _ResearchWnd_h_ 74