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 #include "constants.h"
29 
30 #ifdef USE_UI_TEXT
31 
32 #include "ui.h"
33 
34 #include "../../misc/preferences.h"
35 #include "../../misc/translations.h"
36 
37 namespace UI_TEXT_NS {
38 
39 /** redraw all (of the playfield)
40  **
41  ** @todo   all
42  **/
43 void
redraw_all()44   UI_Text::redraw_all()
45   {
46   } // void UI_Text::redraw_all()
47 
48 /** update the gametype icon
49  **
50  ** @todo   all
51  **/
52 void
gametype_update()53   UI_Text::gametype_update()
54   {
55   } // void UI_Text::gametype_udpate()
56 
57 /** update the trick
58  **
59  ** @todo   all
60  **/
61 void
trick_update()62   UI_Text::trick_update()
63   {
64   } // void UI_Text::trick_update()
65 
66 /** update the name of 'player'
67  **
68  ** @param    player   the player
69  **
70  ** @todo   all
71  **/
72 void
name_update(Player const & player)73   UI_Text::name_update(Player const& player)
74   {
75   } // void UI_Text::name_update(player)
76 
77 /** update the hand of 'player'
78  **
79  ** @param    player   the player
80  **
81  ** @todo   all
82  **/
83 void
hand_update(Player const & player)84   UI_Text::hand_update(Player const& player)
85   {
86   } // void UI_Text::hand_update(player)
87 
88 /** update the trickpile of 'player'
89  **
90  ** @param    player   the player
91  **
92  ** @todo   all
93  **/
94 void
trick_pile_update(Player const & player)95   UI_Text::trick_pile_update(Player const& player)
96   {
97   } // void UI_Text::trick_pile_udpate(player)
98 
99 /** update the team icon of 'player'
100  **
101  ** @param    player   the player
102  **
103  ** @todo   all
104  **/
105 void
teaminfo_update(Player const & player)106   UI_Text::teaminfo_update(Player const& player)
107   {
108   } // void UI_Text::teaminfo_udpate(player)
109 
110 /** update the announcement icon of 'player'
111  **
112  ** @param    player   the player
113  **
114  ** @todo   all
115  **/
116 void
announcement_update(Player const & player)117   UI_Text::announcement_update(Player const& player)
118   {
119   } // void UI_Text::announcement_udpate(player)
120 
121 /** update the rule
122  **
123  ** @param    type      the rule, that has changed
124  ** @param    old_value   old value
125  **
126  ** @todo   all
127  **/
128 void
rule_update(int const type,void const * const old_value)129   UI_Text::rule_update(int const type, void const* const old_value)
130   {
131   } // void UI_Text::rule_update(int const type, void const* const old_value)
132 
133 /** show the update
134  **
135  ** @param    type      the setting, that has changed
136  ** @param    old_value   old value
137  **/
138 void
preference_update(int const type,void const * const old_value)139   UI_Text::preference_update(int const type, void const* const old_value)
140   {
141     if ((type >= Preferences::Type::bool_first)
142         && (type <= Preferences::Type::bool_last))
143       this->ostr() << ::translation("Setting")
144         << ": " << ::translation(Preferences::Type::TypeBool(type))
145         << " = " << ::preferences(Preferences::Type::TypeBool(type))
146         << " (" << *(static_cast<bool const* const>(old_value)) << ")"
147         << '\n';
148     else if ((type >= Preferences::Type::unsigned_first)
149              && (type <= Preferences::Type::unsigned_last))
150       this->ostr() << ::translation("Setting")
151         << ": " << ::translation(Preferences::Type::TypeUnsigned(type))
152         << " = " << ::preferences(Preferences::Type::TypeUnsigned(type))
153         << " (" << *(static_cast<unsigned const* const>(old_value)) << ")"
154         << '\n';
155     else if ((type >= Preferences::Type::string_first)
156              && (type <= Preferences::Type::string_last))
157       this->ostr() << ::translation("Setting")
158         << ": " << ::translation(Preferences::Type::TypeString(type))
159         << " = " << ::preferences(Preferences::Type::TypeString(type))
160         << " (" << *(static_cast<string const* const>(old_value)) << ")"
161         << '\n';
162     else if (type == Preferences::Type::cards_order)
163       this->ostr() << ::translation("Setting")
164         << ": " << ::translation(::name(Preferences::Type::TypeCardsOrder(type)))
165         << " = " << ::preferences(Preferences::Type::TypeCardsOrder(type))
166         << " (" << *(static_cast<Preferences::Type::CardsOrder const* const>(old_value)) << ")"
167         << '\n';
168   } // void UI_Text::preference_update(int type, void const* old_value)
169 
170 } // namespace UI_TEXT_NS
171 
172 #endif // #ifdef USE_UI_TEXT
173