/
Shymer123
/
Messenger
Обзор
Документация
Войти
/
Shymer123
/
Messenger
Код
Запросы
0
Задачи
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
UI_Client/SourceFiles/DataModels/chat_data.h
55 строк
1 KB
Shymer123
the code has been refactored (now there are no incomprehensible 'UserRole + n') so far only in the list of chats and the list of messages
09 май 2025, 05:48
09 май 2025, 05:48
f0d1c4e
Код
Авторство
О чём код?
#ifndef CHAT_DATA_H #define CHAT_DATA_H #include "SharedEnums/MessageType.h" #include "SharedEnums/MemberRole.h" #include "SharedEnums/ChatTypes.h" #include <QString> #include <QDateTime> #include <QPixmap> class ChatData { public: ChatData(); void setChatType(const ChatTypes& type); void setChatID(const int id); void setTitle(const QString& name); void setAvatar(const QPixmap& avatar); template<typename T> void setLastMessage(const T& lastMessage); void setLastMessageType(const MessageType type); void setLastMessageTime(const QDateTime& time); void setMemberRole(const MemberRole role); void setParticipantID(const int participantID); ChatTypes getChatType() const; int getChatID() const; QString getTitle() const; QPixmap getAvatar() const; template<typename T> T getLastMessage() const; MessageType getLastMessageType() const; QDateTime getLastMessageTime() const; MemberRole getMemberRole() const; int getParticipantID() const; private: ChatTypes m_chatType; int m_id; QString m_title; QPixmap m_avatar; QVariant m_lastMessage; MessageType m_lastMessageType; QDateTime m_lastMessageTime; MemberRole m_memberRole; int m_participantID; }; #endif // CHAT_DATA_H