Freeciv-3.3
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
46class help_dialog : public qfc_dialog
47{
49 QPushButton *prev_butt;
50 QPushButton *next_butt;
57 void make_tree();
58public:
59 help_dialog(QWidget *parent = 0);
60 void update_fonts();
62
63public slots:
64 void set_topic(const help_item *item);
65 void history_forward();
66 void history_back();
67
68protected:
72
73private slots:
75private:
76 void update_buttons();
77};
78
79class help_widget : public QWidget
80{
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;
92
93 void setup_ui();
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());
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
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
#define str
Definition astring.c:76
QTreeWidget * tree_wdg
Definition helpdlg.h:51
void hideEvent(QHideEvent *event)
Definition helpdlg.cpp:195
int history_pos
Definition helpdlg.h:56
bool update_history
Definition helpdlg.h:61
QPushButton * prev_butt
Definition helpdlg.h:49
void history_forward()
Definition helpdlg.cpp:365
QPushButton * next_butt
Definition helpdlg.h:50
void set_topic(const help_item *item)
Definition helpdlg.cpp:348
help_widget * help_wdg
Definition helpdlg.h:52
void make_tree()
Definition helpdlg.cpp:232
void showEvent(QShowEvent *event)
Definition helpdlg.cpp:204
QHash< QTreeWidgetItem *, const help_item * > topics_map
Definition helpdlg.h:55
void item_changed(QTreeWidgetItem *item, QTreeWidgetItem *prev)
Definition helpdlg.cpp:416
void update_fonts()
Definition helpdlg.cpp:187
QSplitter * splitter
Definition helpdlg.h:53
void closeEvent(QCloseEvent *event)
Definition helpdlg.cpp:223
void update_buttons()
Definition helpdlg.cpp:399
QList< QTreeWidgetItem * > item_history
Definition helpdlg.h:54
void history_back()
Definition helpdlg.cpp:382
void add_info_separator()
Definition helpdlg.cpp:754
QString link_me(const char *str, help_page_type hpt)
Definition helpdlg.cpp:743
void show_info_panel()
Definition helpdlg.cpp:619
void add_info_widget(QWidget *widget)
void update_fonts()
Definition helpdlg.cpp:566
void set_topic_specialist(const help_item *item, const char *title)
Definition helpdlg.cpp:1514
void info_panel_done()
Definition helpdlg.cpp:762
void add_info_progress(const QString &label, int progress, int min, int max, const QString &value=QString())
Definition helpdlg.cpp:666
QSplitter * splitter
Definition helpdlg.h:89
void anchor_clicked(const QString &link)
Definition helpdlg.cpp:771
void set_bottom_panel(QWidget *widget)
Definition helpdlg.cpp:857
QWidget * main_widget
Definition helpdlg.h:85
void setup_ui()
Definition helpdlg.cpp:467
void add_info_pixmap(QPixmap *pm, bool shadow=false)
Definition helpdlg.cpp:628
void add_info_label(const QString &text)
Definition helpdlg.cpp:649
QVBoxLayout * info_layout
Definition helpdlg.h:90
void set_topic_tech(const help_item *item, const char *title)
Definition helpdlg.cpp:1094
void add_extras_of_act_for_terrain(struct terrain *pterr, enum unit_activity act, const char *label)
Definition helpdlg.cpp:705
QFrame * box_wdg
Definition helpdlg.h:82
void set_topic_other(const help_item *item, const char *title)
Definition helpdlg.cpp:864
void set_topic(const help_item *item)
Definition helpdlg.cpp:796
bool set_topic_extra(const help_item *item, const char *title)
Definition helpdlg.cpp:1474
void set_topic_nation(const help_item *item, const char *title)
Definition helpdlg.cpp:1548
QLayout * create_terrain_widget(const QString &title, const struct canvas *image, const QString &legend, const QString &tooltip=QString())
Definition helpdlg.cpp:1248
void undo_layout()
Definition helpdlg.cpp:596
QList< int > splitter_sizes
Definition helpdlg.h:91
struct unit_type * uclass_max_values(struct unit_class *uclass)
Definition helpdlg.cpp:1657
QTextBrowser * text_browser
Definition helpdlg.h:86
void set_topic_terrain(const help_item *item, const char *title)
Definition helpdlg.cpp:1289
void do_layout(bool horizontal)
Definition helpdlg.cpp:518
void set_topic_goods(const help_item *item, const char *title)
Definition helpdlg.cpp:1564
void set_topic_any(const help_item *item, const char *title)
QWidget * info_panel
Definition helpdlg.h:88
void set_topic_building(const help_item *item, const char *title)
Definition helpdlg.cpp:1002
void set_topic_government(const help_item *item, const char *title)
Definition helpdlg.cpp:1531
void set_topic_unit(const help_item *item, const char *title)
Definition helpdlg.cpp:877
QWidget * bottom_panel
Definition helpdlg.h:87
QLabel * title_label
Definition helpdlg.h:83
struct terrain * terrain_max_values()
Definition helpdlg.cpp:1588
void set_topic_text(const help_item *item, const char *title)
void set_main_widget(QWidget *main_widget)
char * incite_cost
Definition comments.c:76
enum event_type event
Definition events.c:81
const char * tooltip
Definition repodlgs.c:1315
const char * title
Definition repodlgs.c:1314
void update_help_fonts()
Definition helpdlg.cpp:113
help_page_type
Definition helpdlg_g.h:20
struct player_slot * slots
Definition player.c:51
Definition climisc.h:82