Quassel IRC  Pre-Release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
MultiLineEdit Class Reference

#include </tmp/quassel/src/uisupport/multilineedit.h>

Public Types

enum  Mode { SingleLine, MultiLine }

Public Slots

void setMode (Mode mode)
void setMinHeight (int numLines)
void setMaxHeight (int numLines)
void setEmacsMode (bool enable=true)
void setScrollBarsEnabled (bool enable=true)
void setSpellCheckEnabled (bool enable=true)
void setPasteProtectionEnabled (bool enable=true, QWidget *msgBoxParent=0)
void setLineWrapEnabled (bool enable=false)
void setHistory (QStringList history)
void setTempHistory (QHash< int, QString > tempHistory)
void setIdx (qint32 idx)

Signals

void textEntered (const QString &text)
void noTextEntered ()

Public Member Functions

 MultiLineEdit (QWidget *parent=0)
 ~MultiLineEdit ()
void setCustomFont (const QFont &)
QString text () const
QString html () const
int cursorPosition () const
void insert (const QString &newText)
void backspace ()
bool hasSelectedText () const
bool isSingleLine () const
bool pasteProtectionEnabled () const
virtual QSize sizeHint () const
virtual QSize minimumSizeHint () const
QString mircColorFromRGB (QString rgbColor) const
QString rgbColorFromMirc (QString mircColor) const
QMap< QString, QString > mircColorMap () const
QStringList history () const
QHash< int, QString > tempHistory () const
qint32 idx () const
bool emacsMode () const

Protected Member Functions

virtual bool event (QEvent *e)
virtual void keyPressEvent (QKeyEvent *event)
virtual void resizeEvent (QResizeEvent *event)

Private Slots

void on_returnPressed ()
void on_returnPressed (const QString &text)
void on_textChanged ()
void on_documentHeightChanged (qreal height)
bool addToHistory (const QString &text, bool temporary=false)
void historyMoveForward ()
void historyMoveBack ()
QString convertRichtextToMircCodes ()
QString convertMircCodesToHtml (const QString &text)
bool mircCodesChanged (QTextCursor &cursor, QTextCursor &peekcursor)

Private Member Functions

void reset ()
void showHistoryEntry ()
void updateScrollBars ()
void updateSizeHint ()

Private Attributes

QStringList _history
QHash< int, QString > _tempHistory
qint32 _idx
Mode _mode
bool _singleLine
int _minHeight
int _maxHeight
bool _scrollBarsEnabled
bool _pasteProtectionEnabled
bool _emacsMode
QSize _sizeHint
qreal _lastDocumentHeight
QMap< QString, QString > _mircColorMap

Detailed Description

Definition at line 41 of file multilineedit.h.

Member Enumeration Documentation

enum Mode
Enumerator:
SingleLine 
MultiLine 

Definition at line 46 of file multilineedit.h.

Constructor & Destructor Documentation

MultiLineEdit ( QWidget *  parent = 0)

Definition at line 78 of file multilineedit.cpp.

Member Function Documentation

void setCustomFont ( const QFont &  font)

Definition at line 83 of file multilineedit.cpp.

References updateSizeHint().

QString text ( ) const
inline

Definition at line 57 of file multilineedit.h.

Referenced by addToHistory(), keyPressEvent(), and on_textChanged().

QString html ( ) const
inline

Definition at line 58 of file multilineedit.h.

Referenced by InputWidget::currentChanged().

int cursorPosition ( ) const
inline

Definition at line 59 of file multilineedit.h.

void insert ( const QString &  newText)
inline

Definition at line 60 of file multilineedit.h.

Referenced by on_textChanged().

void backspace ( )
inline

Definition at line 61 of file multilineedit.h.

References keyPressEvent().

bool hasSelectedText ( ) const
inline

Definition at line 62 of file multilineedit.h.

Referenced by BufferWidget::eventFilter().

bool isSingleLine ( ) const
inline

Definition at line 64 of file multilineedit.h.

References _singleLine.

Referenced by BufferWidget::eventFilter(), and updateScrollBars().

bool pasteProtectionEnabled ( ) const
inline

Definition at line 65 of file multilineedit.h.

References _pasteProtectionEnabled.

Referenced by on_textChanged().

QSize sizeHint ( ) const
virtual

Definition at line 183 of file multilineedit.cpp.

References _sizeHint, and updateSizeHint().

Referenced by minimumSizeHint().

QSize minimumSizeHint ( ) const
virtual

Definition at line 193 of file multilineedit.cpp.

References sizeHint().

QString mircColorFromRGB ( QString  rgbColor) const
inline

Definition at line 70 of file multilineedit.h.

References _mircColorMap.

QString rgbColorFromMirc ( QString  mircColor) const
inline

Definition at line 71 of file multilineedit.h.

References _mircColorMap.

QMap<QString, QString> mircColorMap ( ) const
inline

Definition at line 72 of file multilineedit.h.

References _mircColorMap.

Referenced by InputWidget::InputWidget().

QStringList history ( ) const
inline

Definition at line 74 of file multilineedit.h.

References _history.

Referenced by InputWidget::currentChanged(), and setHistory().

QHash<int, QString> tempHistory ( ) const
inline

Definition at line 75 of file multilineedit.h.

References _tempHistory.

Referenced by InputWidget::currentChanged(), and setTempHistory().

qint32 idx ( ) const
inline

Definition at line 76 of file multilineedit.h.

References _idx.

Referenced by InputWidget::currentChanged(), and setIdx().

bool emacsMode ( ) const
inline

Definition at line 77 of file multilineedit.h.

References _emacsMode.

void setMode ( Mode  mode)
slot

Definition at line 90 of file multilineedit.cpp.

References _mode.

