atrooney-online-2/include/aotextarea.h
oldmud0 8928aa2718 Perform clang-format
If you don't want to see this commit on blames, use the hidden
whitespace option on GitHub, or use `-w` in git-blame.
2020-05-22 17:13:37 -05:00

25 lines
588 B
C++

#ifndef AOTEXTAREA_H
#define AOTEXTAREA_H
#include <QDebug>
#include <QRegExp>
#include <QScrollBar>
#include <QTextBrowser>
#include <QTextCursor>
class AOTextArea : public QTextBrowser {
public:
AOTextArea(QWidget *p_parent = nullptr);
void append_chatmessage(QString p_name, QString p_message, QString p_colour);
void append_error(QString p_message);
private:
const QRegExp omnis_dank_url_regex = QRegExp("\\b(https?://\\S+\\.\\S+)\\b");
void auto_scroll(QTextCursor old_cursor, int scrollbar_value,
bool is_scrolled_down);
};
#endif // AOTEXTAREA_H