Freeciv-3.1: /fast/freeciv/nightly/S3_1/client/gui-qt/diplodlg.h Source File

Freeciv-3.1

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(int id, int id2);
61 ~diplo_wdg();
62 void update_wdg();
63 void set_index(int ind);
64 int get_index();
65 struct Treaty treaty;
66
67private slots:
68 void all_advances();
69 void dbl_click(QTableWidgetItem *item);
70 void give_advance(int tech);
71 void give_city(int city_num);
72 void give_embassy();
73 void give_shared_vision();
74 void gold_changed1(int val);
75 void gold_changed2(int val);
76 void pact_allianze();
77 void pact_ceasfire();
78 void pact_peace();
79 void response_accept();
80 void response_cancel();
81 void sea_map_clause();
82 void show_menu(int player);
83 void show_menu_p1();
84 void show_menu_p2();
85 void world_map_clause();
86 void restore_pixmap();
87
88protected:
89 void closeEvent(QCloseEvent *event);
90private:
91 int player1;
92 int player2;
93 int active_menu;
94 int curr_player;
95 bool p1_accept;
96 bool p2_accept;
97 int index;
98};
99
100/****************************************************************************
101 Diplomacy dialog containing many diplo_wdg
102****************************************************************************/
103 class diplo_dlg: public QTabWidget
104{
105 Q_OBJECT
106 QMap<int, diplo_wdg *> treaty_list;
107
108public:
109 diplo_dlg(int counterpart, int initiated_from);
110 ~diplo_dlg();
111 void reactivate();
112 void update_dlg();
113 bool init(bool raise);
114 diplo_wdg *find_widget(int counterpart);
115 void close_widget(int counterpart);
116 void add_widget(int counterpart, int initiated_from);
117 void make_active(int party);
118
119private:
120 int index;
121};
122
123#endif /* FC__DIPLODLG_H */
close_widget
Definition mapview.h:183
diplo_dlg
Definition diplodlg.h:104
diplo_dlg::treaty_list
QMap< int, diplo_wdg * > treaty_list
Definition diplodlg.h:106
diplo_dlg::make_active
void make_active(int party)
Definition diplodlg.cpp:804
diplo_dlg::update_dlg
void update_dlg()
Definition diplodlg.cpp:879
diplo_dlg::add_widget
void add_widget(int counterpart, int initiated_from)
Definition diplodlg.cpp:778
diplo_dlg::find_widget
diplo_wdg * find_widget(int counterpart)
Definition diplodlg.cpp:856
diplo_dlg::~diplo_dlg
~diplo_dlg()
Definition diplodlg.cpp:837
diplo_dlg::index
int index
Definition diplodlg.h:120
diplo_dlg::reactivate
void reactivate()
Definition diplodlg.cpp:894
diplo_wdg
Definition diplodlg.h:50
diplo_wdg::response_accept
void response_accept()
Definition diplodlg.cpp:749
diplo_wdg::pact_ceasfire
void pact_ceasfire()
Definition diplodlg.cpp:518
diplo_wdg::p2_accept
bool p2_accept
Definition diplodlg.h:96
diplo_wdg::active_menu
int active_menu
Definition diplodlg.h:93
diplo_wdg::show_menu_p1
void show_menu_p1()
Definition diplodlg.cpp:660
diplo_wdg::give_embassy
void give_embassy()
Definition diplodlg.cpp:488
diplo_wdg::plr2_accept
QLabel * plr2_accept
Definition diplodlg.h:54
diplo_wdg::show_menu
void show_menu(int player)
Definition diplodlg.cpp:314
diplo_wdg::gold_changed1
void gold_changed1(int val)
Definition diplodlg.cpp:294
diplo_wdg::world_map_clause
void world_map_clause()
Definition diplodlg.cpp:548
diplo_wdg::gold_changed2
void gold_changed2(int val)
Definition diplodlg.cpp:304
diplo_wdg::text_edit
QTableWidget * text_edit
Definition diplodlg.h:57
diplo_wdg::get_index
int get_index()
Definition diplodlg.cpp:676
diplo_wdg::pact_allianze
void pact_allianze()
Definition diplodlg.cpp:508
diplo_wdg::closeEvent
void closeEvent(QCloseEvent *event)
Definition diplodlg.cpp:283
diplo_wdg::player1
int player1
Definition diplodlg.h:91
diplo_wdg::all_advances
void all_advances()
Definition diplodlg.cpp:606
diplo_wdg::cancel_treaty
QPushButton * cancel_treaty
Definition diplodlg.h:56
diplo_wdg::sea_map_clause
void sea_map_clause()
Definition diplodlg.cpp:538
diplo_wdg::give_shared_vision
void give_shared_vision()
Definition diplodlg.cpp:498
diplo_wdg::give_city
void give_city(int city_num)
Definition diplodlg.cpp:558
diplo_wdg::response_cancel
void response_cancel()
Definition diplodlg.cpp:759
diplo_wdg::~diplo_wdg
~diplo_wdg()
Definition diplodlg.cpp:254
diplo_wdg::dbl_click
void dbl_click(QTableWidgetItem *item)
Definition diplodlg.cpp:261
diplo_wdg::show_menu_p2
void show_menu_p2()
Definition diplodlg.cpp:652
diplo_wdg::update_wdg
void update_wdg()
Definition diplodlg.cpp:684
diplo_wdg::curr_player
int curr_player
Definition diplodlg.h:94
diplo_wdg::index
int index
Definition diplodlg.h:97
diplo_wdg::restore_pixmap
void restore_pixmap()
Definition diplodlg.cpp:737
diplo_wdg::p1_accept
bool p1_accept
Definition diplodlg.h:95
diplo_wdg::accept_treaty
QPushButton * accept_treaty
Definition diplodlg.h:55
diplo_wdg::player2
int player2
Definition diplodlg.h:92
diplo_wdg::give_advance
void give_advance(int tech)
Definition diplodlg.cpp:582
diplo_wdg::layout
QGridLayout * layout
Definition diplodlg.h:52
diplo_wdg::pact_peace
void pact_peace()
Definition diplodlg.cpp:528
diplo_wdg::set_index
void set_index(int ind)
Definition diplodlg.cpp:668
diplo_wdg::treaty
struct Treaty treaty
Definition diplodlg.h:65
diplo_wdg::plr1_accept
QLabel * plr1_accept
Definition diplodlg.h:53
diplodlg_g.h
counterpart
int counterpart
Definition diplodlg_g.h:25
event
enum event_type event
Definition events.c:81
game.h
sprite.h
init
bool init
Definition mapimg.c:482
slots
struct player_slot * slots
Definition player.c:50
research.h
Treaty
Definition diptreaty.h:76
item
Definition climisc.h:80
player
Definition player.h:249
tilespec.h