Freeciv-3.3: /fast/freeciv/nightly/main/client/gui-qt/diplodlg.h Source File

Freeciv-3.3

Loading...
Searching...
No Matches
diplodlg.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__DIPLODLG_H
15#define FC__DIPLODLG_H
16
17#ifdef HAVE_CONFIG_H
18#include <fc_config.h>
19#endif
20
21// Qt
22#include <QMap>
23#include <QTabWidget>
24
25extern "C" {
26#include "diplodlg_g.h"
27}
28
29// common
30#include "research.h"
31
32// client
33#include "game.h"
34#include "sprite.h"
35#include "tilespec.h"
36
37class QCloseEvent;
38class QGridLayout;
39class QIcon;
40class QLabel;
41class QPushButton;
42class QSpinBox;
43class QTableWidget;
44class QTableWidgetItem;
45
46/****************************************************************************
47 Diplomacy tab for one nation
48****************************************************************************/
49 class diplo_wdg: public QWidget
50{
51 Q_OBJECT
52 QGridLayout *layout;
53 QLabel *plr1_accept;
54 QLabel *plr2_accept;
55 QPushButton *accept_treaty;
56 QPushButton *cancel_treaty;
57 QTableWidget *text_edit;
58
59public:
60 diplo_wdg(struct Treaty *ptreaty,
61 struct player *they, struct player *initiator);
62 ~diplo_wdg();
63 void update_wdg();
64 void set_index(int ind);
65 int get_index();
66 struct Treaty *treaty;
67
68private slots:
69 void all_advances();
70 void dbl_click(QTableWidgetItem *item);
71 void give_advance(int tech);
72 void give_city(int city_num);
73 void give_embassy();
74 void give_shared_vision();
75 void gold_changed1(int val);
76 void gold_changed2(int val);
77 void pact_allianze();
78 void pact_ceasfire();
79 void pact_peace();
80 void response_accept();
81 void response_cancel();
82 void sea_map_clause();
83 void show_menu(struct player *pplayer);
84 void show_menu_p1();
85 void show_menu_p2();
86 void world_map_clause();
87 void restore_pixmap();
88
89protected:
90 void closeEvent(QCloseEvent *event);
91private:
92 struct player *plr1;
93 struct player *plr2;
94 int active_menu;
95 struct player *curr_player;
96 bool p1_accept;
97 bool p2_accept;
98 int index;
99};
100
101/****************************************************************************
102 Diplomacy dialog containing many diplo_wdg
103****************************************************************************/
104 class diplo_dlg: public QTabWidget
105{
106 Q_OBJECT
107 QMap<struct player *, diplo_wdg *> treaty_list;
108
109public:
110 diplo_dlg(struct Treaty *ptreaty, struct player *they,
111 struct player *initiator);
112 ~diplo_dlg();
113 void reactivate();
114 void update_dlg();
115 bool init(bool raise);
116 diplo_wdg *find_widget(struct player *they);
117 void close_widget(struct player *they);
118 void add_widget(struct Treaty *ptreaty, struct player *they,
119 struct player *initiator);
120 void make_active(struct player *party);
121
122private:
123 int index;
124};
125
126#endif // FC__DIPLODLG_H
close_widget
Definition mapview.h:183
diplo_dlg
Definition diplodlg.h:105
diplo_dlg::update_dlg
void update_dlg()
Definition diplodlg.cpp:895
diplo_dlg::treaty_list
QMap< struct player *, diplo_wdg * > treaty_list
Definition diplodlg.h:107
diplo_dlg::~diplo_dlg
~diplo_dlg()
Definition diplodlg.cpp:853
diplo_dlg::make_active
void make_active(struct player *party)
Definition diplodlg.cpp:820
diplo_dlg::index
int index
Definition diplodlg.h:123
diplo_dlg::reactivate
void reactivate()
Definition diplodlg.cpp:910
diplo_dlg::find_widget
diplo_wdg * find_widget(struct player *they)
Definition diplodlg.cpp:872
diplo_dlg::add_widget
void add_widget(struct Treaty *ptreaty, struct player *they, struct player *initiator)
Definition diplodlg.cpp:794
diplo_wdg
Definition diplodlg.h:50
diplo_wdg::curr_player
struct player * curr_player
Definition diplodlg.h:95
diplo_wdg::response_accept
void response_accept()
Definition diplodlg.cpp:764
diplo_wdg::pact_ceasfire
void pact_ceasfire()
Definition diplodlg.cpp:530
diplo_wdg::p2_accept
bool p2_accept
Definition diplodlg.h:97
diplo_wdg::active_menu
int active_menu
Definition diplodlg.h:94
diplo_wdg::show_menu_p1
void show_menu_p1()
Definition diplodlg.cpp:674
diplo_wdg::give_embassy
void give_embassy()
Definition diplodlg.cpp:497
diplo_wdg::plr2_accept
QLabel * plr2_accept
Definition diplodlg.h:54
diplo_wdg::gold_changed1
void gold_changed1(int val)
Definition diplodlg.cpp:300
diplo_wdg::world_map_clause
void world_map_clause()
Definition diplodlg.cpp:563
diplo_wdg::show_menu
void show_menu(struct player *pplayer)
Definition diplodlg.cpp:322
diplo_wdg::gold_changed2
void gold_changed2(int val)
Definition diplodlg.cpp:311
diplo_wdg::text_edit
QTableWidget * text_edit
Definition diplodlg.h:57
diplo_wdg::get_index
int get_index()
Definition diplodlg.cpp:690
diplo_wdg::pact_allianze
void pact_allianze()
Definition diplodlg.cpp:519
diplo_wdg::closeEvent
void closeEvent(QCloseEvent *event)
Definition diplodlg.cpp:289
diplo_wdg::all_advances
void all_advances()
Definition diplodlg.cpp:624
diplo_wdg::cancel_treaty
QPushButton * cancel_treaty
Definition diplodlg.h:56
diplo_wdg::treaty
struct Treaty * treaty
Definition diplodlg.h:66
diplo_wdg::sea_map_clause
void sea_map_clause()
Definition diplodlg.cpp:552
diplo_wdg::give_shared_vision
void give_shared_vision()
Definition diplodlg.cpp:508
diplo_wdg::give_city
void give_city(int city_num)
Definition diplodlg.cpp:574
diplo_wdg::response_cancel
void response_cancel()
Definition diplodlg.cpp:774
diplo_wdg::plr1
struct player * plr1
Definition diplodlg.h:92
diplo_wdg::~diplo_wdg
~diplo_wdg()
Definition diplodlg.cpp:260
diplo_wdg::dbl_click
void dbl_click(QTableWidgetItem *item)
Definition diplodlg.cpp:267
diplo_wdg::show_menu_p2
void show_menu_p2()
Definition diplodlg.cpp:666
diplo_wdg::update_wdg
void update_wdg()
Definition diplodlg.cpp:698
diplo_wdg::plr2
struct player * plr2
Definition diplodlg.h:93
diplo_wdg::index
int index
Definition diplodlg.h:98
diplo_wdg::restore_pixmap
void restore_pixmap()
Definition diplodlg.cpp:752
diplo_wdg::p1_accept
bool p1_accept
Definition diplodlg.h:96
diplo_wdg::accept_treaty
QPushButton * accept_treaty
Definition diplodlg.h:55
diplo_wdg::give_advance
void give_advance(int tech)
Definition diplodlg.cpp:599
diplo_wdg::layout
QGridLayout * layout
Definition diplodlg.h:52
diplo_wdg::pact_peace
void pact_peace()
Definition diplodlg.cpp:541
diplo_wdg::set_index
void set_index(int ind)
Definition diplodlg.cpp:682
diplo_wdg::plr1_accept
QLabel * plr1_accept
Definition diplodlg.h:53
incite_cost
char * incite_cost
Definition comments.c:74
diplodlg_g.h
ptreaty
struct Treaty * ptreaty
Definition diplodlg_g.h:28
they
struct Treaty struct player * they
Definition diplodlg_g.h:28
event
enum event_type event
Definition events.c:81
game.h
sprite.h
init
bool init
Definition mapimg.c:483
slots
struct player_slot * slots
Definition player.c:51
research.h
Treaty
Definition diptreaty.h:79
item
Definition climisc.h:80
player
Definition player.h:249
tilespec.h