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