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

Freeciv-3.1

Loading...
Searching...
No Matches
messagewin.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__MESSAGEWIN_H
15#define FC__MESSAGEWIN_H
16
17#ifdef HAVE_CONFIG_H
18#include <fc_config.h>
19#endif
20
21extern "C" {
22#include "messagewin_g.h"
23}
24
25//Qt
26#include <QWidget>
27
28//qt-client
29#include "chatline.h"
30#include "mapview.h"
31
32class QEvent;
33class QGridLayout;
34class QItemSelection;
35class QMouseEvent;
36class QPixmap;
37class QTableWidget;
38
39/***************************************************************************
40 Class representing message output
41***************************************************************************/
42 class messagewdg : public QWidget
43{
44 Q_OBJECT
45public:
46 messagewdg(QWidget *parent);
47 void msg_update();
48 void clr();
49 void msg(const struct message *pmsg);
50private:
51 QTableWidget *mesg_table;
52 QGridLayout *layout;
53 QPixmap *pix;
54protected:
55#ifndef FC_QT5_MODE
56 void enterEvent(QEnterEvent *event);
57#else // FC_QT5_MODE
58 void enterEvent(QEvent *event);
59#endif // FC_QT5_MODE
60 void leaveEvent(QEvent *event);
61 void paint(QPainter *painter, QPaintEvent *event);
62 void paintEvent(QPaintEvent *event);
63 void resizeEvent(QResizeEvent *event);
64public slots:
65 void item_selected(const QItemSelection &sl, const QItemSelection &ds);
66};
67
68/***************************************************************************
69 Class which manages chat and messages
70***************************************************************************/
71 class info_tab : public fcwidget
72{
73 Q_OBJECT
74public:
75 info_tab(QWidget *parent);
76 void max_chat_size();
77 QGridLayout *layout;
78 messagewdg *msgwdg;
79 chatwdg *chtwdg;
80 void maximize_chat();
81 void restore_chat();
82 bool chat_maximized;
83private:
84 void update_menu();
85 QPoint cursor;
86 QSize last_size;
87 move_widget *mw;
88 bool hidden_state;
89 bool resize_mode;
90 bool resxy;
91 bool resx;
92 bool resy;
93protected:
94 void mousePressEvent(QMouseEvent *event);
95 void mouseMoveEvent(QMouseEvent *event);
96 void mouseReleaseEvent(QMouseEvent *event);
97 int& e_pos();
98};
99
100#endif /* FC__MESSAGEWIN_H */
chatwdg
Definition chatline.h:115
fcwidget
Definition mapview.h:172
info_tab
Definition messagewin.h:72
info_tab::resize_mode
bool resize_mode
Definition messagewin.h:89
info_tab::mouseReleaseEvent
void mouseReleaseEvent(QMouseEvent *event)
Definition messagewin.cpp:118
info_tab::max_chat_size
void max_chat_size()
info_tab::msgwdg
messagewdg * msgwdg
Definition messagewin.h:78
info_tab::e_pos
int & e_pos()
info_tab::layout
QGridLayout * layout
Definition messagewin.h:77
info_tab::update_menu
void update_menu()
Definition messagewin.cpp:196
info_tab::resxy
bool resxy
Definition messagewin.h:90
info_tab::cursor
QPoint cursor
Definition messagewin.h:85
info_tab::resx
bool resx
Definition messagewin.h:91
info_tab::chat_maximized
bool chat_maximized
Definition messagewin.h:82
info_tab::resy
bool resy
Definition messagewin.h:92
info_tab::mw
move_widget * mw
Definition messagewin.h:87
info_tab::restore_chat
void restore_chat()
Definition messagewin.cpp:64
info_tab::mousePressEvent
void mousePressEvent(QMouseEvent *event)
Definition messagewin.cpp:86
info_tab::hidden_state
bool hidden_state
Definition messagewin.h:88
info_tab::last_size
QSize last_size
Definition messagewin.h:86
info_tab::chtwdg
chatwdg * chtwdg
Definition messagewin.h:79
info_tab::mouseMoveEvent
void mouseMoveEvent(QMouseEvent *event)
Definition messagewin.cpp:146
info_tab::maximize_chat
void maximize_chat()
Definition messagewin.cpp:75
messagewdg
Definition messagewin.h:43
messagewdg::paintEvent
void paintEvent(QPaintEvent *event)
Definition messagewin.cpp:309
messagewdg::msg_update
void msg_update()
Definition messagewin.cpp:359
messagewdg::leaveEvent
void leaveEvent(QEvent *event)
Definition messagewin.cpp:292
messagewdg::layout
QGridLayout * layout
Definition messagewin.h:52
messagewdg::resizeEvent
void resizeEvent(QResizeEvent *event)
Definition messagewin.cpp:368
messagewdg::mesg_table
QTableWidget * mesg_table
Definition messagewin.h:51
messagewdg::item_selected
void item_selected(const QItemSelection &sl, const QItemSelection &ds)
Definition messagewin.cpp:237
messagewdg::enterEvent
void enterEvent(QEnterEvent *event)
Definition messagewin.cpp:281
messagewdg::paint
void paint(QPainter *painter, QPaintEvent *event)
Definition messagewin.cpp:300
messagewdg::clr
void clr()
Definition messagewin.cpp:321
messagewdg::msg
void msg(const struct message *pmsg)
Definition messagewin.cpp:330
messagewdg::pix
QPixmap * pix
Definition messagewin.h:53
move_widget
Definition mapview.h:154
event
enum event_type event
Definition events.c:81
chatline.h
mapview.h
messagewin_g.h
slots
struct player_slot * slots
Definition player.c:50
message
Definition messagewin_common.h:29