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

Freeciv-3.1

Loading...
Searching...
No Matches
helpdlg.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__HELPDLG_H
15#define FC__HELPDLG_H
16
17// Qt
18#include <QDialog>
19#include <QHash>
20#include <QList>
21
22// common
23#include "extras.h"
24
25// client
26#include "helpdlg_g.h"
27
28// gui-qt
29#include "dialogs.h"
30
31
32// Forward declarations
33struct canvas;
34struct help_item;
35
36class QFrame;
37class QLabel;
38class QSplitter;
39class QTextBrowser;
40class QTreeWidget;
41class QTreeWidgetItem;
42class QVBoxLayout;
43
44class help_widget;
45
46 class help_dialog : public qfc_dialog
47{
48 Q_OBJECT
49 QPushButton *prev_butt;
50 QPushButton *next_butt;
51 QTreeWidget *tree_wdg;
52 help_widget *help_wdg;
53 QSplitter *splitter;
54 QList<QTreeWidgetItem *> item_history;
55 QHash<QTreeWidgetItem *, const help_item *> topics_map;
56 int history_pos;
57 void make_tree();
58public:
59 help_dialog(QWidget *parent = 0);
60 void update_fonts();
61 bool update_history;
62
63public slots:
64 void set_topic(const help_item *item);
65 void history_forward();
66 void history_back();
67
68protected:
69 void showEvent(QShowEvent *event);
70 void hideEvent(QHideEvent *event);
71 void closeEvent(QCloseEvent *event);
72
73private slots:
74 void item_changed(QTreeWidgetItem *item, QTreeWidgetItem *prev);
75private:
76 void update_buttons();
77};
78
79 class help_widget : public QWidget
80{
81 Q_OBJECT
82 QFrame *box_wdg;
83 QLabel *title_label;
84
85 QWidget *main_widget;
86 QTextBrowser *text_browser;
87 QWidget *bottom_panel;
88 QWidget *info_panel;
89 QSplitter *splitter;
90 QVBoxLayout *info_layout;
91 QList<int> splitter_sizes;
92
93 void setup_ui();
94 void set_main_widget(QWidget *main_widget);
95
96 void do_layout(bool horizontal);
97 void undo_layout();
98
99 void show_info_panel();
100 void add_info_pixmap(QPixmap *pm, bool shadow = false);
101 void add_info_label(const QString &text);
102 void add_info_progress(const QString& label, int progress,
103 int min, int max,
104 const QString& value = QString());
105 void add_extras_of_act_for_terrain(struct terrain *pterr,
106 enum unit_activity act,
107 const char *label);
108 void add_info_separator();
109 void add_info_widget(QWidget *widget);
110 void info_panel_done();
111
112 void set_bottom_panel(QWidget *widget);
113
114 QLayout *create_terrain_widget(const QString& title,
115 const struct canvas* image,
116 const QString& legend,
117 const QString& tooltip = QString());
118
119 void set_topic_other(const help_item *item, const char *title);
120
121 void set_topic_any(const help_item *item, const char *title);
122 void set_topic_text(const help_item *item, const char *title);
123 void set_topic_unit(const help_item *item, const char *title);
124 void set_topic_building(const help_item *item, const char *title);
125 void set_topic_tech(const help_item *item, const char *title);
126 void set_topic_terrain(const help_item *item, const char *title);
127 bool set_topic_extra(const help_item *item, const char *title);
128 void set_topic_specialist(const help_item *item, const char *title);
129 void set_topic_government(const help_item *item, const char *title);
130 void set_topic_nation(const help_item *item, const char *title);
131 void set_topic_goods(const help_item *item, const char *title);
132
133public:
134 help_widget(QWidget *parent = 0);
135 help_widget(const help_item *item, QWidget *parent = 0);
136 ~help_widget();
137 void update_fonts();
138private:
139 QString link_me(const char *str, help_page_type hpt);
140
141public slots:
142 void set_topic(const help_item *item);
143private slots:
144 void anchor_clicked(const QString &link);
145
146public:
147 struct terrain *terrain_max_values();
148 struct unit_type *uclass_max_values(struct unit_class *uclass);
149};
150
151void update_help_fonts();
152
153#endif /* FC__HELPDLG_H */
str
#define str
Definition astring.c:76
help_dialog
Definition helpdlg.h:47
help_dialog::tree_wdg
QTreeWidget * tree_wdg
Definition helpdlg.h:51
help_dialog::hideEvent
void hideEvent(QHideEvent *event)
Definition helpdlg.cpp:195
help_dialog::history_pos
int history_pos
Definition helpdlg.h:56
help_dialog::update_history
bool update_history
Definition helpdlg.h:61
help_dialog::prev_butt
QPushButton * prev_butt
Definition helpdlg.h:49
help_dialog::history_forward
void history_forward()
Definition helpdlg.cpp:363
help_dialog::next_butt
QPushButton * next_butt
Definition helpdlg.h:50
help_dialog::set_topic
void set_topic(const help_item *item)
Definition helpdlg.cpp:346
help_dialog::help_wdg
help_widget * help_wdg
Definition helpdlg.h:52
help_dialog::make_tree
void make_tree()
Definition helpdlg.cpp:232
help_dialog::showEvent
void showEvent(QShowEvent *event)
Definition helpdlg.cpp:204
help_dialog::topics_map
QHash< QTreeWidgetItem *, const help_item * > topics_map
Definition helpdlg.h:55
help_dialog::item_changed
void item_changed(QTreeWidgetItem *item, QTreeWidgetItem *prev)
Definition helpdlg.cpp:414
help_dialog::update_fonts
void update_fonts()
Definition helpdlg.cpp:187
help_dialog::splitter
QSplitter * splitter
Definition helpdlg.h:53
help_dialog::closeEvent
void closeEvent(QCloseEvent *event)
Definition helpdlg.cpp:223
help_dialog::update_buttons
void update_buttons()
Definition helpdlg.cpp:397
help_dialog::item_history
QList< QTreeWidgetItem * > item_history
Definition helpdlg.h:54
help_dialog::history_back
void history_back()
Definition helpdlg.cpp:380
help_widget
Definition helpdlg.h:80
help_widget::add_info_separator
void add_info_separator()
Definition helpdlg.cpp:752
help_widget::link_me
QString link_me(const char *str, help_page_type hpt)
Definition helpdlg.cpp:741
help_widget::show_info_panel
void show_info_panel()
Definition helpdlg.cpp:617
help_widget::add_info_widget
void add_info_widget(QWidget *widget)
help_widget::update_fonts
void update_fonts()
Definition helpdlg.cpp:564
help_widget::set_topic_specialist
void set_topic_specialist(const help_item *item, const char *title)
Definition helpdlg.cpp:1508
help_widget::info_panel_done
void info_panel_done()
Definition helpdlg.cpp:760
help_widget::add_info_progress
void add_info_progress(const QString &label, int progress, int min, int max, const QString &value=QString())
Definition helpdlg.cpp:664
help_widget::splitter
QSplitter * splitter
Definition helpdlg.h:89
help_widget::anchor_clicked
void anchor_clicked(const QString &link)
Definition helpdlg.cpp:769
help_widget::set_bottom_panel
void set_bottom_panel(QWidget *widget)
Definition helpdlg.cpp:853
help_widget::~help_widget
~help_widget()
Definition helpdlg.cpp:458
help_widget::main_widget
QWidget * main_widget
Definition helpdlg.h:85
help_widget::setup_ui
void setup_ui()
Definition helpdlg.cpp:465
help_widget::add_info_pixmap
void add_info_pixmap(QPixmap *pm, bool shadow=false)
Definition helpdlg.cpp:626
help_widget::add_info_label
void add_info_label(const QString &text)
Definition helpdlg.cpp:647
help_widget::info_layout
QVBoxLayout * info_layout
Definition helpdlg.h:90
help_widget::set_topic_tech
void set_topic_tech(const help_item *item, const char *title)
Definition helpdlg.cpp:1090
help_widget::add_extras_of_act_for_terrain
void add_extras_of_act_for_terrain(struct terrain *pterr, enum unit_activity act, const char *label)
Definition helpdlg.cpp:703
help_widget::box_wdg
QFrame * box_wdg
Definition helpdlg.h:82
help_widget::set_topic_other
void set_topic_other(const help_item *item, const char *title)
Definition helpdlg.cpp:860
help_widget::set_topic
void set_topic(const help_item *item)
Definition helpdlg.cpp:794
help_widget::set_topic_extra
bool set_topic_extra(const help_item *item, const char *title)
Definition helpdlg.cpp:1468
help_widget::set_topic_nation
void set_topic_nation(const help_item *item, const char *title)
Definition helpdlg.cpp:1542
help_widget::create_terrain_widget
QLayout * create_terrain_widget(const QString &title, const struct canvas *image, const QString &legend, const QString &tooltip=QString())
Definition helpdlg.cpp:1245
help_widget::undo_layout
void undo_layout()
Definition helpdlg.cpp:594
help_widget::splitter_sizes
QList< int > splitter_sizes
Definition helpdlg.h:91
help_widget::uclass_max_values
struct unit_type * uclass_max_values(struct unit_class *uclass)
Definition helpdlg.cpp:1654
help_widget::text_browser
QTextBrowser * text_browser
Definition helpdlg.h:86
help_widget::set_topic_terrain
void set_topic_terrain(const help_item *item, const char *title)
Definition helpdlg.cpp:1286
help_widget::do_layout
void do_layout(bool horizontal)
Definition helpdlg.cpp:516
help_widget::set_topic_goods
void set_topic_goods(const help_item *item, const char *title)
Definition helpdlg.cpp:1558
help_widget::set_topic_any
void set_topic_any(const help_item *item, const char *title)
help_widget::info_panel
QWidget * info_panel
Definition helpdlg.h:88
help_widget::set_topic_building
void set_topic_building(const help_item *item, const char *title)
Definition helpdlg.cpp:998
help_widget::set_topic_government
void set_topic_government(const help_item *item, const char *title)
Definition helpdlg.cpp:1525
help_widget::set_topic_unit
void set_topic_unit(const help_item *item, const char *title)
Definition helpdlg.cpp:873
help_widget::bottom_panel
QWidget * bottom_panel
Definition helpdlg.h:87
help_widget::title_label
QLabel * title_label
Definition helpdlg.h:83
help_widget::terrain_max_values
struct terrain * terrain_max_values()
Definition helpdlg.cpp:1582
help_widget::set_topic_text
void set_topic_text(const help_item *item, const char *title)
help_widget::set_main_widget
void set_main_widget(QWidget *main_widget)
qfc_dialog
Definition dialogs.h:74
event
enum event_type event
Definition events.c:81
extras.h
tooltip
const char * tooltip
Definition repodlgs.c:1314
title
const char * title
Definition repodlgs.c:1313
update_help_fonts
void update_help_fonts()
Definition helpdlg.cpp:113
dialogs.h
helpdlg_g.h
help_page_type
help_page_type
Definition helpdlg_g.h:20
slots
struct player_slot * slots
Definition player.c:50
canvas
Definition canvas.h:21
help_item
Definition helpdata.h:25
item
Definition climisc.h:80
terrain
Definition terrain.h:176
unit_class
Definition unittype.h:136
unit_type
Definition unittype.h:481
widget
Definition widget.h:112