aboutsummaryrefslogtreecommitdiff
path: root/include/MessageComposer.hpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2019-01-20 05:02:13 +0100
committerdec05eba <dec05eba@protonmail.com>2019-01-20 05:02:17 +0100
commitb629e93b124fcad6635a508e47c7776bb0891d1b (patch)
tree62c2c6d06afe779d4893d30184d9cd5c05621b57 /include/MessageComposer.hpp
parentdaa59b89b1f05cf3a2abdee9ef5ac8bffe805b13 (diff)
Start with custom emoji (binds) and tests
Diffstat (limited to 'include/MessageComposer.hpp')
-rw-r--r--include/MessageComposer.hpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/include/MessageComposer.hpp b/include/MessageComposer.hpp
new file mode 100644
index 0000000..5af065d
--- /dev/null
+++ b/include/MessageComposer.hpp
@@ -0,0 +1,32 @@
+#pragma once
+
+#include <glibmm/ustring.h>
+#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 Glib::ustring &text, std::function<void(MessagePart)> callbackFunc);
+} \ No newline at end of file