#ifndef IRCMESSAGETYPE_HPP #define IRCMESSAGETYPE_HPP #include #include 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