starting work on websocket chat reader
This commit is contained in:
34
ircmessagetype.hpp
Normal file
34
ircmessagetype.hpp
Normal 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
|
||||
Reference in New Issue
Block a user