qTox  Version: nightly | Commit: bc751c8e1cac455f9690654fcfe0f560d2d7dfdd
Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
GenericChatForm Class Referenceabstract

Parent class for all chatforms. It's provide the minimum required UI elements and methods to work with chat messages. More...

#include <genericchatform.h>

Inheritance diagram for GenericChatForm:
Inheritance graph
Collaboration diagram for GenericChatForm:
Collaboration graph

Public Slots

void focusInput ()
 
void onChatMessageFontChanged (const QFont &font)
 
void setColorizedNames (bool enable)
 
virtual void reloadTheme ()
 

Signals

void messageInserted ()
 

Public Member Functions

 GenericChatForm (const Core &_core, const Contact *contact, IChatLog &chatLog, IMessageDispatcher &messageDispatcher, QWidget *parent=nullptr)
 
 ~GenericChatForm () override
 
void setName (const QString &newName)
 
virtual void show (ContentLayout *contentLayout)
 
void addSystemInfoMessage (const QDateTime &datetime, SystemMessageType messageType, SystemMessage::Args messageArgs)
 
QDateTime getLatestTime () const
 

Static Public Member Functions

static QString resolveToxPk (const ToxPk &pk)
 Searches for name (possibly alias) of someone with specified public key among all of your friends or groups you are participated. More...
 

Protected Slots

void onChatContextMenuRequested (QPoint pos)
 
virtual void onScreenshotClicked ()=0
 
void onSendTriggered ()
 
virtual void onAttachClicked ()=0
 
void onEmoteButtonClicked ()
 
void onEmoteInsertRequested (QString str)
 
void onCopyLogClicked ()
 
void clearChatArea ()
 
void clearChatArea (bool confirm, bool inform)
 
void onSelectAllClicked ()
 
void showFileMenu ()
 
void hideFileMenu ()
 
void quoteSelectedText ()
 
void copyLink ()
 Callback of GenericChatForm::copyLinkAction. More...
 
void onLoadHistory ()
 
void onExportChat ()
 
void searchFormShow ()
 
void updateShowDateInfo (const ChatLine::Ptr &prevLine, const ChatLine::Ptr &topLine)
 
void goToCurrentDate ()
 

Protected Member Functions

ChatMessage::Ptr createMessage (const ToxPk &author, const QString &message, const QDateTime &datetime, bool isAction, bool isSent, bool colorizeName=false)
 
void adjustFileMenuPosition ()
 
void hideEvent (QHideEvent *event) override
 
void showEvent (QShowEvent *) override
 
bool event (QEvent *) final
 
void resizeEvent (QResizeEvent *event) final
 
bool eventFilter (QObject *object, QEvent *event) final
 
bool searchInText (const QString &phrase, const ParameterSearch &parameter, SearchDirection direction)
 
std::pair< int, int > indexForSearchInLine (const QString &txt, const QString &phrase, const ParameterSearch &parameter, SearchDirection direction)
 

Protected Attributes

const Corecore
 
bool audioInputFlag
 
bool audioOutputFlag
 
int curRow
 
QAction * clearAction
 
QAction * quoteAction
 
QAction * copyLinkAction
 
QAction * searchAction
 
QAction * goToCurrentDateAction
 
QAction * loadHistoryAction
 
QAction * exportChatAction
 
QMenu menu
 
QVBoxLayout * contentLayout
 
QPushButton * emoteButton
 
QPushButton * fileButton
 
QPushButton * screenshotButton
 
QPushButton * sendButton
 
QSplitter * bodySplitter
 
ChatFormHeaderheadWidget
 
SearchFormsearchForm
 
QLabel * dateInfo
 
ChatWidgetchatWidget
 
ChatTextEditmsgEdit
 
FlyoutOverlayWidgetfileFlyout
 
Widgetparent
 
IChatLogchatLog
 
IMessageDispatchermessageDispatcher
 

Private Member Functions

void retranslateUi ()
 
void addSystemDateMessage (const QDate &date)
 
QDateTime getTime (const ChatLine::Ptr &chatLine) const
 

Detailed Description

Parent class for all chatforms. It's provide the minimum required UI elements and methods to work with chat messages.

Definition at line 67 of file genericchatform.h.

Constructor & Destructor Documentation

◆ GenericChatForm()

GenericChatForm::GenericChatForm ( const Core _core,
const Contact contact,
IChatLog chatLog,
IMessageDispatcher messageDispatcher,
QWidget *  parent = nullptr 
)

Definition at line 137 of file genericchatform.cpp.

◆ ~GenericChatForm()

GenericChatForm::~GenericChatForm ( )
override

Definition at line 275 of file genericchatform.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ addSystemDateMessage()

void GenericChatForm::addSystemDateMessage ( const QDate &  date)
private

◆ addSystemInfoMessage()

void GenericChatForm::addSystemInfoMessage ( const QDateTime &  datetime,
SystemMessageType  messageType,
SystemMessage::Args  messageArgs 
)

Definition at line 500 of file genericchatform.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ adjustFileMenuPosition()

void GenericChatForm::adjustFileMenuPosition ( )
protected

