From 2446736bc775b22cf5aaae88c2c69c9504e5eb17 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 24 Jan 2019 23:10:59 +0100 Subject: Move message composer from dchat_gtk to dchat_core --- include/dchat/MessageComposer.hpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 include/dchat/MessageComposer.hpp (limited to 'include/dchat') diff --git a/include/dchat/MessageComposer.hpp b/include/dchat/MessageComposer.hpp new file mode 100644 index 0000000..b4b55c2 --- /dev/null +++ b/include/dchat/MessageComposer.hpp @@ -0,0 +1,32 @@ +#pragma once + +#include "types.hpp" +#include + +namespace dchat +{ + struct Range + { + int start; + int end; + + int length() const + { + return end - start; + } + }; + + struct MessagePart + { + enum class Type + { + TEXT, + EMOJI + }; + + Type type; + Range textRange; + }; + + void compose(const char *text, usize size, std::function callbackFunc); +} \ No newline at end of file -- cgit v1.2.3