Freeciv-3.2: chatwdg Class Reference

Freeciv-3.2

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_input * | chat_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 (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_dblclck * | chat_output
QPushButton * | remove_links
QCheckBox * | cb

## 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 366 of file chatline.cpp.

Referenced by chatwdg().

## ◆ append()

void chatwdg::append | ( | const QString & | str | ) |

Adds news string to chatwdg

Definition at line 430 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 419 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 501 of file chatline.cpp.

Referenced by info_tab::restore_chat().

## ◆ eventFilter()

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

protected

Processess history for chat

Definition at line 463 of file chatline.cpp.

## ◆ make_link()

void chatwdg::make_link | ( | struct tile * | ptile | ) |

Makes link to tile/unit or city

Definition at line 535 of file chatline.cpp.

## ◆ paint()

void chatwdg::paint | ( | QPainter * | painter,
|  | QPaintEvent * | event
| ) |  |

protected

Draws semi-transparent background

Definition at line 442 of file chatline.cpp.

Referenced by paintEvent().

## ◆ paintEvent()

void chatwdg::paintEvent | ( | QPaintEvent * | event | ) |

protected

Paint event for chatwdg

Definition at line 451 of file chatline.cpp.

## ◆ rm_links

void chatwdg::rm_links | ( |  | ) |

privateslot

User clicked clear links button

Definition at line 358 of file chatline.cpp.

Referenced by chatwdg().

## ◆ scroll_to_bottom()

void chatwdg::scroll_to_bottom | ( |  | ) |

Scrolls chat to bottom

Definition at line 338 of file chatline.cpp.

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

## ◆ state_changed

void chatwdg::state_changed | ( | int | state | ) |

privateslot

Manages "To allies" chat button state

Definition at line 312 of file chatline.cpp.

Referenced by chatwdg().

## ◆ toggle_size

void chatwdg::toggle_size | ( |  | ) |

privateslot

Toggle chat size

Definition at line 324 of file chatline.cpp.

Referenced by chatwdg().

## ◆ update_font()

void chatwdg::update_font | ( |  | ) |

Updates font for chatwdg

Definition at line 348 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 486 of file chatline.cpp.

Referenced by fc_client::switch_page().

## Field Documentation

## ◆ cb

QCheckBox* chatwdg::cb

private

Definition at line 142 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

Definition at line 140 of file chatline.h.

Referenced by append(), chat_message_received(), chatwdg(), default_size(), scroll_to_bottom(), and update_font().

## ◆ remove_links

QPushButton* chatwdg::remove_links

private

Definition at line 141 of file chatline.h.

Referenced by chatwdg(), and update_widgets().