Definition at line 281 of file genericchatform.cpp.

Here is the caller graph for this function:

◆ clearChatArea [1/2]

void GenericChatForm::clearChatArea ( )
protectedslot

Definition at line 526 of file genericchatform.cpp.

Here is the caller graph for this function:

◆ clearChatArea [2/2]

void GenericChatForm::clearChatArea ( bool  confirm,
bool  inform 
)
protectedslot

Definition at line 531 of file genericchatform.cpp.

Here is the call graph for this function:

◆ copyLink

void GenericChatForm::copyLink ( )
protectedslot

Callback of GenericChatForm::copyLinkAction.

Definition at line 636 of file genericchatform.cpp.

◆ createMessage()

ChatMessage::Ptr GenericChatForm::createMessage ( const ToxPk author,
const QString &  message,
const QDateTime &  datetime,
bool  isAction,
bool  isSent,
bool  colorizeName = false 
)
protected

◆ event()

bool GenericChatForm::event ( QEvent *  e)
finalprotected

Definition at line 387 of file genericchatform.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ eventFilter()

bool GenericChatForm::eventFilter ( QObject *  object,
QEvent *  event 
)
finalprotected

Definition at line 566 of file genericchatform.cpp.

Here is the call graph for this function:

◆ focusInput

void GenericChatForm::focusInput ( )
slot

Definition at line 480 of file genericchatform.cpp.

Here is the caller graph for this function:

◆ getLatestTime()

QDateTime GenericChatForm::getLatestTime ( ) const

Definition at line 303 of file genericchatform.cpp.

Here is the call graph for this function:

◆ getTime()

QDateTime GenericChatForm::getTime ( const ChatLine::Ptr chatLine) const
private

Definition at line 510 of file genericchatform.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ goToCurrentDate

void GenericChatForm::goToCurrentDate ( )
protectedslot

Definition at line 689 of file genericchatform.cpp.

Here is the call graph for this function:

◆ hideEvent()

void GenericChatForm::hideEvent ( QHideEvent *  event)
overrideprotected

Definition at line 554 of file genericchatform.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hideFileMenu

void GenericChatForm::hideFileMenu ( )
protectedslot

Definition at line 297 of file genericchatform.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ indexForSearchInLine()

std::pair<int, int> GenericChatForm::indexForSearchInLine ( const QString &  txt,
const QString &  phrase,
const ParameterSearch parameter,
SearchDirection  direction 
)
protected

◆ messageInserted

void GenericChatForm::messageInserted ( )
signal

◆ onAttachClicked

virtual void GenericChatForm::onAttachClicked ( )
protectedpure virtualslot

◆ onChatContextMenuRequested

void GenericChatForm::onChatContextMenuRequested ( QPoint  pos)
protectedslot

Definition at line 406 of file genericchatform.cpp.

Here is the call graph for this function:

◆ onChatMessageFontChanged

void GenericChatForm::onChatMessageFontChanged ( const QFont &  font)
slot

Definition at line 485 of file genericchatform.cpp.

Here is the call graph for this function:

◆ onCopyLogClicked

void GenericChatForm::onCopyLogClicked ( )
protectedslot

Definition at line 475 of file genericchatform.cpp.

Here is the call graph for this function:

◆ onEmoteButtonClicked

void GenericChatForm::onEmoteButtonClicked ( )
protectedslot

Definition at line 447 of file genericchatform.cpp.

Here is the call graph for this function:

◆ onEmoteInsertRequested

void GenericChatForm::onEmoteInsertRequested ( QString  str)
protectedslot

Definition at line 465 of file genericchatform.cpp.

Here is the caller graph for this function:

◆ onExportChat

void GenericChatForm::onExportChat ( )
protectedslot

Definition at line 658 of file genericchatform.cpp.

Here is the call graph for this function:

◆ onLoadHistory

void GenericChatForm::onLoadHistory ( )
protectedslot

Definition at line 650 of file genericchatform.cpp.

Here is the call graph for this function:

◆ onScreenshotClicked

virtual void GenericChatForm::onScreenshotClicked ( )
protectedpure virtualslot

◆ onSelectAllClicked

void GenericChatForm::onSelectAllClicked ( )
protectedslot

Definition at line 549 of file genericchatform.cpp.

Here is the call graph for this function:

◆ onSendTriggered

void GenericChatForm::onSendTriggered ( )
protectedslot

Definition at line 427 of file genericchatform.cpp.

Here is the call graph for this function:

◆ quoteSelectedText

void GenericChatForm::quoteSelectedText ( )
protectedslot

Definition at line 613 of file genericchatform.cpp.

Here is the call graph for this function:

◆ reloadTheme

void GenericChatForm::reloadTheme ( )
virtualslot

Definition at line 346 of file genericchatform.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ resizeEvent()

void GenericChatForm::resizeEvent ( QResizeEvent *  event)
finalprotected

Definition at line 560 of file genericchatform.cpp.

Here is the call graph for this function:

◆ resolveToxPk()

QString GenericChatForm::resolveToxPk ( const ToxPk pk)
static

Searches for name (possibly alias) of someone with specified public key among all of your friends or groups you are participated.

