Freeciv-3.2
Loading...
Searching...
No Matches
ruledit_qt.h
Go to the documentation of this file.
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)
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__RULEDIT_QT_H
15#define FC__RULEDIT_QT_H
16
17// Qt
18#include <QApplication>
19#include <QMainWindow>
20#include <QObject>
21#include <QLabel>
22#include <QTabWidget>
23
24// ruledit
25#include "effect_edit.h"
26#include "rulesave.h"
27
28class QLineEdit;
29class QStackedLayout;
30
31class requirers_dlg;
32class tab_achievement;
33class tab_building;
34class tab_counter;
35class tab_good;
36class tab_gov;
37class tab_misc;
38class tab_multiplier;
39class tab_tech;
40class tab_unit;
41class tab_nation;
42class tab_enabler;
43class tab_extras;
44class tab_terrains;
45class req_edit;
46class req_vec_fix;
48
49// Minimum initial size of the window
50#define RULEDIT_WINWIDTH 700
51#define RULEDIT_WINHEIGHT 650
52
53class ruledit_main : public QMainWindow
54{
56
57public:
59
60private:
61 void popup_quit_dialog();
63 QWidget *central;
64
65protected:
67};
68
69// get 'struct req_edit_list' and related functions:
70#define SPECLIST_TAG req_edit
71#define SPECLIST_TYPE class req_edit
72#include "speclist.h"
73
74#define req_edit_list_iterate(reqeditlist, preqedit) \
75 TYPED_LIST_ITERATE(class req_edit, reqeditlist, preqedit)
76#define req_edit_list_iterate_end LIST_ITERATE_END
77
78// get 'struct effect_edit_list' and related functions:
79#define SPECLIST_TAG effect_edit
80#define SPECLIST_TYPE class effect_edit
81#include "speclist.h"
82
83#define effect_edit_list_iterate(effecteditlist, peffectedit) \
84 TYPED_LIST_ITERATE(class effect_edit, effecteditlist, peffectedit)
85#define effect_edit_list_iterate_end LIST_ITERATE_END
86
87// get 'struct req_vec_fix_list' and related functions:
88#define SPECLIST_TAG req_vec_fix
89#define SPECLIST_TYPE class req_vec_fix
90#include "speclist.h"
91
92#define req_vec_fix_list_iterate(reqvecfixlist, preqvecfix) \
93 TYPED_LIST_ITERATE(class req_vec_fix, reqvecfixlist, preqvecfix)
94#define req_vec_fix_list_iterate_end LIST_ITERATE_END
95
96class ruledit_gui : public QObject
97{
99
100 public:
101 void setup(QWidget *central_in);
102 void display_msg(const char *msg);
104 void show_required(requirers_dlg *requirers, const char *msg);
105 void flush_widgets();
106
107 void open_req_edit(QString target, struct requirement_vector *preqs);
109
110 void open_req_vec_fix(req_vec_fix_item *item_info);
112
113 void open_effect_edit(QString target, struct universal *uni,
114 enum effect_filter_main_class efmc);
117
119
120signals:
121 /********************************************************************/
126
127 private:
128 void launch_now();
129
130 QLabel *msg_dspl;
131 QTabWidget *stack;
132 QLineEdit *ruleset_select;
133 QWidget *central;
135
149
153
154 private slots:
155 void rulesetdir_given();
157};
158
159int ruledit_qt_run(int argc, char **argv);
160void ruledit_qt_display_requirers(const char *msg, void *data);
161
162#endif // FC__RULEDIT_QT_H
tab_nation * nation
Definition ruledit_qt.h:148
tab_achievement * ach
Definition ruledit_qt.h:136
void req_vec_may_have_changed(const requirement_vector *vec)
tab_unit * unit
Definition ruledit_qt.h:141
void open_req_vec_fix(req_vec_fix_item *item_info)
tab_good * good
Definition ruledit_qt.h:142
tab_enabler * enablers
Definition ruledit_qt.h:144
void unregister_effect_edit(class effect_edit *e_edit)
void flush_widgets()
tab_multiplier * multipliers
Definition ruledit_qt.h:146
QStackedLayout * main_layout
Definition ruledit_qt.h:134
struct rule_data data
Definition ruledit_qt.h:118
tab_misc * misc
Definition ruledit_qt.h:139
struct effect_edit_list * effect_edits
Definition ruledit_qt.h:152
tab_extras * extras
Definition ruledit_qt.h:145
void incoming_req_vec_change(const requirement_vector *vec)
tab_terrains * terrains
Definition ruledit_qt.h:147
void display_msg(const char *msg)
void refresh_effect_edits()
void setup(QWidget *central_in)
void open_req_edit(QString target, struct requirement_vector *preqs)
tab_gov * gov
Definition ruledit_qt.h:143
void unregister_req_vec_fix(req_vec_fix *fixer)
tab_building * bldg
Definition ruledit_qt.h:137
requirers_dlg * create_requirers(const char *title)
tab_tech * tech
Definition ruledit_qt.h:140
void launch_now()
struct req_edit_list * req_edits
Definition ruledit_qt.h:150
QTabWidget * stack
Definition ruledit_qt.h:131
struct req_vec_fix_list * req_vec_fixers
Definition ruledit_qt.h:151
void show_required(requirers_dlg *requirers, const char *msg)
tab_counter * counter
Definition ruledit_qt.h:138
QLabel * msg_dspl
Definition ruledit_qt.h:130
QWidget * central
Definition ruledit_qt.h:133
void rulesetdir_given()
void open_effect_edit(QString target, struct universal *uni, enum effect_filter_main_class efmc)
QLineEdit * ruleset_select
Definition ruledit_qt.h:132
void unregister_req_edit(class req_edit *redit)
QWidget * central
Definition ruledit_qt.h:63
void popup_quit_dialog()
void closeEvent(QCloseEvent *cevent)
QApplication * qapp
Definition ruledit_qt.h:62
char * incite_cost
Definition comments.c:75
effect_filter_main_class
Definition effect_edit.h:34
const char * title
Definition repodlgs.c:1314
struct player_slot * slots
Definition player.c:51
void ruledit_qt_display_requirers(const char *msg, void *data)
int ruledit_qt_run(int argc, char **argv)