Freeciv-3.2: /fast/freeciv/nightly/S3_2/tools/ruledit/effect_edit.h Source File

Freeciv-3.2

Loading...
Searching...
No Matches
effect_edit.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__EFFECT_EDIT_H
15#define FC__EFFECT_EDIT_H
16
17#ifdef HAVE_CONFIG_H
18#include <fc_config.h>
19#endif
20
21// Qt
22#include <QDialog>
23#include <QListWidget>
24#include <QToolButton>
25
26// common
27#include "requirements.h"
28
29class QLineEdit;
30class QSpinBox;
31
32class ruledit_gui;
33
34 enum effect_filter_main_class { EFMC_NORMAL,
35 EFMC_NONE, // No requirements
36 EFMC_ALL // Any requirements
37};
38
39 struct effect_list_fill_data
40{
41 struct universal *filter;
42 enum effect_filter_main_class efmc;
43 class effect_edit *edit;
44 int num;
45};
46
47 class effect_edit : public QDialog
48{
49 Q_OBJECT
50
51 public:
52 explicit effect_edit(ruledit_gui *ui_in, QString target,
53 struct universal *filter_in, enum effect_filter_main_class efmc_in);
54 ~effect_edit();
55 void refresh();
56 void add(const char *msg);
57 void add_effect_to_list(struct effect *peffect,
58 struct effect_list_fill_data *fill_data);
59
60 struct universal *filter_get();
61
62 enum effect_filter_main_class efmc;
63
64 private:
65 ruledit_gui *ui;
66
67 QString name;
68 QListWidget *list_widget;
69 struct universal filter;
70 struct effect_list *effects;
71
72 struct effect *selected;
73 int selected_nbr;
74
75 QToolButton *edit_type_button;
76 QSpinBox *value_box;
77
78 QToolButton *mp_button;
79 QLineEdit *comment;
80
81 private slots:
82 void select_effect();
83 void fill_active();
84 void edit_reqs();
85 void add_now();
86 void delete_now();
87 void close_now();
88
89 void effect_type_menu(QAction *action);
90 void set_value(int value);
91 void multiplier_menu(QAction *action);
92 void comment_given();
93
94 protected:
95 void closeEvent(QCloseEvent *event);
96};
97
98#endif // FC__EFFECT_EDIT_H
effect_edit
Definition effect_edit.h:48
effect_edit::effects
struct effect_list * effects
Definition effect_edit.h:70
effect_edit::multiplier_menu
void multiplier_menu(QAction *action)
Definition effect_edit.cpp:366
effect_edit::edit_type_button
QToolButton * edit_type_button
Definition effect_edit.h:75
effect_edit::close_now
void close_now()
Definition effect_edit.cpp:228
effect_edit::name
QString name
Definition effect_edit.h:67
effect_edit::add_effect_to_list
void add_effect_to_list(struct effect *peffect, struct effect_list_fill_data *fill_data)
Definition effect_edit.cpp:200
effect_edit::fill_active
void fill_active()
Definition effect_edit.cpp:256
effect_edit::edit_reqs
void edit_reqs()
Definition effect_edit.cpp:308
effect_edit::~effect_edit
~effect_edit()
Definition effect_edit.cpp:148
effect_edit::efmc
enum effect_filter_main_class efmc
Definition effect_edit.h:62
effect_edit::add
void add(const char *msg)
effect_edit::set_value
void set_value(int value)
Definition effect_edit.cpp:296
effect_edit::mp_button
QToolButton * mp_button
Definition effect_edit.h:78
effect_edit::delete_now
void delete_now()
Definition effect_edit.cpp:352
effect_edit::comment_given
void comment_given()
Definition effect_edit.cpp:386
effect_edit::selected_nbr
int selected_nbr
Definition effect_edit.h:73
effect_edit::closeEvent
void closeEvent(QCloseEvent *event)
Definition effect_edit.cpp:325
effect_edit::filter
struct universal filter
Definition effect_edit.h:69
effect_edit::list_widget
QListWidget * list_widget
Definition effect_edit.h:68
effect_edit::filter_get
struct universal * filter_get()
Definition effect_edit.cpp:220
effect_edit::value_box
QSpinBox * value_box
Definition effect_edit.h:76
effect_edit::refresh
void refresh()
Definition effect_edit.cpp:181
effect_edit::ui
ruledit_gui * ui
Definition effect_edit.h:65
effect_edit::effect_type_menu
void effect_type_menu(QAction *action)
Definition effect_edit.cpp:280
effect_edit::comment
QLineEdit * comment
Definition effect_edit.h:79
effect_edit::add_now
void add_now()
Definition effect_edit.cpp:333
effect_edit::selected
struct effect * selected
Definition effect_edit.h:72
effect_edit::select_effect
void select_effect()
Definition effect_edit.cpp:237
ruledit_gui
Definition ruledit_qt.h:97
incite_cost
char * incite_cost
Definition comments.c:74
effect_filter_main_class
effect_filter_main_class
Definition effect_edit.h:34
EFMC_ALL
@ EFMC_ALL
Definition effect_edit.h:36
EFMC_NORMAL
@ EFMC_NORMAL
Definition effect_edit.h:34
EFMC_NONE
@ EFMC_NONE
Definition effect_edit.h:35
event
enum event_type event
Definition events.c:81
slots
struct player_slot * slots
Definition player.c:51
requirements.h
action
Definition actions.h:360
effect_list_fill_data
Definition effect_edit.h:40
effect_list_fill_data::num
int num
Definition effect_edit.h:44
effect_list_fill_data::filter
struct universal * filter
Definition effect_edit.h:41
effect_list_fill_data::efmc
enum effect_filter_main_class efmc
Definition effect_edit.h:42
effect_list_fill_data::edit
class effect_edit * edit
Definition effect_edit.h:43
effect
Definition effects.h:365
universal
Definition fc_types.h:901