- enum Mode {
- SingleLine,
- MultiLine
- };
-
- MultiLineEdit(QWidget *parent = 0);
- ~MultiLineEdit();
-
- void setCustomFont(const QFont &); // should be used instead setFont(), so we can set our size correctly
-
- // Compatibility methods with the rest of the classes which still expect this to be a QLineEdit
- inline QString text() const { return toPlainText(); }
- inline QString html() const { return toHtml(); }
- inline int cursorPosition() const { return textCursor().position(); }
- inline void insert(const QString &newText) { insertPlainText(newText); }
- inline void backspace() { keyPressEvent(new QKeyEvent(QEvent::KeyPress, Qt::Key_Backspace, Qt::NoModifier)); }
- inline bool hasSelectedText() const { return textCursor().hasSelection(); }
-
- inline bool isSingleLine() const { return _singleLine; }
- inline bool pasteProtectionEnabled() const { return _pasteProtectionEnabled; }
-
- virtual QSize sizeHint() const;
- virtual QSize minimumSizeHint() const;
-
- inline QString mircColorFromRGB(QString rgbColor) const { return _mircColorMap.key(rgbColor); }
- inline QString rgbColorFromMirc(QString mircColor) const { return _mircColorMap[mircColor]; }
- inline QMap<QString, QString> mircColorMap() const { return _mircColorMap; }
-
- inline QStringList history() const { return _history; }
- inline QHash<int, QString> tempHistory() const { return _tempHistory; }
- inline qint32 idx() const { return _idx; }
+ enum Mode {
+ SingleLine,
+ MultiLine
+ };
+
+ MultiLineEdit(QWidget *parent = 0);
+ ~MultiLineEdit();
+
+ void setCustomFont(const QFont &); // should be used instead setFont(), so we can set our size correctly
+
+ // Compatibility methods with the rest of the classes which still expect this to be a QLineEdit
+ inline QString text() const { return toPlainText(); }
+ inline QString html() const { return toHtml(); }
+ inline int cursorPosition() const { return textCursor().position(); }
+ inline void insert(const QString &newText) { insertPlainText(newText); }
+ inline void backspace() { keyPressEvent(new QKeyEvent(QEvent::KeyPress, Qt::Key_Backspace, Qt::NoModifier)); }
+ inline bool hasSelectedText() const { return textCursor().hasSelection(); }
+
+ inline bool isSingleLine() const { return _singleLine; }
+ inline bool pasteProtectionEnabled() const { return _pasteProtectionEnabled; }
+
+ QSize sizeHint() const override;
+ QSize minimumSizeHint() const override;
+
+ inline QString mircColorFromRGB(QString rgbColor) const { return _mircColorMap.key(rgbColor); }
+ inline QString rgbColorFromMirc(QString mircColor) const { return _mircColorMap[mircColor]; }
+ inline QMap<QString, QString> mircColorMap() const { return _mircColorMap; }
+
+ inline QStringList history() const { return _history; }
+ inline QHash<int, QString> tempHistory() const { return _tempHistory; }
+ inline qint32 idx() const { return _idx; }
+ inline bool emacsMode() const { return _emacsMode; }
+
+ void addCompletionSpace();
+#if defined HAVE_KF5 || defined HAVE_KDE4
+ void createHighlighter() override;
+#endif