1 /**********************************************************************
2 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12 ***********************************************************************/
14 #ifndef FC__REPODLGS_H
15 #define FC__REPODLGS_H
18 #include <fc_config.h>
22 #include "repodlgs_g.h"
45 class QTableWidgetItem
;
47 /****************************************************************************
48 Helper item for comboboxes, holding string of tech and its id
49 ****************************************************************************/
55 /****************************************************************************
56 Helper item for research diagram, about drawn rectangles and what
57 tech/unit/improvement they point to.
58 ****************************************************************************/
59 class req_tooltip_help
65 struct unit_type
*tunit
;
66 struct impr_type
*timpr
;
67 struct government
*tgov
;
69 /****************************************************************************
70 Custom widget representing research diagram in science_report
71 ****************************************************************************/
72 class research_diagram
: public QWidget
77 research_diagram(QWidget
*parent
= 0);
79 void update_reqtree();
84 void mousePressEvent(QMouseEvent
*event
);
85 void mouseMoveEvent(QMouseEvent
*event
);
86 void paintEvent(QPaintEvent
*event
);
87 void create_tooltip_help();
88 struct canvas
*pcanvas
;
92 QList
<req_tooltip_help
*> tt_help
;
95 /****************************************************************************
96 Widget embedded as tab on game view (F6 default)
97 Uses string "SCI" to mark it as opened
98 You can check it using if (gui()->is_repo_dlg_open("SCI"))
99 ****************************************************************************/
100 class science_report
: public QWidget
104 QComboBox
*goal_combo
;
105 QComboBox
*researching_combo
;
106 QGridLayout
*sci_layout
;
107 progress_bar
*progress
;
109 QLabel
*progress_label
;
110 QList
<qlist_item
> *curr_list
;
111 QList
<qlist_item
> *goal_list
;
112 research_diagram
*res_diag
;
118 void update_report();
119 void init(bool raise
);
124 void update_reqtree();
128 void current_tech_changed(int index
);
129 void goal_tech_changed(int index
);
132 /****************************************************************************
133 Tab widget to display units report (F2)
134 ****************************************************************************/
135 class units_report
: public QWidget
138 QPushButton
*find_button
;
139 QPushButton
*upgrade_button
;
140 QTableWidget
*units_widget
;
145 void update_report();
153 struct unit
*find_nearest_unit(const struct unit_type
*utype
,
158 void upgrade_units();
159 void selection_changed(const QItemSelection
&sl
,
160 const QItemSelection
&ds
);
164 /****************************************************************************
165 Tab widget to display economy report (F5)
166 ****************************************************************************/
167 class eco_report
: public QWidget
170 QPushButton
*disband_button
;
171 QPushButton
*sell_button
;
172 QPushButton
*sell_redun_button
;
173 QTableWidget
*eco_widget
;
179 void update_report();
190 void disband_units();
191 void sell_buildings();
192 void sell_redundant();
193 void selection_changed(const QItemSelection
&sl
,
194 const QItemSelection
&ds
);
197 /****************************************************************************
198 Tab widget to display economy report (F5)
199 ****************************************************************************/
200 class endgame_report
: public QWidget
203 QTableWidget
*end_widget
;
206 endgame_report(const struct packet_endgame_report
*packet
);
208 void update_report(const struct packet_endgame_player
*packet
);
218 bool comp_less_than(const qlist_item
&q1
, const qlist_item
&q2
);
219 void popdown_economy_report();
220 void popdown_units_report();
221 void popdown_science_report();
222 void popdown_endgame_report();
223 void popup_endgame_report();
225 #endif /* FC__REPODLGS_H */