summaryrefslogtreecommitdiff
path: root/src/querystring_gui.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/querystring_gui.h')
-rw-r--r--src/querystring_gui.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/querystring_gui.h b/src/querystring_gui.h
index a652b382d..db6e33076 100644
--- a/src/querystring_gui.h
+++ b/src/querystring_gui.h
@@ -55,6 +55,37 @@ public:
void HandleEditBox(Window *w, int wid);
Point GetCaretPosition(const Window *w, int wid) const;
+
+ /**
+ * Get the current text.
+ * @return Current text.
+ */
+ const char *GetText() const
+ {
+ return this->text.buf;
+ }
+
+ /**
+ * Get the position of the caret in the text buffer.
+ * @return Pointer to the caret in the text buffer.
+ */
+ const char *GetCaret() const
+ {
+ return this->text.buf + this->text.caretpos;
+ }
+
+ /**
+ * Get the currently marked text.
+ * @param[out] length Length of the marked text.
+ * @return Begining of the marked area or NULL if no text is marked.
+ */
+ const char *GetMarkedText(size_t *length) const
+ {
+ if (this->text.markend == 0) return NULL;
+
+ *length = this->text.markend - this->text.markpos;
+ return this->text.buf + this->text.markpos;
+ }
};
void ShowOnScreenKeyboard(Window *parent, int button);