Freeciv-3.3
Loading...
Searching...
No Matches
req_vec_fix.h
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 2020 - The Freeciv Project contributors.
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)
6 any later version.
7
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***********************************************************************/
13
14#ifndef FC__REQ_VEC_FIX_H
15#define FC__REQ_VEC_FIX_H
16
17#ifdef HAVE_CONFIG_H
18#include <fc_config.h>
19#endif
20
21// Qt
22#include <QWidget>
23
24// common
25#include "requirements.h"
26
27class QButtonGroup;
28class QListWidgetItem;
29class QPushButton;
30class QStackedLayout;
31
32class ruledit_gui;
33
34// How serious a req_vec_problem is considered
40
43
44/**********************************************************************/
49{
50public:
51 /********************************************************************/
54 virtual void close() = 0;
55
56 /********************************************************************/
60 virtual const void *item() = 0;
61
62 /********************************************************************/
66 virtual void *item_working_copy() = 0;
67
68 /********************************************************************/
74 virtual const char *name() = 0;
75
76 /********************************************************************/
81 virtual struct req_vec_problem *find_next_problem() = 0;
82
83 /********************************************************************/
89 virtual void apply_accepted_changes() = 0;
90
91 /********************************************************************/
96 virtual void undo_accepted_changes() = 0;
97
98 /********************************************************************/
102 virtual int num_vectors() = 0;
103
104 /********************************************************************/
111
112 /********************************************************************/
119
120 /********************************************************************/
125 virtual bool vector_in_item(const struct requirement_vector *vec) = 0;
126
127 /********************************************************************/
130 virtual ~req_vec_fix_item() {};
131};
132
133/**********************************************************************/
136class req_vec_fix_problem : public QWidget
137{
139
140public:
141 explicit req_vec_fix_problem(const struct req_vec_problem *problem,
142 req_vec_fix_item *item_info);
143
144private:
146
147signals:
149
150private slots:
151 void accept_solution();
152};
153
154/**********************************************************************/
157class req_vec_fix : public QWidget
158{
160
161public:
163 ~req_vec_fix();
164
165 const void *item();
166
167 bool refresh(void);
168
169signals:
170 /********************************************************************/
175
176private:
180
182
185 QPushButton *apply_changes, *abort, *close;
186
187private slots:
191
193};
194
195#endif // FC__REQ_VEC_FIX_H
virtual requirement_vector_by_number vector_getter()=0
virtual requirement_vector_namer vector_namer()=0
virtual void close()=0
virtual void undo_accepted_changes()=0
virtual void apply_accepted_changes()=0
virtual bool vector_in_item(const struct requirement_vector *vec)=0
virtual int num_vectors()=0
virtual const char * name()=0
virtual ~req_vec_fix_item()
virtual struct req_vec_problem * find_next_problem()=0
virtual void * item_working_copy()=0
virtual const void * item()=0
void solution_accepted(int selected_solution)
QButtonGroup * solutions
bool refresh(void)
struct req_vec_problem * current_problem
QPushButton * close
const void * item()
void accept_applied_solutions()
void incoming_req_vec_change(const requirement_vector *vec)
req_vec_fix_problem * current_problem_viewer
QPushButton * abort
QStackedLayout * current_problem_area
void reject_applied_solutions()
ruledit_gui * ui
void req_vec_may_have_changed(const requirement_vector *vec)
void apply_solution(int selected_solution)
req_vec_fix_item * item_info
bool did_apply_a_solution
QPushButton * apply_changes
char * incite_cost
Definition comments.c:76
struct player_slot * slots
Definition player.c:51
req_vec_problem_seriousness
Definition req_vec_fix.h:35
@ RVPS_NO_PROBLEM
Definition req_vec_fix.h:36
@ RVPS_REPAIR
Definition req_vec_fix.h:38
@ RVPS_IMPROVE
Definition req_vec_fix.h:37
void mark_item(QListWidgetItem *item, enum req_vec_problem_seriousness problem_level)
const char *(* requirement_vector_namer)(req_vec_num_in_item number)
struct requirement_vector *(* requirement_vector_by_number)(const void *parent_item, req_vec_num_in_item number)
Definition climisc.h:82