Freeciv-3.3
Loading...
Searching...
No Matches
Public Member Functions | Data Fields | Protected Member Functions | Private Slots | Private Member Functions | Private Attributes
chatwdg Class Reference

#include <chatline.h>

+ Inheritance diagram for chatwdg:

Public Member Functions

 chatwdg (QWidget *parent)
 
void append (const QString &str)
 
void make_link (struct tile *ptile)
 
void update_widgets ()
 
int default_size (int lines)
 
void scroll_to_bottom ()
 
void update_font ()
 

Data Fields

chat_inputchat_line
 

Protected Member Functions

void paint (QPainter *painter, QPaintEvent *event)
 
void paintEvent (QPaintEvent *event)
 
bool eventFilter (QObject *obj, QEvent *event)
 

Private Slots

void state_changed (Qt::CheckState state)
 
void state_changed_depr (int state)
 
void rm_links ()
 
void anchor_clicked (const QUrl &link)
 
void toggle_size ()
 

Private Member Functions

void chat_message_received (const QString &message, const struct text_tag_list *tags)
 
- Private Member Functions inherited from chat_listener
 chat_listener ()
 
virtual void chat_word_list_changed (const QStringList &cmplt_word_list)
 
void send_chat_message (const QString &message)
 
int position_in_history ()
 
QString back_in_history ()
 
QString forward_in_history ()
 
void reset_history_position ()
 
QStringList current_word_list ()
 
- Private Member Functions inherited from listener< chat_listener >
 listener ()
 
virtual ~listener ()
 
void listen ()
 

Private Attributes

text_browser_dblclckchat_output
 
QPushButton * remove_links
 
QCheckBoxcb
 

Additional Inherited Members

- Private Types inherited from listener< chat_listener >
typedef chat_listener type_t
 
- Static Private Member Functions inherited from chat_listener
static void update_word_list ()
 
- Static Private Member Functions inherited from listener< chat_listener >
static void invoke (_member_fct_ function)
 
static void invoke (_member_fct_ function, _arg1_t_ arg)
 
static void invoke (_member_fct_ function, _arg1_t_ arg1, _arg2_t_ arg2)
 
- Static Private Attributes inherited from chat_listener
static const int HISTORY_END = -1
 

Detailed Description

Definition at line 115 of file chatline.h.

Constructor & Destructor Documentation

◆ chatwdg()

chatwdg::chatwdg ( QWidget *  parent)

Constructor for chatwdg

Definition at line 268 of file chatline.cpp.

Member Function Documentation

◆ anchor_clicked

void chatwdg::anchor_clicked ( const QUrl link)
privateslot

User clicked some custom link

Definition at line 383 of file chatline.cpp.

Referenced by chatwdg().

◆ append()

void chatwdg::append ( const QString str)

Adds news string to chatwdg

Definition at line 447 of file chatline.cpp.

Referenced by chat_message_received().

◆ chat_message_received()

void chatwdg::chat_message_received ( const QString message,
const struct text_tag_list tags 
)
privatevirtual

Adds news string to chatwdg (from chat_listener interface)

Reimplemented from chat_listener.

Definition at line 436 of file chatline.cpp.

◆ default_size()

int chatwdg::default_size ( int  lines)

Returns how much space chatline of given number of lines would require, or zero if it can't be determined.

Definition at line 518 of file chatline.cpp.

Referenced by info_tab::restore_chat().

◆ eventFilter()

bool chatwdg::eventFilter ( QObject *  obj,
QEvent *  event 
)
protected

Processes history for chat

Definition at line 480 of file chatline.cpp.

◆ make_link()

void chatwdg::make_link ( struct tile ptile)

Makes link to tile/unit or city

Definition at line 552 of file chatline.cpp.

◆ paint()

void chatwdg::paint ( QPainter painter,
QPaintEvent event 
)
protected

Draws semi-transparent background

Definition at line 459 of file chatline.cpp.

Referenced by paintEvent().

◆ paintEvent()

void chatwdg::paintEvent ( QPaintEvent event)
protected

Paint event for chatwdg

Definition at line 468 of file chatline.cpp.

◆ rm_links

void chatwdg::rm_links ( )
privateslot

User clicked clear links button

Definition at line 375 of file chatline.cpp.

Referenced by chatwdg().

◆ scroll_to_bottom()

void chatwdg::scroll_to_bottom ( )

Scrolls chat to bottom

Definition at line 355 of file chatline.cpp.

Referenced by info_tab::maximize_chat(), and info_tab::restore_chat().

◆ state_changed

void chatwdg::state_changed ( Qt::CheckState  state)
privateslot

Manages "To allies" chat button state.

Definition at line 316 of file chatline.cpp.

Referenced by chatwdg().

◆ state_changed_depr

void chatwdg::state_changed_depr ( int  state)
privateslot

Manages "To allies" chat button state. This deprecated slot is used in Qt < 6.7

Definition at line 329 of file chatline.cpp.

Referenced by chatwdg().

◆ toggle_size

void chatwdg::toggle_size ( )
privateslot

Toggle chat size

Definition at line 341 of file chatline.cpp.

Referenced by chatwdg().

◆ update_font()

void chatwdg::update_font ( )

Updates font for chatwdg

Definition at line 365 of file chatline.cpp.

Referenced by apply_font().

◆ update_widgets()

void chatwdg::update_widgets ( )

Hides allies and links button for local game

Definition at line 503 of file chatline.cpp.

Referenced by fc_client::switch_page().

Field Documentation

◆ cb

QCheckBox* chatwdg::cb
private

Definition at line 143 of file chatline.h.

Referenced by chatwdg(), and update_widgets().

◆ chat_line

chat_input* chatwdg::chat_line

Definition at line 121 of file chatline.h.

Referenced by chatwdg(), default_size(), eventFilter(), make_link(), and toggle_size().

◆ chat_output

text_browser_dblclck* chatwdg::chat_output
private

◆ remove_links

QPushButton* chatwdg::remove_links
private

Definition at line 142 of file chatline.h.

Referenced by chatwdg(), and update_widgets().