Referenced by MultiLineEdit().

void setMinHeight ( int  numLines)
slot

Definition at line 106 of file multilineedit.cpp.

References _minHeight, and updateSizeHint().

void setMaxHeight ( int  numLines)
slot

Definition at line 116 of file multilineedit.cpp.

References _maxHeight, and updateSizeHint().

void setEmacsMode ( bool  enable = true)
slot

Definition at line 199 of file multilineedit.cpp.

References _emacsMode.

void setScrollBarsEnabled ( bool  enable = true)
slot

Definition at line 126 of file multilineedit.cpp.

References _scrollBarsEnabled, and updateScrollBars().

void setSpellCheckEnabled ( bool  enable = true)
slot

Definition at line 205 of file multilineedit.cpp.

void setPasteProtectionEnabled ( bool  enable = true,
QWidget *  msgBoxParent = 0 
)
slot

Definition at line 215 of file multilineedit.cpp.

References _pasteProtectionEnabled.

void setLineWrapEnabled ( bool  enable = false)
slot

Definition at line 99 of file multilineedit.cpp.

References updateSizeHint().

Referenced by MultiLineEdit().

void setHistory ( QStringList  history)
inlineslot

Definition at line 89 of file multilineedit.h.

References _history, and history().

Referenced by InputWidget::currentChanged().

void setTempHistory ( QHash< int, QString >  tempHistory)
inlineslot

Definition at line 90 of file multilineedit.h.

References _tempHistory, and tempHistory().

Referenced by InputWidget::currentChanged().

void setIdx ( qint32  idx)
inlineslot

Definition at line 91 of file multilineedit.h.

References _idx, and idx().

Referenced by InputWidget::currentChanged().

void textEntered ( const QString &  text)
signal

Referenced by on_returnPressed().

void noTextEntered ( )
signal

Referenced by on_returnPressed().

bool event ( QEvent *  e)
protectedvirtual
void keyPressEvent ( QKeyEvent *  event)
protectedvirtual
void resizeEvent ( QResizeEvent *  event)
protectedvirtual

Definition at line 152 of file multilineedit.cpp.

References updateScrollBars(), and updateSizeHint().

void on_returnPressed ( )
privateslot

Definition at line 664 of file multilineedit.cpp.

References convertRichtextToMircCodes().

Referenced by keyPressEvent(), and on_textChanged().

void on_returnPressed ( const QString &  text)
privateslot

Definition at line 670 of file multilineedit.cpp.

References _tempHistory, addToHistory(), noTextEntered(), reset(), and textEntered().

void on_documentHeightChanged ( qreal  height)
privateslot

Definition at line 742 of file multilineedit.cpp.

References updateScrollBars().

Referenced by on_textChanged().

bool addToHistory ( const QString &  text,
bool  temporary = false 
)
privateslot

Definition at line 250 of file multilineedit.cpp.

References _history, _idx, _tempHistory, and text().

Referenced by historyMoveBack(), historyMoveForward(), and on_returnPressed().

void historyMoveForward ( )
privateslot
void historyMoveBack ( )
privateslot

Definition at line 221 of file multilineedit.cpp.

References _idx, addToHistory(), convertRichtextToMircCodes(), and showHistoryEntry().

Referenced by keyPressEvent().

QString convertRichtextToMircCodes ( )
privateslot

Definition at line 468 of file multilineedit.cpp.

References _mircColorMap, and mircCodesChanged().

Referenced by historyMoveBack(), historyMoveForward(), and on_returnPressed().

QString convertMircCodesToHtml ( const QString &  text)
privateslot

Definition at line 588 of file multilineedit.cpp.

References _mircColorMap.

Referenced by showHistoryEntry().

bool mircCodesChanged ( QTextCursor &  cursor,
QTextCursor &  peekcursor 
)
privateslot

Definition at line 571 of file multilineedit.cpp.

Referenced by convertRichtextToMircCodes().

void reset ( )
private

Definition at line 748 of file multilineedit.cpp.

References _history, _idx, leftMargin, and updateScrollBars().

Referenced by historyMoveForward(), MultiLineEdit(), and on_returnPressed().

void showHistoryEntry ( )
private
void updateScrollBars ( )
private
void updateSizeHint ( )
private

Member Data Documentation

QStringList _history
private
QHash<int, QString> _tempHistory
private
qint32 _idx
private
Mode _mode
private

Definition at line 120 of file multilineedit.h.

Referenced by keyPressEvent(), on_textChanged(), and setMode().

bool _singleLine
private

Definition at line 121 of file multilineedit.h.

Referenced by isSingleLine(), and on_textChanged().

int _minHeight
private

Definition at line 122 of file multilineedit.h.

Referenced by setMinHeight(), and updateSizeHint().

int _maxHeight
private

Definition at line 123 of file multilineedit.h.

Referenced by setMaxHeight(), updateScrollBars(), and updateSizeHint().

bool _scrollBarsEnabled
private

Definition at line 124 of file multilineedit.h.

Referenced by setScrollBarsEnabled(), and updateScrollBars().

bool _pasteProtectionEnabled
private

Definition at line 125 of file multilineedit.h.

Referenced by pasteProtectionEnabled(), and setPasteProtectionEnabled().

bool _emacsMode
private

Definition at line 126 of file multilineedit.h.

Referenced by emacsMode(), keyPressEvent(), and setEmacsMode().

QSize _sizeHint
private

Definition at line 128 of file multilineedit.h.

Referenced by sizeHint(), and updateSizeHint().

qreal _lastDocumentHeight
private

Definition at line 129 of file multilineedit.h.

Referenced by on_textChanged().

QMap<QString, QString> _mircColorMap
private

The documentation for this class was generated from the following files: