summary refs log tree commit diff
path: root/src/timeline/InputBar.h
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2020-11-09 03:12:37 +0100
committerNicolas Werner <nicolas.werner@hotmail.de>2020-11-25 19:05:12 +0100
commit0bb488563288da75566e7da883fda31914ecf281 (patch)
treecd0d1fef49fe13525e5529da149c116a7a37e650 /src/timeline/InputBar.h
parentPasteable textinput (diff)
downloadnheko-0bb488563288da75566e7da883fda31914ecf281.tar.xz
Basic text input in qml
Diffstat (limited to 'src/timeline/InputBar.h')
-rw-r--r--src/timeline/InputBar.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/timeline/InputBar.h b/src/timeline/InputBar.h
index 78b06960..f3a38c2e 100644
--- a/src/timeline/InputBar.h
+++ b/src/timeline/InputBar.h
@@ -1,10 +1,12 @@
 #pragma once
 
 #include <QObject>
+#include <deque>
 
 class TimelineModel;
 
-class InputBar : public QObject {
+class InputBar : public QObject
+{
         Q_OBJECT
 
 public:
@@ -15,11 +17,20 @@ public:
 
 public slots:
         void send();
-        bool paste(bool fromMouse);
+        void paste(bool fromMouse);
         void updateState(int selectionStart, int selectionEnd, int cursorPosition, QString text);
 
+signals:
+        void insertText(QString text);
+
 private:
+        void message(QString body);
+        void emote(QString body);
+        void command(QString name, QString args);
+
         TimelineModel *room;
         QString text;
+        std::deque<QString> history_;
+        std::size_t history_index_ = 0;
         int selectionStart = 0, selectionEnd = 0, cursorPosition = 0;
 };