#ifndef MESSAGEREF_H #define MESSAGEREF_H #include "messages/message.h" #include #include namespace chatterino { namespace messages { class MessageRef { public: MessageRef(std::shared_ptr message); Message * getMessage() { return this->message; } int getHeight() const { return height; } bool layout(int width, bool enableEmoteMargins = true); const std::vector & getWordParts() const { return wordParts; } std::shared_ptr buffer = nullptr; bool updateBuffer = false; private: Message *message; std::shared_ptr messagePtr; std::vector wordParts; int height = 0; int currentLayoutWidth = -1; int fontGeneration = -1; int emoteGeneration = -1; void alignWordParts(int lineStart, int lineHeight); }; } } #endif // MESSAGEREF_H