Freeciv-3.1: /fast/freeciv/nightly/S3_1/tools/ruledit/effect_edit.h Source File

Freeciv-3.1

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 QSpinBox;
30
31class ruledit_gui;
32
33 enum effect_filter_main_class { EFMC_NORMAL,
34 EFMC_NONE, /* No requirements */
35 EFMC_ALL /* Any requirements */
36};
37
38 struct effect_list_fill_data
39{
40 struct universal *filter;
41 enum effect_filter_main_class efmc;
42 class effect_edit *edit;
43 int num;
44};
45
46 class effect_edit : public QDialog
47{
48 Q_OBJECT
49
50 public:
51 explicit effect_edit(ruledit_gui *ui_in, QString target,
52 struct universal *filter_in, enum effect_filter_main_class efmc_in);
53 ~effect_edit();
54 void refresh();
55 void add(const char *msg);
56 void add_effect_to_list(struct effect *peffect,
57 struct effect_list_fill_data *fill_data);
58
59 struct universal *filter_get();
60
61 enum effect_filter_main_class efmc;
62
63 private:
64 ruledit_gui *ui;
65
66 QString name;
67 QListWidget *list_widget;
68 struct universal filter;
69 struct effect_list *effects;
70
71 struct effect *selected;
72 int selected_nbr;
73
74 QToolButton *edit_type_button;
75 QSpinBox *value_box;
76
77 QToolButton *mp_button;
78
79 private slots:
80 void select_effect();
81 void fill_active();
82 void edit_reqs();
83 void add_now();
84 void delete_now();
85 void close_now();
86
87 void effect_type_menu(QAction *action);
88 void set_value(int value);
89 void multiplier_menu(QAction *action);
90
91 protected:
92 void closeEvent(QCloseEvent *event);
93};
94
95#endif // FC__EFFECT_EDIT_H
effect_edit
Definition effect_edit.h:47
effect_edit::effects
struct effect_list * effects
Definition effect_edit.h:69
effect_edit::multiplier_menu
void multiplier_menu(QAction *action)
Definition effect_edit.cpp:354
effect_edit::edit_type_button
QToolButton * edit_type_button
Definition effect_edit.h:74
effect_edit::close_now
void close_now()
Definition effect_edit.cpp:222
effect_edit::name
QString name
Definition effect_edit.h:66
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:194
effect_edit::fill_active
void fill_active()
Definition effect_edit.cpp:250
effect_edit::edit_reqs
void edit_reqs()
Definition effect_edit.cpp:296
effect_edit::~effect_edit
~effect_edit()
Definition effect_edit.cpp:142
effect_edit::efmc
enum effect_filter_main_class efmc
Definition effect_edit.h:61
effect_edit::add
void add(const char *msg)
effect_edit::set_value
void set_value(int value)
Definition effect_edit.cpp:284
effect_edit::mp_button
QToolButton * mp_button
Definition effect_edit.h:77
effect_edit::delete_now
void delete_now()
Definition effect_edit.cpp:340
effect_edit::selected_nbr
int selected_nbr
Definition effect_edit.h:72
effect_edit::closeEvent
void closeEvent(QCloseEvent *event)
Definition effect_edit.cpp:313
effect_edit::filter
struct universal filter
Definition effect_edit.h:68
effect_edit::list_widget
QListWidget * list_widget
Definition effect_edit.h:67
effect_edit::filter_get
struct universal * filter_get()
Definition effect_edit.cpp:214
effect_edit::value_box
QSpinBox * value_box
Definition effect_edit.h:75
effect_edit::refresh
void refresh()
Definition effect_edit.cpp:175
effect_edit::ui
ruledit_gui * ui
Definition effect_edit.h:64
effect_edit::effect_type_menu
void effect_type_menu(QAction *action)
Definition effect_edit.cpp:268
effect_edit::add_now
void add_now()
Definition effect_edit.cpp:321
effect_edit::selected
struct effect * selected
Definition effect_edit.h:71
effect_edit::select_effect
void select_effect()
Definition effect_edit.cpp:231
ruledit_gui
Definition ruledit_qt.h:96
effect_filter_main_class
effect_filter_main_class
Definition effect_edit.h:33
EFMC_ALL
@ EFMC_ALL
Definition effect_edit.h:35
EFMC_NORMAL
@ EFMC_NORMAL
Definition effect_edit.h:33
EFMC_NONE
@ EFMC_NONE
Definition effect_edit.h:34
event
enum event_type event
Definition events.c:81
slots
struct player_slot * slots
Definition player.c:50
requirements.h
action
Definition actions.h:379
effect_list_fill_data
Definition effect_edit.h:39
effect_list_fill_data::num
int num
Definition effect_edit.h:43
effect_list_fill_data::filter
struct universal * filter
Definition effect_edit.h:40
effect_list_fill_data::efmc
enum effect_filter_main_class efmc
Definition effect_edit.h:41
effect_list_fill_data::edit
class effect_edit * edit
Definition effect_edit.h:42
effect
Definition effects.h:340
universal
Definition fc_types.h:756