mirror-chatterino2/messages/message.h

70 lines
1.6 KiB
C
Raw Normal View History

2017-01-05 16:07:20 +01:00
#ifndef MESSAGE_H
#define MESSAGE_H
2017-04-12 17:46:44 +02:00
#include "messages/message.h"
#include "messages/messageparseargs.h"
2017-01-18 21:30:23 +01:00
#include "messages/word.h"
#include "messages/wordpart.h"
2017-01-05 16:07:20 +01:00
2017-01-11 01:08:20 +01:00
#include <IrcMessage>
#include <QVector>
2017-01-11 01:08:20 +01:00
#include <chrono>
2017-04-12 17:46:44 +02:00
#include <memory>
2017-01-11 01:08:20 +01:00
2017-04-14 17:52:22 +02:00
namespace chatterino {
class Channel;
2017-04-14 17:52:22 +02:00
namespace messages {
2017-04-12 17:46:44 +02:00
class Message;
typedef std::shared_ptr<Message> SharedMessage;
2017-01-18 21:30:23 +01:00
2017-01-05 16:07:20 +01:00
class Message
{
public:
2017-01-11 18:52:09 +01:00
Message(const QString &text);
2017-04-12 17:46:44 +02:00
Message(const std::vector<messages::Word> &words);
bool getCanHighlightTab() const;
const QString &getTimeoutUser() const;
int getTimeoutCount() const;
const QString &getUserName() const;
const QString &getDisplayName() const;
const QString &getContent() const;
const std::chrono::time_point<std::chrono::system_clock> &getParseTime() const;
std::vector<Word> &getWords();
bool isDisabled() const;
const QString &getId() const;
2017-01-05 20:49:33 +01:00
2017-01-05 16:07:20 +01:00
private:
2017-01-11 18:52:09 +01:00
static LazyLoadedImage *badgeStaff;
static LazyLoadedImage *badgeAdmin;
static LazyLoadedImage *badgeGlobalmod;
static LazyLoadedImage *badgeModerator;
static LazyLoadedImage *badgeTurbo;
static LazyLoadedImage *badgeBroadcaster;
static LazyLoadedImage *badgePremium;
2017-01-05 16:07:20 +01:00
2017-01-11 18:52:09 +01:00
static QRegularExpression *cheerRegex;
2017-01-07 20:43:55 +01:00
2017-04-12 17:46:44 +02:00
bool _highlightTab = false;
QString _timeoutUser = "";
int _timeoutCount = 0;
bool _isDisabled = false;
std::chrono::time_point<std::chrono::system_clock> _parseTime;
2017-01-28 20:29:02 +01:00
2017-04-12 17:46:44 +02:00
QString _userName = "";
QString _displayName = "";
QString _content;
QString _id = "";
2017-01-07 20:43:55 +01:00
2017-04-12 17:46:44 +02:00
std::vector<Word> _words;
2017-01-05 16:07:20 +01:00
};
2017-01-28 20:29:02 +01:00
2017-04-14 17:52:22 +02:00
} // namespace messages
} // namespace chatterino
2017-01-05 16:07:20 +01:00
2017-01-11 18:52:09 +01:00
#endif // MESSAGE_H