starting work on websocket chat reader

This commit is contained in:
Ikatono
2024-05-27 13:53:31 -05:00
parent 230f382015
commit 5451a1151c
13 changed files with 620 additions and 6 deletions

34
ircmessagetype.hpp Normal file
View File

@@ -0,0 +1,34 @@
#ifndef IRCMESSAGETYPE_HPP
#define IRCMESSAGETYPE_HPP
#include <QMetaObject>
#include <QMetaType>
class IrcMessageType
{
Q_GADGET
public:
enum MessageType
{
UNKNOWN,
PRIVMSG,
PING
};
Q_ENUM(MessageType);
Q_PROPERTY(MessageType type READ getType)
static IrcMessageType Unknown() { return UNKNOWN; }
constexpr IrcMessageType(MessageType type) : _type(type) { }
IrcMessageType(int type);
IrcMessageType(const IrcMessageType& other);
bool operator ==(const IrcMessageType& other)
{ return this->_type == other._type; }
static IrcMessageType parse(QString str);
MessageType getType() const;
QString toString() const;
private:
const MessageType _type;
};
Q_DECLARE_METATYPE(IrcMessageType)
#endif // IRCMESSAGETYPE_HPP