From 09a8ade6becca2a71f45ff0db5f4bf6d64afb212 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 21 Apr 2018 03:46:58 +0200 Subject: Add support for static image emoji Emoji are downloaded asynchronously using remote program (curl). Need to add support for converting [inline](url) chat message emoji and gifs. --- include/MessagePart.hpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'include/MessagePart.hpp') diff --git a/include/MessagePart.hpp b/include/MessagePart.hpp index e50852a..cbb0f26 100644 --- a/include/MessagePart.hpp +++ b/include/MessagePart.hpp @@ -1,6 +1,7 @@ #pragma once #include +#include #include #include @@ -11,7 +12,8 @@ namespace dchat public: enum class Type { - TEXT + TEXT, + EMOJI }; MessagePart(Type _type) : type(_type) {} @@ -35,4 +37,17 @@ namespace dchat sf::Text text; }; + + class MessagePartEmoji : public MessagePart + { + public: + MessagePartEmoji(const std::string &url); + + static float getHeightScaled(); + virtual sf::Vector2f getPosition() const override; + virtual sf::Vector2f getSize() const override; + + sf::Sprite sprite; + std::string url; + }; } -- cgit v1.2.3