1 /**********************************************************************
2  *
3  *   FreeDoko a Doppelkopf-Game
4  *
5  *   Copyright (C) 2001 – 2018 by Diether Knof and Borg Enders
6  *
7  *   This program is free software; you can redistribute it and/or
8  *   modify it under the terms of the GNU General Public License as
9  *   published by the Free Software Foundation; either version 2 of
10  *   the License, or (at your option) any later version.
11  *
12  *   This program is distributed in the hope that it will be useful,
13  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  *   GNU General Public License for more details.
16  *   You can find this license in the file 'gpl.txt'.
17  *
18  *   You should have received a copy of the GNU General Public License
19  *   along with this program; if not, write to the Free Software
20  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21  *   MA  02111-1307  USA
22  *
23  *  Contact:
24  *    Diether Knof dknof@posteo.de
25  *
26  **********************************************************************/
27 
28 #ifdef USE_UI_GTKMM
29 
30 #pragma once
31 
32 #include "gameinfo_dialog.h"
33 
34 
35 class Player;
36 
37 #include <gtkmm/box.h>
38 namespace Gtk {
39 class Image;
40 class Label;
41 }; // namespace Gtk
42 
43 namespace UI_GTKMM_NS {
44 class Table;
45 
46 /**
47  ** base class for game informations
48  **
49  ** @todo   reply button
50  **/
51 class GameInfoDialog::Information : public Base, public Gtk::Box {
52   public:
53     // child classes
54     class GameType;
55     class Marriage;
56     class Genscher;
57     class Announcement;
58     class Swines;
59     class Hyperswines;
60 
61   public:
62     friend class GameInfoDialog;
63 
64   public:
65     Information(Base* parent, string  title);
66     ~Information() override;
67 
68     // the name of 'player' has changed
69     virtual void name_changed(Player const& player);
70 
71   protected:
72     // initialize the game information
73     // to be called from the children
74     virtual void init();
75 
76     // update the texts
77     virtual void update_texts();
78 
79     // whether the information is blocking the gameplay
80     virtual bool is_blocking() const;
81 
82   protected:
83     // the title
84     ::string title;
85     // the icon
86     Gtk::Image* icon = nullptr;
87     // the text
88     Gtk::Label* label = nullptr;
89 
90   private: // unused
91     Information() = delete;
92     Information(Information const&) = delete;
93     Information& operator=(Information const&) = delete;
94 }; // class GameInfoDialog::Information : public Base, public Gkt::Box
95 
96 } // namespace UI_GTKMM_NS
97 
98 #endif // #ifdef USE_UI_GTKMM
99