aboutsummaryrefslogtreecommitdiff
path: root/include/dchat
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2019-01-24 23:10:59 +0100
committerdec05eba <dec05eba@protonmail.com>2020-08-18 23:38:23 +0200
commit2446736bc775b22cf5aaae88c2c69c9504e5eb17 (patch)
tree54f1b892dbd3c38b05dcd81c33ffe7ae9c84d6e7 /include/dchat
parent8fb1062b263c90c22b2cd6a22e9031eef71240ef (diff)
Move message composer from dchat_gtk to dchat_core
Diffstat (limited to 'include/dchat')
-rw-r--r--include/dchat/MessageComposer.hpp32
1 files changed, 32 insertions, 0 deletions
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 <functional>
+
+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<void(MessagePart)> callbackFunc);
+} \ No newline at end of file