aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/ChatMessage.hpp3
-rw-r--r--include/MessageComposer.hpp32
2 files changed, 33 insertions, 2 deletions
diff --git a/include/ChatMessage.hpp b/include/ChatMessage.hpp
index 5259a9c..a50a799 100644
--- a/include/ChatMessage.hpp
+++ b/include/ChatMessage.hpp
@@ -7,7 +7,6 @@
namespace dchat
{
- class User;
class ChatMessage : public Gtk::Grid
{
public:
@@ -18,4 +17,4 @@ namespace dchat
Gtk::Label text;
uint32_t timestampSeconds;
};
-} \ No newline at end of file
+}
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