Parameters
pkSearched public key
Returns
Name or alias of someone with such public key, or public key string representation if no one was found

Definition at line 96 of file genericchatform.cpp.

Here is the call graph for this function:

◆ retranslateUi()

void GenericChatForm::retranslateUi ( )
private

Definition at line 712 of file genericchatform.cpp.

◆ searchFormShow

void GenericChatForm::searchFormShow ( )
protectedslot

Definition at line 642 of file genericchatform.cpp.

Here is the call graph for this function:

◆ searchInText()

bool GenericChatForm::searchInText ( const QString &  phrase,
const ParameterSearch parameter,
SearchDirection  direction 
)
protected

◆ setColorizedNames

void GenericChatForm::setColorizedNames ( bool  enable)
slot

Definition at line 495 of file genericchatform.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setName()

void GenericChatForm::setName ( const QString &  newName)

Definition at line 359 of file genericchatform.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ show()

void GenericChatForm::show ( ContentLayout contentLayout)
virtual

Reimplemented in ChatForm.

Definition at line 364 of file genericchatform.cpp.

Here is the caller graph for this function:

◆ showEvent()

void GenericChatForm::showEvent ( QShowEvent *  )
overrideprotected

Definition at line 381 of file genericchatform.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ showFileMenu

void GenericChatForm::showFileMenu ( )
protectedslot

Definition at line 288 of file genericchatform.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateShowDateInfo

void GenericChatForm::updateShowDateInfo ( const ChatLine::Ptr prevLine,
const ChatLine::Ptr topLine 
)
protectedslot

Definition at line 694 of file genericchatform.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ audioInputFlag

bool GenericChatForm::audioInputFlag
protected

Definition at line 132 of file genericchatform.h.

◆ audioOutputFlag

bool GenericChatForm::audioOutputFlag
protected

Definition at line 133 of file genericchatform.h.

◆ bodySplitter

QSplitter* GenericChatForm::bodySplitter
protected

Definition at line 152 of file genericchatform.h.

◆ chatLog

IChatLog& GenericChatForm::chatLog
protected

Definition at line 166 of file genericchatform.h.

◆ chatWidget

ChatWidget* GenericChatForm::chatWidget
protected

Definition at line 158 of file genericchatform.h.

◆ clearAction

QAction* GenericChatForm::clearAction
protected

Definition at line 136 of file genericchatform.h.

◆ contentLayout

QVBoxLayout* GenericChatForm::contentLayout
protected

Definition at line 146 of file genericchatform.h.

◆ copyLinkAction

QAction* GenericChatForm::copyLinkAction
protected

Definition at line 138 of file genericchatform.h.

◆ core

const Core& GenericChatForm::core
protected

Definition at line 131 of file genericchatform.h.

◆ curRow

int GenericChatForm::curRow
protected

Definition at line 134 of file genericchatform.h.

◆ dateInfo

QLabel* GenericChatForm::dateInfo
protected

Definition at line 157 of file genericchatform.h.

◆ emoteButton

QPushButton* GenericChatForm::emoteButton
protected

Definition at line 147 of file genericchatform.h.

◆ exportChatAction

QAction* GenericChatForm::exportChatAction
protected

Definition at line 142 of file genericchatform.h.

◆ fileButton

QPushButton* GenericChatForm::fileButton
protected

Definition at line 148 of file genericchatform.h.

◆ fileFlyout

FlyoutOverlayWidget* GenericChatForm::fileFlyout
protected

Definition at line 163 of file genericchatform.h.

◆ goToCurrentDateAction

QAction* GenericChatForm::goToCurrentDateAction
protected

Definition at line 140 of file genericchatform.h.

◆ headWidget

ChatFormHeader* GenericChatForm::headWidget
protected

Definition at line 154 of file genericchatform.h.

◆ loadHistoryAction

QAction* GenericChatForm::loadHistoryAction
protected

Definition at line 141 of file genericchatform.h.

◆ menu

QMenu GenericChatForm::menu
protected

Definition at line 144 of file genericchatform.h.

◆ messageDispatcher

IMessageDispatcher& GenericChatForm::messageDispatcher
protected

Definition at line 167 of file genericchatform.h.

◆ msgEdit

ChatTextEdit* GenericChatForm::msgEdit
protected

Definition at line 159 of file genericchatform.h.

◆ parent

Widget* GenericChatForm::parent
protected

Definition at line 164 of file genericchatform.h.

◆ quoteAction

QAction* GenericChatForm::quoteAction
protected

Definition at line 137 of file genericchatform.h.

◆ screenshotButton

QPushButton* GenericChatForm::screenshotButton
protected

Definition at line 149 of file genericchatform.h.

◆ searchAction

QAction* GenericChatForm::searchAction
protected

Definition at line 139 of file genericchatform.h.

◆ searchForm

SearchForm* GenericChatForm::searchForm
protected

Definition at line 156 of file genericchatform.h.

◆ sendButton

QPushButton* GenericChatForm::sendButton
protected

Definition at line 150 of file genericchatform.h.


The documentation for this class was generated from the following files: