qTox  Version: nightly | Commit: bc751c8e1cac455f9690654fcfe0f560d2d7dfdd
Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
ChatLogItem Class Reference

#include <chatlogitem.h>

Collaboration diagram for ChatLogItem:
Collaboration graph

Public Types

enum  ContentType { ContentType::message, ContentType::fileTransfer, ContentType::systemMessage }
 

Public Member Functions

 ChatLogItem (ToxPk sender, const QString &displayName, ChatLogFile file)
 
 ChatLogItem (ToxPk sender, const QString &displayName, ChatLogMessage message)
 
 ChatLogItem (SystemMessage message)
 
const ToxPk & getSender () const
 
ContentType getContentType () const
 
ChatLogFile & getContentAsFile ()
 
const ChatLogFile & getContentAsFile () const
 
ChatLogMessage & getContentAsMessage ()
 
const ChatLogMessage & getContentAsMessage () const
 
SystemMessage & getContentAsSystemMessage ()
 
const SystemMessage & getContentAsSystemMessage () const
 
QDateTime getTimestamp () const
 
void setDisplayName (QString name)
 
const QString & getDisplayName () const
 

Private Types

using ContentPtr = std::unique_ptr< void, void(*)(void *)>
 

Private Member Functions

 ChatLogItem (ToxPk sender, const QString &displayName_, ContentType contentType, ContentPtr content)
 

Private Attributes

ToxPk sender
 
QString displayName
 
ContentType contentType
 
ContentPtr content
 

Detailed Description

Definition at line 42 of file chatlogitem.h.

Member Typedef Documentation

◆ ContentPtr

using ChatLogItem::ContentPtr = std::unique_ptr<void, void (*)(void*)>
private

Definition at line 45 of file chatlogitem.h.

Member Enumeration Documentation

◆ ContentType

Enumerator
message 
fileTransfer 
systemMessage 

Definition at line 48 of file chatlogitem.h.

Constructor & Destructor Documentation

◆ ChatLogItem() [1/4]

ChatLogItem::ChatLogItem ( ToxPk  sender,
const QString &  displayName,
ChatLogFile  file 
)

Definition at line 41 of file chatlogitem.cpp.

◆ ChatLogItem() [2/4]

ChatLogItem::ChatLogItem ( ToxPk  sender,
const QString &  displayName,
ChatLogMessage  message 
)

Definition at line 47 of file chatlogitem.cpp.

◆ ChatLogItem() [3/4]

ChatLogItem::ChatLogItem ( SystemMessage  message)

Definition at line 53 of file chatlogitem.cpp.

◆ ChatLogItem() [4/4]

ChatLogItem::ChatLogItem ( ToxPk  sender,
const QString &  displayName_,
ContentType  contentType,
ContentPtr  content 
)
private

Definition at line 58 of file chatlogitem.cpp.

Member Function Documentation

◆ getContentAsFile() [1/2]

const ChatLogFile & ChatLogItem::getContentAsFile ( )

Definition at line 75 of file chatlogitem.cpp.

Here is the caller graph for this function:

◆ getContentAsFile() [2/2]

const ChatLogFile& ChatLogItem::getContentAsFile ( ) const

◆ getContentAsMessage() [1/2]

const ChatLogMessage & ChatLogItem::getContentAsMessage ( )

Definition at line 87 of file chatlogitem.cpp.

Here is the caller graph for this function:

◆ getContentAsMessage() [2/2]

const ChatLogMessage& ChatLogItem::getContentAsMessage ( ) const

◆ getContentAsSystemMessage() [1/2]

const SystemMessage & ChatLogItem::getContentAsSystemMessage ( )

Definition at line 99 of file chatlogitem.cpp.

Here is the caller graph for this function:

◆ getContentAsSystemMessage() [2/2]

const SystemMessage& ChatLogItem::getContentAsSystemMessage ( ) const

◆ getContentType()

ChatLogItem::ContentType ChatLogItem::getContentType ( ) const

Definition at line 70 of file chatlogitem.cpp.

Here is the caller graph for this function:

◆ getDisplayName()

const QString & ChatLogItem::getDisplayName ( ) const

Definition at line 138 of file chatlogitem.cpp.

Here is the caller graph for this function:

◆ getSender()

const ToxPk & ChatLogItem::getSender ( ) const

Definition at line 65 of file chatlogitem.cpp.

Here is the caller graph for this function:

◆ getTimestamp()

QDateTime ChatLogItem::getTimestamp ( ) const

Definition at line 112 of file chatlogitem.cpp.

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

◆ setDisplayName()

void ChatLogItem::setDisplayName ( QString  name)

Definition at line 133 of file chatlogitem.cpp.

Member Data Documentation

◆ content

ContentPtr ChatLogItem::content
private

Definition at line 77 of file chatlogitem.h.

◆ contentType

ContentType ChatLogItem::contentType
private

Definition at line 75 of file chatlogitem.h.

◆ displayName

QString ChatLogItem::displayName
private

Definition at line 74 of file chatlogitem.h.

◆ sender

ToxPk ChatLogItem::sender
private

Definition at line 73 of file chatlogitem.h.


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