File: SitRepPanel.h

package info (click to toggle)
freeorion 0.5.1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 194,920 kB
  • sloc: cpp: 186,821; python: 40,979; ansic: 1,164; xml: 721; makefile: 32; sh: 7
file content (51 lines) | stat: -rw-r--r-- 1,575 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef _SitRepPanel_h_
#define _SitRepPanel_h_

#include <GG/GGFwd.h>
#include <GG/ListBox.h>
#include "CUIWnd.h"

class SitRepEntry;


class SitRepPanel : public CUIWnd {
public:
    SitRepPanel(std::string_view config_name = "");
    void CompleteConstruction() override;

    std::set<std::string>   HiddenSitRepTemplates() const { return m_hidden_sitrep_templates; }
    int                     NumVisibleSitrepsThisTurn() const;

    void KeyPress(GG::Key key, uint32_t key_code_point, GG::Flags<GG::ModKey> mod_keys) override;

    void SizeMove(GG::Pt ul, GG::Pt lr) override;

    void Update(); ///< loads all the relevant SitReps into the window

    void ShowSitRepsForTurn(int turn);
    void SetHiddenSitRepTemplates(const std::set<std::string>& templates);

    mutable boost::signals2::signal<void ()> ClosingSignal;

private:
    void CloseClicked() override;

    void PrevClicked();
    void NextClicked();
    void LastClicked();
    void FilterClicked();
    void IgnoreSitRep(GG::ListBox::iterator it, GG::Pt pt, GG::Flags<GG::ModKey> mod);
    void DismissalMenu(GG::ListBox::iterator it, GG::Pt pt, GG::Flags<GG::ModKey> mod);
    void DoLayout();

    std::shared_ptr<GG::ListBox>    m_sitreps_lb;
    std::shared_ptr<GG::Button>     m_prev_turn_button;
    std::shared_ptr<GG::Button>     m_next_turn_button;
    std::shared_ptr<GG::Button>     m_last_turn_button;
    std::shared_ptr<GG::Button>     m_filter_button;
    int                             m_showing_turn = 0;
    std::set<std::string>           m_hidden_sitrep_templates;
};


#endif