![]() |
KVIrc 5.2.6
Developer APIs
|
Input editor class. More...
#include <KviInputEditor.h>
Classes | |
class | EditCommand |
Holds the command used in the {un,re}do operations. More... | |
Public Slots | |
void | clear () |
Clears the input line. | |
void | copyToClipboard () |
Copies the text to the system clipboard. | |
void | copyToSelection (bool bDonNotCopyToClipboard=true) |
Copies the text to the system clipboard. | |
void | cut () |
Cuts the selection from the input line. | |
void | iconPopupActivated (QAction *pAction) |
Opens the icon popup with icon description. | |
void | pasteClipboardWithConfirmation () |
Pastes the text to the system clipboard. | |
void | pasteFile () |
Pastes a file to the buffer. | |
void | pasteSelectionWithConfirmation () |
Pastes the text to the system clipboard. | |
void | pasteSlow () |
Starts a slow paste in the buffer. | |
void | redo () |
Redo the last undo-ed action. | |
void | removeSelected () |
Removes the selected text. | |
void | selectAll () |
Selects all text in the input line. | |
void | stopPasteSlow () |
Stops a slow paste in the buffer. | |
void | undo () |
Undo the last action. | |
Signals | |
void | enterPressed () |
Called when the user press enter/return. | |
void | escapePressed () |
Called when the user press escape. | |
Public Member Functions | |
void | applyOptions (bool bRefreshCachedMetrics=true) |
Applies the options and update. | |
void | clearUndoStack () |
Clears the undo stack. | |
int | heightHint () const |
Returns the height of the editor. | |
void | insertChar (QChar c) |
Inserts a character at the current position. | |
void | insertText (const QString &szTxt) |
Inserts the text at the current position. | |
bool | isReadOnly () const |
Returns true if the input line is in read only state. | |
KviInputEditor (QWidget *pPar, KviWindow *pWnd, KviUserListView *pView=nullptr) | |
Constructs the input editor object. | |
KviInputEditor (QWidget *pPar, QWidget *pInputParent, KviWindow *pWnd, KviUserListView *pView=nullptr) | |
void | setMaxBufferSize (int iSize) |
Sets the maximum buffer size. | |
void | setReadOnly (bool bReadOnly) |
Sets the read only state for the input line. | |
void | setText (const QString szText) |
Sets the text in the input line. | |
QString | text () const |
Returns the text in the buffer. | |
QString | textBeforeCursor () const |
Returns the text before the cursor. | |
~KviInputEditor () | |
Destroys the Input editor object. | |
Protected Member Functions | |
bool | checkWordSpelling (const QString &szWord) |
void | completionEscapeUnsafeToken (QString &szToken) |
void | dragEnterEvent (QDragEnterEvent *e) override |
virtual void | drawContents (QPainter *) |
void | dropEvent (QDropEvent *e) override |
void | fillSpellCheckerCorrectionsPopup () |
KviInputEditorSpellCheckerBlock * | findSpellCheckerBlockAtCursor (std::vector< KviInputEditorSpellCheckerBlock > &lBlocks) |
void | focusInEvent (QFocusEvent *e) override |
void | focusOutEvent (QFocusEvent *e) override |
void | inputMethodEvent (QInputMethodEvent *e) override |
QVariant | inputMethodQuery (Qt::InputMethodQuery query) const override |
void | insertIconCode (const QString &szCode) |
void | installShortcuts () |
void | keyPressEvent (QKeyEvent *e) override |
void | keyReleaseEvent (QKeyEvent *e) override |
void | mouseDoubleClickEvent (QMouseEvent *e) override |
void | mousePressEvent (QMouseEvent *e) override |
void | mouseReleaseEvent (QMouseEvent *e) override |
void | paintEvent (QPaintEvent *e) override |
void | rebuildTextBlocks () |
void | splitTextIntoSpellCheckerBlocks (const QString &szText, std::vector< KviInputEditorSpellCheckerBlock > &lBuffer) |
void | timerEvent (QTimerEvent *e) override |
Protected Attributes | |
bool | m_bCursorOn |
bool | m_bIMComposing |
bool | m_bLastCompletionFinished |
bool | m_bReadOnly |
bool | m_bSpSlowFlag |
bool | m_bUpdatesEnabled |
std::vector< QString > | m_History |
int | m_iCurHistoryIdx |
int | m_iCursorPosition |
int | m_iCursorTimer |
int | m_iCursorWidth |
int | m_iDragTimer |
int | m_iIMLength |
int | m_iIMSelectionBegin |
int | m_iIMSelectionLength |
int | m_iIMStart |
int | m_iLastCompletionCursorPosition |
int | m_iMaxBufferSize |
int | m_iSelectionAnchorChar |
int | m_iSelectionBegin |
int | m_iSelectionEnd |
int | m_iSpellCheckPosition |
KviInputEditorPrivate * | m_p |
QMenu * | m_pIconMenu |
QWidget * | m_pInputParent |
KviWindow * | m_pKviWindow |
KviUserListView * | m_pUserListView |
std::vector< std::unique_ptr< EditCommand > > | m_RedoStack |
The redo stack. | |
QMenu | m_SpellCheckerPopup |
KviCString | m_szAltKeyCode |
QString | m_szIMText |
QString | m_szLastCompletedNick |
QString | m_szLastCompletionBuffer |
KviCString | m_szSaveTextBuffer |
QString | m_szTextBuffer |
std::vector< std::unique_ptr< EditCommand > > | m_UndoStack |
The undo stack. | |
Static Protected Attributes | |
static int | g_iCachedHeight = 0 |
static int | g_iInputFontCharWidth [256] |
static int | g_iInputInstances = 0 |
static QFontMetrics * | g_pLastFontMetrics = nullptr |
Properties | |
int | TransparencyCapable |
Private Slots | |
void | addToHistory (const QString &szString) |
void | backspaceHit () |
Run when backspace key is pressed. | |
void | copyInternal () |
Copies to clipboard. | |
void | cutInternal () |
Cuts to clipboard. | |
void | deleteHit () |
Run when delete key is pressed. | |
void | deleteNextWord () |
Deletes next word. | |
void | deletePreviousWord () |
Deletes previous word. | |
void | dummy () |
Does nothing but grabs some keys combinations. | |
void | endInternal () |
Moves the cursor at the end. | |
void | endInternalSelection () |
Selects until the end. | |
void | escapeHit () |
Run when escape key is pressed. | |
void | historyNext () |
Moves forward in the command history and in the history popup. | |
void | historyPrev () |
Moves backward in the command history and in the history popup. | |
void | homeInternal () |
Moves the cursor at the beginning. | |
void | homeInternalSelection () |
Selects until the beginning. | |
void | insertBold () |
Inserts bold control character. | |
void | insertColor () |
Inserts color control character. | |
void | insertIcon () |
Inserts icon control character. | |
void | insertItalic () |
Inserts italic control character. | |
void | insertPlainText () |
Inserts non-crypt (plain text) control character. | |
void | insertReset () |
Inserts reset control character. | |
void | insertReverse () |
Inserts reverse control character. | |
void | insertUnderline () |
Inserts underline control character. | |
void | nextChar () |
Moves to the next character. | |
void | nextCharSelection () |
Selects up to the next character. | |
void | nextLine () |
Scrolls the output window down one line. | |
void | nextPage () |
Scrolls the output window down one page. | |
void | nextWord () |
Moves to the end of the next word. | |
void | nextWordSelection () |
Selects up to the end of the next word. | |
void | openHistory () |
Opens the history popup. | |
void | pasteInternal () |
Pastes clipboard contents. | |
void | popupTextIconWindow () |
void | previousChar () |
Moves to the previous character. | |
void | previousCharSelection () |
Selects up to the previous character. | |
void | previousLine () |
Scrolls the output window up one line. | |
void | previousPage () |
Scrolls the output window up one page. | |
void | previousWord () |
Moves to the beginning of the previous word. | |
void | previousWordSelection () |
Selects up to the beginning of the previous word. | |
void | redoInternal () |
Redoes last action. | |
void | returnHit () |
Run when return/enter key is pressed. | |
void | scrollBottom () |
Scrolls the output window to the bottom. | |
void | scrollToLastReadLine () |
Scrolls the ircview to the last read line. | |
void | scrollTop () |
Scrolls the output window to the top. | |
void | search () |
Opens the search window. | |
void | selectAllInternal () |
Selects all. | |
void | sendKvs () |
Sends the message assuming it's kvs code. | |
void | sendPlain () |
Sends plain text, ignoring initial token starting with / (a command) | |
void | showContextPopup (const QPoint &pos) |
void | showContextPopupHere () |
void | showSpellCheckerCorrectionsPopup () |
void | spellCheckerPopupCorrectionActionTriggered () |
void | toggleCommandMode () |
Toggles the commandline's KVS/User-friendly mode. | |
void | toggleMultiLineEditor () |
Toggles the multiline editor. | |
void | undoInternal () |
Undoes last action. | |
void | zoomDefault () |
Restore the ircview font (and its size) | |
void | zoomIn () |
Increase the ircview font size. | |
void | zoomOut () |
Decrease the ircview font size. | |
Private Member Functions | |
void | addUndo (EditCommand *pCommand) |
Inserts one action in the undo stack. | |
int | charIndexFromXPosition (qreal fXPos) |
Returns the current character from a given position. | |
void | clearSelection () |
void | completion (bool bShift) |
Autocompletion function. | |
void | end () |
Moves the cursor to the end of the input line. | |
void | ensureCursorVisible () |
Makes sure that the cursor is visible. | |
void | finishInput () |
Adds the text to the history. | |
QFontMetrics * | getLastFontMetrics (const QFont &font) |
Returns the current input editor font metrics (globally shared) | |
void | getWordBeforeCursor (QString &szBuffer, bool *bIsFirstWordInLine) |
Gets the word before the cursor and puts it to the buffer. | |
void | handleDragSelection () |
Handles the drag selection. | |
bool | hasSelection () |
Returns true if the input line has focus. | |
void | home () |
Moves the cursor to the start of the input line. | |
void | internalCursorLeft (bool bShift) |
Moves the cursor one character to the left. | |
void | internalCursorRight (bool bShift) |
Moves the cursor one character to the right. | |
bool | isRedoAvailable () const |
Returns true is there are some action in the redo stack. | |
bool | isUndoAvailable () const |
Returns true is there are some action in the undo stack. | |
void | killDragTimer () |
Kills the drag timer. | |
void | moveCursorTo (int iIdx, bool bRepaint=true) |
Moves the cursor to the specified position. | |
void | repaintWithCursorOn () |
Repaints the input line with the visible cursor. | |
int | replaceSegment (int iStart, int iLength, const QString &szString) |
Replace characters in the buffer. | |
void | replaceWordBeforeCursor (const QString &szWord, const QString &szReplacement, bool bRepaint=true) |
Replaces the word before the cursor. | |
void | returnPressed (bool bRepaint=true) |
Submits input. | |
void | standardNickCompletion (bool bAddMask, QString &szWord, bool bFirstWordInLine, bool bInCommand) |
Completes the nickname specified by szWord (inserts the completed text to the input line) | |
void | standardNickCompletionInsertCompletedText (const QString &szReplacedWord, QString szCompletedText, bool bFirstWordInLine, bool bInCommand) |
Internal helper for standardNickCompletion() | |
qreal | xPositionFromCharIndex (int iChIdx) |
Returns the current position from a given character. | |
Static Private Member Functions | |
static QChar | getSubstituteChar (unsigned short uControlCode) |
Gets the substitute character for control codes. | |
Friends | |
class | KviTextIconWindow |
class | KviTopicWidget |
Input editor class.
KviInputEditor::KviInputEditor | ( | QWidget * | pPar, |
KviWindow * | pWnd, | ||
KviUserListView * | pView = nullptr ) |
Constructs the input editor object.
pPar | The parent widget |
pWnd | The KviWindow object |
pView | The userlist |
KviInputEditor::KviInputEditor | ( | QWidget * | pPar, |
QWidget * | pInputParent, | ||
KviWindow * | pWnd, | ||
KviUserListView * | pView = nullptr ) |
References applyOptions(), KviInputEditorPrivate::bTextBlocksDirty, connect(), KviInputEditorPrivate::fXOffset, g_iInputInstances, iconPopupActivated(), installShortcuts(), KVI_INPUT_MARGIN, KVI_INPUT_MAX_BUFFER_SIZE, m_bCursorOn, m_bIMComposing, m_bReadOnly, m_bSpSlowFlag, m_bUpdatesEnabled, m_iCurHistoryIdx, m_iCursorPosition, m_iCursorTimer, m_iDragTimer, m_iIMLength, m_iIMSelectionBegin, m_iIMSelectionLength, m_iIMStart, m_iMaxBufferSize, m_iSelectionAnchorChar, m_iSelectionBegin, m_iSelectionEnd, m_iSpellCheckPosition, m_p, m_pIconMenu, m_pInputParent, m_pKviWindow, m_pUserListView, and KviInputEditorPrivate::szFontElision.
KviInputEditor::~KviInputEditor | ( | ) |
Destroys the Input editor object.
References clearUndoStack(), g_iInputInstances, g_pLastFontMetrics, killDragTimer(), KviInputEditorPrivate::lTextBlocks, m_iCursorTimer, m_p, and m_pIconMenu.
|
privateslot |
Adds line to input history
References KVI_INPUT_MAX_LOCAL_HISTORY_ENTRIES, and m_History.
Referenced by finishInput(), sendKvs(), and sendPlain().
|
private |
Inserts one action in the undo stack.
pCommand | The command representing the action |
References KVI_INPUT_MAX_UNDO_SIZE, and m_UndoStack.
Referenced by backspaceHit(), clear(), cut(), insertChar(), insertText(), removeSelected(), replaceSegment(), and setText().
void KviInputEditor::applyOptions | ( | bool | bRefreshCachedMetrics = true | ) |
Applies the options and update.
References g_pLastFontMetrics, getLastFontMetrics(), KVI_OPTION_BOOL, KVI_OPTION_FONT, KVI_OPTION_UINT, KviOption_boolEnableCustomCursorWidth, KviOption_fontInput, KviOption_uintCustomCursorWidth, and m_iCursorWidth.
Referenced by KviInput::applyOptions(), and KviInputEditor().
|
privateslot |
Run when backspace key is pressed.
References addUndo(), KviInputEditorPrivate::bTextBlocksDirty, clearSelection(), ensureCursorVisible(), hasSelection(), INPUT_ISLOWSURROGATE, m_bReadOnly, m_iCursorPosition, m_iSelectionBegin, m_iSelectionEnd, m_p, m_szTextBuffer, KviInputEditor::EditCommand::RemoveText, and repaintWithCursorOn().
Referenced by keyPressEvent().
|
private |
Returns the current character from a given position.
iXPos | The position to grab |
References KviInputEditorPrivate::bTextBlocksDirty, KviInputEditorTextBlock::fWidth, KviInputEditorPrivate::fXOffset, getLastFontMetrics(), KviInputEditorTextBlock::iLength, INPUT_ISHIGHSURROGATE, KVI_INPUT_MARGIN, KviInputEditorPrivate::lTextBlocks, m_p, p, rebuildTextBlocks(), and KviInputEditorTextBlock::szText.
Referenced by handleDragSelection(), mouseDoubleClickEvent(), mousePressEvent(), and showContextPopup().
|
protected |
References KviKvsVariant::asBoolean(), KviKvsScript::evaluate(), KviWindow::isChannel(), KviChannelWindow::isOn(), and m_pKviWindow.
Referenced by splitTextIntoSpellCheckerBlocks().
|
slot |
Clears the input line.
References addUndo(), KviInputEditorPrivate::bTextBlocksDirty, clearSelection(), home(), m_p, m_szTextBuffer, and KviInputEditor::EditCommand::RemoveText.
Referenced by showContextPopup(), and toggleMultiLineEditor().
|
private |
References KviInputEditorPrivate::bTextBlocksDirty, m_iSelectionBegin, m_iSelectionEnd, and m_p.
Referenced by backspaceHit(), clear(), cut(), deleteHit(), endInternal(), handleDragSelection(), historyNext(), historyPrev(), homeInternal(), insertChar(), internalCursorLeft(), internalCursorRight(), mousePressEvent(), removeSelected(), replaceWordBeforeCursor(), setText(), and standardNickCompletion().
void KviInputEditor::clearUndoStack | ( | ) |
Clears the undo stack.
References m_RedoStack, and m_UndoStack.
Referenced by KviInput::inputEditorEnterPressed(), and ~KviInputEditor().
|
private |
Autocompletion function.
To autocomplete, this function looks for a nickname, a directory, or a nickname.
bShift | Whether to complete with the mask of the nickname |
References __tr2qs, a, KviConsoleWindow::completeChannel(), KviKvsKernel::completeCommand(), KviApplication::completeDirectory(), KviKvsKernel::completeFunction(), KviUserListView::completeNickBashLike(), KviConsoleWindow::completeServer(), completionEscapeUnsafeToken(), KviWindow::console(), KviQString::equalCI(), KviQString::equalCIN(), g_pApp, getWordBeforeCursor(), KviKvsKernel::instance(), KVI_OPTION_BOOL, KVI_OPTION_STRING, KVI_OUT_SYSTEMMESSAGE, KviOption_boolBashLikeNickCompletion, KviOption_boolUseNickCompletionPostfixForFirstWordOnly, KviOption_boolZshLikeNickCompletion, KviOption_stringNickCompletionPostfix, m_pKviWindow, m_pUserListView, m_szLastCompletedNick, m_szTextBuffer, KviWindow::output(), KviWindow::outputNoFmt(), repaintWithCursorOn(), replaceWordBeforeCursor(), standardNickCompletion(), and KviWindow::windowName().
Referenced by keyPressEvent().
|
protected |
References KviQString::escapeKvs(), KviQString::EscapeSpace, and m_pInputParent.
Referenced by completion(), and standardNickCompletionInsertCompletedText().
|
privateslot |
|
slot |
Copies the text to the system clipboard.
References hasSelection(), m_iSelectionBegin, m_iSelectionEnd, m_szTextBuffer, and repaintWithCursorOn().
Referenced by copyInternal(), and showContextPopup().
|
slot |
Copies the text to the system clipboard.
If the system supports the mouse clipboard, the text will be copied there
bDonNotCopyToClipboard | Whether to copy the text to the system clipboard |
References hasSelection(), m_iSelectionBegin, m_iSelectionEnd, m_szTextBuffer, and repaintWithCursorOn().
Referenced by mouseReleaseEvent().
|
slot |
Cuts the selection from the input line.
References addUndo(), KviInputEditorPrivate::bTextBlocksDirty, clearSelection(), hasSelection(), m_iSelectionBegin, m_iSelectionEnd, m_p, m_szTextBuffer, moveCursorTo(), KviInputEditor::EditCommand::RemoveText, and repaintWithCursorOn().
Referenced by cutInternal(), and showContextPopup().
|
privateslot |
|
privateslot |
Run when delete key is pressed.
References KviInputEditorPrivate::bTextBlocksDirty, clearSelection(), ensureCursorVisible(), hasSelection(), INPUT_ISHIGHSURROGATE, m_bReadOnly, m_iCursorPosition, m_p, m_szTextBuffer, removeSelected(), and repaintWithCursorOn().
Referenced by keyPressEvent().
|
privateslot |
Deletes next word.
References KviInputEditorPrivate::bTextBlocksDirty, hasSelection(), m_bReadOnly, m_iCursorPosition, m_p, m_szTextBuffer, removeSelected(), and repaintWithCursorOn().
Referenced by installShortcuts().
|
privateslot |
Deletes previous word.
References KviInputEditorPrivate::bTextBlocksDirty, hasSelection(), m_bReadOnly, m_iCursorPosition, m_p, m_szTextBuffer, removeSelected(), and repaintWithCursorOn().
Referenced by installShortcuts().
|
overrideprotected |
References e.
|
protectedvirtual |
References KviInputEditorPrivate::bTextBlocksDirty, KviInputEditorTextBlock::fWidth, KviInputEditorPrivate::fXOffset, getLastFontMetrics(), getMircColor(), KviInputEditorTextBlock::IsBold, KviInputEditorTextBlock::IsControlBlock, KviInputEditorTextBlock::IsItalic, KviInputEditorTextBlock::IsSelected, KviInputEditorTextBlock::IsSpellingMistake, KviInputEditorTextBlock::IsUnderline, KVI_EXTCOLOR_MAX, KVI_INPUT_DEF_BACK, KVI_INPUT_DEF_FORE, KVI_INPUT_MARGIN, KVI_INPUT_XTRAPADDING, KVI_OPTION_COLOR, KviOption_colorInputBackground, KviOption_colorInputControl, KviOption_colorInputCursor, KviOption_colorInputForeground, KviOption_colorInputSelectionBackground, KviOption_colorInputSelectionForeground, KviInputEditorPrivate::lTextBlocks, m_bCursorOn, m_bIMComposing, m_iCursorPosition, m_iCursorWidth, m_iIMLength, m_iIMSelectionBegin, m_iIMSelectionLength, m_iIMStart, m_p, p, rebuildTextBlocks(), KviInputEditorTextBlock::szText, KviInputEditorTextBlock::uBackground, KviInputEditorTextBlock::uFlags, KviInputEditorTextBlock::uForeground, and xPositionFromCharIndex().
Referenced by paintEvent().
|
overrideprotected |
|
privateslot |
Does nothing but grabs some keys combinations.
Referenced by installShortcuts().
|
private |
Moves the cursor to the end of the input line.
References ensureCursorVisible(), m_iCursorPosition, m_szTextBuffer, and repaintWithCursorOn().
Referenced by endInternal(), endInternalSelection(), historyNext(), historyPrev(), selectAll(), and setText().
|
privateslot |
Moves the cursor at the end.
References clearSelection(), and end().
Referenced by installShortcuts().
|
privateslot |
Selects until the end.
References KviInputEditorPrivate::bTextBlocksDirty, end(), m_iCursorPosition, m_iSelectionBegin, m_iSelectionEnd, m_p, and m_szTextBuffer.
Referenced by installShortcuts().
|
private |
Makes sure that the cursor is visible.
References KviInputEditorPrivate::fXOffset, KVI_INPUT_MARGIN, m_iCursorPosition, m_p, m_szTextBuffer, and xPositionFromCharIndex().
Referenced by backspaceHit(), deleteHit(), end(), handleDragSelection(), home(), insertChar(), internalCursorLeft(), internalCursorRight(), moveCursorTo(), and sendPlain().
|
signal |
|
privateslot |
Run when escape key is pressed.
References escapePressed(), finishInput(), and setText().
Referenced by installShortcuts().
|
signal |
|
protected |
References __tr2qs, KviKvsArrayCast::array(), KviKvsVariant::asString(), KviKvsArray::at(), KviInputEditorSpellCheckerBlock::bSpellCheckable, KviKvsVariant::castToArray(), KviKvsScript::evaluate(), findSpellCheckerBlockAtCursor(), g_pInputPopup, i, m_SpellCheckerPopup, m_szTextBuffer, pArray, s, KviKvsArray::size(), spellCheckerPopupCorrectionActionTriggered(), splitTextIntoSpellCheckerBlocks(), KviInputEditorSpellCheckerBlock::szText, and v.
Referenced by showContextPopup(), and showSpellCheckerCorrectionsPopup().
|
protected |
References m_iSpellCheckPosition.
Referenced by fillSpellCheckerCorrectionsPopup(), showContextPopup(), and spellCheckerPopupCorrectionActionTriggered().
|
private |
Adds the text to the history.
Called when the user is done editing the current input line (either by submitting or clearing it). Adds the content (if any) to the history, and hides helper windows.
References KviInputHistory::add(), addToHistory(), g_pColorWindow, KviInputHistory::instance(), m_iCurHistoryIdx, m_pInputParent, and m_szTextBuffer.
Referenced by escapeHit(), and returnPressed().
|
overrideprotected |
References e, KVI_INPUT_BLINK_TIME, m_bCursorOn, and m_iCursorTimer.
|
overrideprotected |
References e, m_bCursorOn, and m_iCursorTimer.
|
private |
Returns the current input editor font metrics (globally shared)
font | The current input editor font |
References KviInputEditorPrivate::fFontElisionWidth, g_iCachedHeight, g_pLastFontMetrics, h, KVI_INPUT_MARGIN, KVI_INPUT_XTRAPADDING, m_p, KviInputEditorPrivate::szFontElision, and w.
Referenced by applyOptions(), charIndexFromXPosition(), drawContents(), rebuildTextBlocks(), and xPositionFromCharIndex().
|
staticprivate |
Gets the substitute character for control codes.
uControlCode | The control code inserted |
References KviControlCodes::Bold, KviControlCodes::CryptEscape, KviControlCodes::Icon, KviControlCodes::Italic, KviControlCodes::Monospace, KviControlCodes::Reset, KviControlCodes::Reverse, and KviControlCodes::Underline.
Referenced by rebuildTextBlocks().
|
private |
Gets the word before the cursor and puts it to the buffer.
szBuffer | The buffer where to put the word got |
bIsFirstWordInLine | Returns true if the word is the first |
References m_iCursorPosition, m_szTextBuffer, and szBuffer.
Referenced by completion(), and standardNickCompletion().
|
private |
Handles the drag selection.
References KviInputEditorPrivate::bTextBlocksDirty, charIndexFromXPosition(), clearSelection(), ensureCursorVisible(), m_iCursorPosition, m_iSelectionAnchorChar, m_iSelectionBegin, m_iSelectionEnd, m_p, m_szTextBuffer, and repaintWithCursorOn().
Referenced by timerEvent().
|
private |
Returns true if the input line has focus.
References m_iSelectionBegin, and m_iSelectionEnd.
Referenced by backspaceHit(), copyToClipboard(), copyToSelection(), cut(), deleteHit(), deleteNextWord(), deletePreviousWord(), mouseReleaseEvent(), removeSelected(), and showContextPopup().
int KviInputEditor::heightHint | ( | ) | const |
Returns the height of the editor.
References g_iCachedHeight.
Referenced by KviInput::heightHint(), and showContextPopupHere().
|
privateslot |
Moves forward in the command history and in the history popup.
References KviInputEditorPrivate::bTextBlocksDirty, clearSelection(), end(), home(), KVI_OPTION_BOOL, KviOption_boolInputHistoryCursorAtEnd, m_bReadOnly, m_History, m_iCurHistoryIdx, m_p, m_szSaveTextBuffer, and m_szTextBuffer.
Referenced by installShortcuts().
|
privateslot |
Moves backward in the command history and in the history popup.
References KviInputEditorPrivate::bTextBlocksDirty, clearSelection(), end(), home(), KVI_OPTION_BOOL, KviOption_boolInputHistoryCursorAtEnd, m_bReadOnly, m_History, m_iCurHistoryIdx, m_p, m_szSaveTextBuffer, and m_szTextBuffer.
Referenced by installShortcuts().
|
private |
Moves the cursor to the start of the input line.
References ensureCursorVisible(), m_iCursorPosition, and repaintWithCursorOn().
Referenced by clear(), historyNext(), historyPrev(), homeInternal(), homeInternalSelection(), and KviTopicWidget::switchMode().
|
privateslot |
Moves the cursor at the beginning.
References clearSelection(), home(), and m_iCursorPosition.
Referenced by installShortcuts().
|
privateslot |
Selects until the beginning.
References KviInputEditorPrivate::bTextBlocksDirty, home(), m_iCursorPosition, m_iSelectionBegin, m_iSelectionEnd, and m_p.
Referenced by installShortcuts().
|
slot |
Opens the icon popup with icon description.
iId | The id of the icon |
References KviControlCodes::Icon, insertText(), and m_bReadOnly.
Referenced by KviInputEditor().
|
overrideprotected |
|
overrideprotected |
|
privateslot |
Inserts bold control character.
References KviControlCodes::Bold, insertChar(), and m_bReadOnly.
Referenced by installShortcuts().
void KviInputEditor::insertChar | ( | QChar | c | ) |
Inserts a character at the current position.
c | The character to insert |
References addUndo(), KviInputEditorPrivate::bTextBlocksDirty, clearSelection(), ensureCursorVisible(), KviInputEditor::EditCommand::InsertText, m_bUpdatesEnabled, m_iCursorPosition, m_iMaxBufferSize, m_iSelectionBegin, m_iSelectionEnd, m_p, m_szTextBuffer, removeSelected(), and repaintWithCursorOn().
Referenced by insertBold(), KviInput::insertChar(), insertColor(), insertIcon(), insertIconCode(), insertItalic(), insertPlainText(), insertReset(), insertReverse(), insertUnderline(), and keyReleaseEvent().
|
privateslot |
Inserts color control character.
References g_pColorWindow, insertChar(), m_bReadOnly, m_iCursorPosition, KviColorWindow::popup(), and xPositionFromCharIndex().
Referenced by installShortcuts().
|
privateslot |
Inserts icon control character.
References KviControlCodes::Icon, insertChar(), m_bReadOnly, and popupTextIconWindow().
Referenced by installShortcuts().
|
protected |
References KviControlCodes::Icon, insertChar(), insertText(), m_iCursorPosition, and m_szTextBuffer.
|
privateslot |
Inserts italic control character.
References insertChar(), KviControlCodes::Italic, and m_bReadOnly.
Referenced by installShortcuts().
|
privateslot |
Inserts non-crypt (plain text) control character.
References KviControlCodes::CryptEscape, insertChar(), and m_bReadOnly.
Referenced by installShortcuts().
|
privateslot |
Inserts reset control character.
References insertChar(), m_bReadOnly, and KviControlCodes::Reset.
Referenced by installShortcuts().
|
privateslot |
Inserts reverse control character.
References insertChar(), m_bReadOnly, and KviControlCodes::Reverse.
Referenced by installShortcuts().
void KviInputEditor::insertText | ( | const QString & | szTxt | ) |
Inserts the text at the current position.
szTxt | The text to insert |
References addUndo(), KviInputEditorPrivate::bTextBlocksDirty, KviInputEditor::EditCommand::InsertText, KVI_OPTION_UINT, KviOption_uintSpacesToExpandTabulationInput, m_bUpdatesEnabled, m_iCursorPosition, m_iMaxBufferSize, m_p, m_szTextBuffer, moveCursorTo(), removeSelected(), and returnPressed().
Referenced by dropEvent(), iconPopupActivated(), insertIconCode(), KviInput::insertText(), KviTopicWidget::insertText(), keyPressEvent(), pasteClipboardWithConfirmation(), pasteSelectionWithConfirmation(), and spellCheckerPopupCorrectionActionTriggered().
|
privateslot |
Inserts underline control character.
References insertChar(), m_bReadOnly, and KviControlCodes::Underline.
Referenced by installShortcuts().
|
protected |
References copyInternal(), KviShortcut::create(), cutInternal(), deleteNextWord(), deletePreviousWord(), dummy(), endInternal(), endInternalSelection(), escapeHit(), historyNext(), historyPrev(), homeInternal(), homeInternalSelection(), insertBold(), insertColor(), insertIcon(), insertItalic(), insertPlainText(), insertReset(), insertReverse(), insertUnderline(), KVI_SHORTCUTS_INPUT_BOLD, KVI_SHORTCUTS_INPUT_COLOR, KVI_SHORTCUTS_INPUT_COMMANDLINE, KVI_SHORTCUTS_INPUT_COPY, KVI_SHORTCUTS_INPUT_CORRECT_SPELLING, KVI_SHORTCUTS_INPUT_CUT, KVI_SHORTCUTS_INPUT_DELETE_NEXT_WORD, KVI_SHORTCUTS_INPUT_DELETE_PREV_WORD, KVI_SHORTCUTS_INPUT_DUMMY, KVI_SHORTCUTS_INPUT_END, KVI_SHORTCUTS_INPUT_END_SELECT, KVI_SHORTCUTS_INPUT_ESCAPE, KVI_SHORTCUTS_INPUT_HISTORY, KVI_SHORTCUTS_INPUT_HISTORY_NEXT, KVI_SHORTCUTS_INPUT_HISTORY_PREV, KVI_SHORTCUTS_INPUT_HOME, KVI_SHORTCUTS_INPUT_HOME_SELECT, KVI_SHORTCUTS_INPUT_ICON, KVI_SHORTCUTS_INPUT_ITALIC, KVI_SHORTCUTS_INPUT_MENU, KVI_SHORTCUTS_INPUT_NEXT_CHAR, KVI_SHORTCUTS_INPUT_NEXT_CHAR_SELECT, KVI_SHORTCUTS_INPUT_NEXT_WORD, KVI_SHORTCUTS_INPUT_NEXT_WORD_SELECT, KVI_SHORTCUTS_INPUT_PASTE, KVI_SHORTCUTS_INPUT_PLAINTEXT, KVI_SHORTCUTS_INPUT_PREV_CHAR, KVI_SHORTCUTS_INPUT_PREV_CHAR_SELECT, KVI_SHORTCUTS_INPUT_PREV_WORD, KVI_SHORTCUTS_INPUT_PREV_WORD_SELECT, KVI_SHORTCUTS_INPUT_REDO, KVI_SHORTCUTS_INPUT_RESET, KVI_SHORTCUTS_INPUT_REVERSE, KVI_SHORTCUTS_INPUT_SELECT_ALL, KVI_SHORTCUTS_INPUT_SEND_PLAIN, KVI_SHORTCUTS_INPUT_SEND_PLAIN_2, KVI_SHORTCUTS_INPUT_UNDERLINE, KVI_SHORTCUTS_INPUT_UNDO, KVI_SHORTCUTS_WIN_END, KVI_SHORTCUTS_WIN_HOME, KVI_SHORTCUTS_WIN_NEXT_LINE, KVI_SHORTCUTS_WIN_NEXT_PAGE, KVI_SHORTCUTS_WIN_PREV_LINE, KVI_SHORTCUTS_WIN_PREV_PAGE, KVI_SHORTCUTS_WIN_SCROLL_TO_LAST_READ_LINE, KVI_SHORTCUTS_WIN_SEARCH, KVI_SHORTCUTS_WIN_ZOOM_DEFAULT, KVI_SHORTCUTS_WIN_ZOOM_IN, KVI_SHORTCUTS_WIN_ZOOM_OUT, nextChar(), nextCharSelection(), nextLine(), nextPage(), nextWord(), nextWordSelection(), openHistory(), pasteInternal(), previousChar(), previousCharSelection(), previousLine(), previousPage(), previousWord(), previousWordSelection(), redoInternal(), scrollBottom(), scrollToLastReadLine(), scrollTop(), search(), selectAllInternal(), sendPlain(), showContextPopupHere(), showSpellCheckerCorrectionsPopup(), toggleCommandMode(), undoInternal(), zoomDefault(), zoomIn(), and zoomOut().
Referenced by KviInputEditor().
|
private |
Moves the cursor one character to the left.
bShift | Whether to shift the selection |
References KviInputEditorPrivate::bTextBlocksDirty, clearSelection(), ensureCursorVisible(), INPUT_ISLOWSURROGATE, m_iCursorPosition, m_iSelectionBegin, m_iSelectionEnd, m_p, and m_szTextBuffer.
Referenced by previousChar(), previousCharSelection(), previousWord(), and previousWordSelection().
|
private |
Moves the cursor one character to the right.
bShift | Whether to shift the selection |
References KviInputEditorPrivate::bTextBlocksDirty, clearSelection(), ensureCursorVisible(), INPUT_ISHIGHSURROGATE, m_iCursorPosition, m_iSelectionBegin, m_iSelectionEnd, m_p, and m_szTextBuffer.
Referenced by nextChar(), nextCharSelection(), nextWord(), and nextWordSelection().
|
inline |
Returns true if the input line is in read only state.
Referenced by KviTopicWidget::acceptClicked().
|
inlineprivate |
Returns true is there are some action in the redo stack.
Referenced by redo(), and showContextPopup().
|
inlineprivate |
Returns true is there are some action in the undo stack.
Referenced by showContextPopup(), and undo().
|
overrideprotected |
References backspaceHit(), completion(), deleteHit(), e, insertText(), m_bIMComposing, m_bLastCompletionFinished, m_bReadOnly, m_szAltKeyCode, and returnHit().
|
overrideprotected |
References e, KviCString::hasData(), insertChar(), m_szAltKeyCode, and KviCString::toUShort().
|
private |
Kills the drag timer.
References m_iDragTimer.
Referenced by mouseDoubleClickEvent(), mousePressEvent(), mouseReleaseEvent(), and ~KviInputEditor().
|
overrideprotected |
|
overrideprotected |
|
overrideprotected |
References copyToSelection(), hasSelection(), killDragTimer(), m_iDragTimer, and m_iSelectionAnchorChar.
|
private |
Moves the cursor to the specified position.
iIdx | The index of the character to move the cursor to |
bRepaint | Whether to repaint the input line |
References ensureCursorVisible(), m_iCursorPosition, m_szTextBuffer, and repaintWithCursorOn().
Referenced by cut(), inputMethodEvent(), insertText(), mouseDoubleClickEvent(), redo(), removeSelected(), replaceWordBeforeCursor(), and undo().
|
privateslot |
Moves to the next character.
References internalCursorRight(), and repaintWithCursorOn().
Referenced by installShortcuts().
|
privateslot |
Selects up to the next character.
References internalCursorRight(), m_iCursorPosition, m_szTextBuffer, and repaintWithCursorOn().
Referenced by installShortcuts().
|
privateslot |
Scrolls the output window down one line.
References KviWindow::lastClickedView(), m_pKviWindow, and KviIrcView::nextLine().
Referenced by installShortcuts().
|
privateslot |
Scrolls the output window down one page.
References KviWindow::lastClickedView(), m_pKviWindow, and KviIrcView::nextPage().
Referenced by installShortcuts().
|
privateslot |
Moves to the end of the next word.
References internalCursorRight(), m_iCursorPosition, m_szTextBuffer, and repaintWithCursorOn().
Referenced by installShortcuts().
|
privateslot |
Selects up to the end of the next word.
References internalCursorRight(), m_iCursorPosition, m_szTextBuffer, and repaintWithCursorOn().
Referenced by installShortcuts().
|
privateslot |
Opens the history popup.
References KVI_OPTION_BOOL, KviOption_boolEnableInputHistory, and m_pInputParent.
Referenced by installShortcuts().
|
overrideprotected |
References drawContents(), KviPixmapUtils::drawPixmapWithPainter(), g_pApp, g_pMainWindow, KviWindow::isDocked(), KVI_OPTION_BOOL, KVI_OPTION_COLOR, KVI_OPTION_PIXMAP, KVI_OPTION_UINT, KviOption_boolUseCompositingForTransparency, KviOption_colorGlobalTransparencyFade, KviOption_colorInputBackground, KviOption_pixmapInputBackground, KviOption_uintGlobalTransparencyChildFadeFactor, KviOption_uintInputPixmapAlign, m_pKviWindow, p, r, and KviApplication::supportsCompositing().
|
slot |
Pastes the text to the system clipboard.
References KviWindow::id(), insertText(), KviEvent_OnInputBarPaste, KVS_TRIGGER_EVENT_2_HALTED, m_pInputParent, and m_pKviWindow.
Referenced by pasteInternal(), and showContextPopup().
|
slot |
Pastes a file to the buffer.
References KviQString::escapeKvs(), KviQString::EscapeSpace, g_pActiveWindow, m_bSpSlowFlag, and KviKvsScript::run().
Referenced by showContextPopup().
|
privateslot |
Pastes clipboard contents.
References m_bReadOnly, and pasteClipboardWithConfirmation().
Referenced by installShortcuts().
|
slot |
Pastes the text to the system clipboard.
If the system supports the mouse clipboard, the text will be copied there
References KviWindow::id(), insertText(), KviEvent_OnInputBarPaste, KVS_TRIGGER_EVENT_2_HALTED, m_pInputParent, and m_pKviWindow.
Referenced by mousePressEvent().
|
slot |
Starts a slow paste in the buffer.
References g_pActiveWindow, m_bSpSlowFlag, and KviKvsScript::run().
Referenced by showContextPopup().
|
privateslot |
Shows the text icon window at cursor position
References g_pTextIconWindow, KVI_TEXTICON_WIN_HEIGHT, KviTextIconWindow, m_bReadOnly, m_iCursorPosition, KviTextIconWindow::popup(), and xPositionFromCharIndex().
Referenced by insertIcon(), and showContextPopup().
|
privateslot |
Moves to the previous character.
References internalCursorLeft(), and repaintWithCursorOn().
Referenced by installShortcuts().
|
privateslot |
Selects up to the previous character.
References internalCursorLeft(), m_iCursorPosition, and repaintWithCursorOn().
Referenced by installShortcuts().
|
privateslot |
Scrolls the output window up one line.
References KviWindow::lastClickedView(), m_pKviWindow, and KviIrcView::prevLine().
Referenced by installShortcuts().
|
privateslot |
Scrolls the output window up one page.
References KviWindow::lastClickedView(), m_pKviWindow, and KviIrcView::prevPage().
Referenced by installShortcuts().
|
privateslot |
Moves to the beginning of the previous word.
References internalCursorLeft(), m_iCursorPosition, m_szTextBuffer, and repaintWithCursorOn().
Referenced by installShortcuts().
|
privateslot |
Selects up to the beginning of the previous word.
References internalCursorLeft(), m_iCursorPosition, m_szTextBuffer, and repaintWithCursorOn().
Referenced by installShortcuts().
|
protected |
References ADD_SPELLCHECKER_BLOCK, KviControlCodes::Bold, KviInputEditorPrivate::bTextBlocksDirty, KviControlCodes::CryptEscape, e, KviInputEditorTextBlock::fWidth, getLastFontMetrics(), getSubstituteChar(), KviControlCodes::getUnicodeColorBytes(), KviControlCodes::Icon, KviInputEditorTextBlock::iLength, KviInputEditorTextBlock::IsBold, KviInputEditorTextBlock::IsControlBlock, KviInputEditorTextBlock::IsItalic, KviInputEditorTextBlock::IsMonospace, KviInputEditorTextBlock::IsSelected, KviInputEditorTextBlock::IsSpellingMistake, KviInputEditorTextBlock::IsUnderline, KviControlCodes::Italic, KVI_INPUT_DEF_BACK, KVI_INPUT_DEF_FORE, KviInputEditorPrivate::lTextBlocks, m_iSelectionBegin, m_iSelectionEnd, m_p, m_szTextBuffer, KviControlCodes::Monospace, KviControlCodes::NoChange, NOT_CONTROL_CHAR, p, KviControlCodes::Reset, KviControlCodes::Reverse, splitTextIntoSpellCheckerBlocks(), KviInputEditorTextBlock::szText, KviInputEditorTextBlock::uBackground, KviInputEditorTextBlock::uFlags, KviInputEditorTextBlock::uForeground, and KviControlCodes::Underline.
Referenced by charIndexFromXPosition(), drawContents(), and xPositionFromCharIndex().
|
slot |
Redo the last undo-ed action.
References KviInputEditorPrivate::bTextBlocksDirty, KviInputEditor::EditCommand::InsertText, isRedoAvailable(), KVI_INPUT_MAX_UNDO_SIZE, m_iSelectionBegin, m_iSelectionEnd, m_p, m_RedoStack, m_szTextBuffer, m_UndoStack, moveCursorTo(), and KviInputEditor::EditCommand::RemoveText.
Referenced by redoInternal(), and showContextPopup().
|
privateslot |
Redoes last action.
References m_bReadOnly, and redo().
Referenced by installShortcuts().
|
slot |
Removes the selected text.
References addUndo(), KviInputEditorPrivate::bTextBlocksDirty, clearSelection(), hasSelection(), m_iSelectionBegin, m_iSelectionEnd, m_p, m_szTextBuffer, moveCursorTo(), KviInputEditor::EditCommand::RemoveText, and repaintWithCursorOn().
Referenced by deleteHit(), deleteNextWord(), deletePreviousWord(), inputMethodEvent(), insertChar(), and insertText().
|
private |
Repaints the input line with the visible cursor.
References m_bCursorOn, and m_bUpdatesEnabled.
Referenced by backspaceHit(), completion(), copyToClipboard(), copyToSelection(), cut(), deleteHit(), deleteNextWord(), deletePreviousWord(), end(), handleDragSelection(), home(), inputMethodEvent(), insertChar(), mousePressEvent(), moveCursorTo(), nextChar(), nextCharSelection(), nextWord(), nextWordSelection(), previousChar(), previousCharSelection(), previousWord(), previousWordSelection(), removeSelected(), replaceSegment(), replaceWordBeforeCursor(), selectAllInternal(), sendKvs(), and sendPlain().
|
private |
Replace characters in the buffer.
Returns the length of the text inserted (different from text.length() only if the buffer was truncated.
iStart | The starting character |
iLength | The length of the string to replace |
szString | The string to replace with |
References addUndo(), KviInputEditorPrivate::bTextBlocksDirty, KviInputEditor::EditCommand::InsertText, m_iMaxBufferSize, m_p, m_szTextBuffer, and repaintWithCursorOn().
Referenced by inputMethodEvent().
|
private |
Replaces the word before the cursor.
szWord | The word to replace |
szReplacement | The new word to use |
bRepaint | Whether to repain the input line |
References KviInputEditorPrivate::bTextBlocksDirty, clearSelection(), m_iCursorPosition, m_iMaxBufferSize, m_p, m_szTextBuffer, moveCursorTo(), and repaintWithCursorOn().
Referenced by completion(), and standardNickCompletionInsertCompletedText().
|
privateslot |
Run when return/enter key is pressed.
References returnPressed().
Referenced by keyPressEvent().
|
private |
Submits input.
Triggered when the user press return
bRepaint | Whether to repain the input line |
References enterPressed(), and finishInput().
Referenced by insertText(), and returnHit().
|
privateslot |
Scrolls the output window to the bottom.
References KviWindow::lastClickedView(), m_pKviWindow, and KviIrcView::scrollBottom().
Referenced by installShortcuts().
|
privateslot |
Scrolls the ircview to the last read line.
References KviIrcView::hasLineMark(), KviWindow::lastClickedView(), m_pKviWindow, and KviIrcView::scrollToMarker().
Referenced by installShortcuts().
|
privateslot |
Scrolls the output window to the top.
References KviWindow::lastClickedView(), m_pKviWindow, and KviIrcView::scrollTop().
Referenced by installShortcuts().
|
privateslot |
Opens the search window.
References KviWindow::lastClickedView(), m_pKviWindow, and KviIrcView::toggleToolWidget().
Referenced by installShortcuts().
|
slot |
Selects all text in the input line.
References KviInputEditorPrivate::bTextBlocksDirty, end(), m_iSelectionBegin, m_iSelectionEnd, m_p, and m_szTextBuffer.
Referenced by showContextPopup().
|
privateslot |
Selects all.
References KviInputEditorPrivate::bTextBlocksDirty, m_iCursorPosition, m_iSelectionBegin, m_iSelectionEnd, m_p, m_szTextBuffer, and repaintWithCursorOn().
Referenced by installShortcuts().
|
privateslot |
Sends the message assuming it's kvs code.
References KviInputHistory::add(), addToHistory(), KviInputEditorPrivate::bTextBlocksDirty, g_pColorWindow, KviInputHistory::instance(), m_iCurHistoryIdx, m_iCursorPosition, m_iSelectionBegin, m_iSelectionEnd, m_p, m_pInputParent, m_pKviWindow, m_szTextBuffer, KviUserInput::parseCommand(), repaintWithCursorOn(), and szBuffer.
|
privateslot |
Sends plain text, ignoring initial token starting with / (a command)
References KviInputHistory::add(), addToHistory(), KviInputEditorPrivate::bTextBlocksDirty, ensureCursorVisible(), g_pColorWindow, KviInputHistory::instance(), m_iCurHistoryIdx, m_iCursorPosition, m_iSelectionBegin, m_iSelectionEnd, m_p, m_pInputParent, m_pKviWindow, m_szTextBuffer, KviUserInput::parseNonCommand(), repaintWithCursorOn(), and szBuffer.
Referenced by installShortcuts().
|
inline |
Sets the maximum buffer size.
iSize | The size of the buffer to set |
Referenced by KviTopicWidget::switchMode().
|
inline |
Sets the read only state for the input line.
bReadOnly | Whether to set the read only state |
Referenced by KviTopicWidget::KviTopicWidget(), and KviTopicWidget::switchMode().
void KviInputEditor::setText | ( | const QString | szText | ) |
Sets the text in the input line.
szText | The text to set |
References addUndo(), KviInputEditorPrivate::bTextBlocksDirty, clearSelection(), end(), m_iMaxBufferSize, m_p, m_szTextBuffer, and KviInputEditor::EditCommand::RemoveText.
Referenced by KviTopicWidget::complete(), escapeHit(), KviInput::inputEditorEnterPressed(), KviInput::multiLineEditorButtonToggled(), KviInput::setText(), and KviTopicWidget::switchMode().
|
privateslot |
Shows the contextual popup menu at the global position pos
References __tr2qs, ACCEL_KEY, KviInputEditorSpellCheckerBlock::bCorrect, KviIconManager::BigGrin, KviInputEditorSpellCheckerBlock::bSpellCheckable, KviWindow::Channel, charIndexFromXPosition(), clear(), copyToClipboard(), cut(), KviWindow::DccChat, END_TABLE_BOLD_ROW, fillSpellCheckerCorrectionsPopup(), findSpellCheckerBlockAtCursor(), g_pIconManager, g_pInputPopup, KviIconManager::getSmallIcon(), hasSelection(), isRedoAvailable(), isUndoAvailable(), m_bReadOnly, m_bSpSlowFlag, m_iSpellCheckPosition, m_pKviWindow, m_SpellCheckerPopup, m_szTextBuffer, pasteClipboardWithConfirmation(), pasteFile(), pasteSlow(), popupTextIconWindow(), KviWindow::Query, redo(), selectAll(), splitTextIntoSpellCheckerBlocks(), START_TABLE_BOLD_ROW, stopPasteSlow(), KviInputEditorSpellCheckerBlock::szText, KviWindow::type(), undo(), V, Y, and Z.
Referenced by mousePressEvent(), and showContextPopupHere().
|
privateslot |
Shows the context popup menu at the current cursor position
References heightHint(), KVI_INPUT_MARGIN, KVI_INPUT_XTRAPADDING, m_iCursorPosition, showContextPopup(), and xPositionFromCharIndex().
Referenced by installShortcuts().
|
privateslot |
Show the spell checker corrections popup.
References fillSpellCheckerCorrectionsPopup(), m_iCursorPosition, m_iSpellCheckPosition, m_SpellCheckerPopup, and xPositionFromCharIndex().
Referenced by installShortcuts().
|
privateslot |
Handles spellchecker suggestions popup
References KviInputEditorPrivate::bTextBlocksDirty, findSpellCheckerBlockAtCursor(), KviInputEditorSpellCheckerBlock::iLength, insertText(), KviInputEditorSpellCheckerBlock::iStart, m_iSelectionBegin, m_iSelectionEnd, m_p, m_szTextBuffer, and splitTextIntoSpellCheckerBlocks().
Referenced by fillSpellCheckerCorrectionsPopup().
|
protected |
References ADD_SPELLCHECKER_BLOCK, checkWordSpelling(), e, and p.
Referenced by fillSpellCheckerCorrectionsPopup(), rebuildTextBlocks(), showContextPopup(), and spellCheckerPopupCorrectionActionTriggered().
|
private |
Completes the nickname specified by szWord (inserts the completed text to the input line)
bAddMask | Whether to complete with the mask of the nickname |
szWord | The nickname to complete |
bFirstWordInLine | Whether the word to complete is the first word in the text line (so the suffix from option panel is added) |
bInCommand | Whether the completion happens inside a kvs command (and thus the completed word should be kvs-escaped) |
References KviInputEditorPrivate::bTextBlocksDirty, clearSelection(), KviUserListView::completeNickStandard(), getWordBeforeCursor(), m_bLastCompletionFinished, m_iCursorPosition, m_iLastCompletionCursorPosition, m_p, m_pUserListView, m_szLastCompletedNick, m_szLastCompletionBuffer, m_szTextBuffer, standardNickCompletionInsertCompletedText(), and szBuffer.
Referenced by completion().
|
private |
Internal helper for standardNickCompletion()
szReplacedWord | The word replaced before the cursor |
szCompletedText | The text to be completed |
bFirstWordInLine | Whether the word to complete is the first word in the text line (so the suffix from option panel is added) |
bInCommand | Whether the completion happens inside a kvs command (and thus the completed word should be kvs-escaped) |
References completionEscapeUnsafeToken(), KVI_OPTION_BOOL, KVI_OPTION_STRING, KviOption_boolUseNickCompletionPostfixForFirstWordOnly, KviOption_stringNickCompletionPostfix, and replaceWordBeforeCursor().
Referenced by standardNickCompletion().
|
slot |
Stops a slow paste in the buffer.
References g_pActiveWindow, m_bSpSlowFlag, and KviKvsScript::run().
Referenced by showContextPopup().
|
inline |
Returns the text in the buffer.
Referenced by KviTopicWidget::acceptClicked(), KviInput::inputEditorEnterPressed(), KviInput::multiLineEditorButtonToggled(), KviInput::multiLinePaste(), and KviInput::text().
QString KviInputEditor::textBeforeCursor | ( | ) | const |
Returns the text before the cursor.
References m_iCursorPosition, and m_szTextBuffer.
Referenced by KviTextIconWindow::autoSelectBestMatchBasedOnOwnerText().
|
overrideprotected |
References e, handleDragSelection(), m_bCursorOn, and m_iCursorTimer.
|
privateslot |
Toggles the commandline's KVS/User-friendly mode.
References m_pInputParent.
Referenced by installShortcuts().
|
privateslot |
|
slot |
Undo the last action.
References KviInputEditorPrivate::bTextBlocksDirty, KviInputEditor::EditCommand::InsertText, isUndoAvailable(), KVI_INPUT_MAX_UNDO_SIZE, m_iSelectionBegin, m_iSelectionEnd, m_p, m_RedoStack, m_szTextBuffer, m_UndoStack, moveCursorTo(), and KviInputEditor::EditCommand::RemoveText.
Referenced by showContextPopup(), and undoInternal().
|
privateslot |
Undoes last action.
References m_bReadOnly, and undo().
Referenced by installShortcuts().
|
private |
Returns the current position from a given character.
iChIdx | Th index of the character |
References KviInputEditorPrivate::bTextBlocksDirty, KviInputEditorTextBlock::fWidth, KviInputEditorPrivate::fXOffset, getLastFontMetrics(), KviInputEditorTextBlock::iLength, KVI_INPUT_MARGIN, KviInputEditorPrivate::lTextBlocks, m_p, rebuildTextBlocks(), and KviInputEditorTextBlock::szText.
Referenced by drawContents(), ensureCursorVisible(), insertColor(), popupTextIconWindow(), showContextPopupHere(), and showSpellCheckerCorrectionsPopup().
|
privateslot |
Restore the ircview font (and its size)
References KviWindow::lastClickedView(), m_pKviWindow, and KviIrcView::resetDefaultFont().
Referenced by installShortcuts().
|
privateslot |
Increase the ircview font size.
References KviIrcView::increaseFontSize(), KviWindow::lastClickedView(), and m_pKviWindow.
Referenced by installShortcuts().
|
privateslot |
Decrease the ircview font size.
References KviIrcView::decreaseFontSize(), KviWindow::lastClickedView(), and m_pKviWindow.
Referenced by installShortcuts().
|
friend |
Referenced by popupTextIconWindow().
|
friend |
|
staticprotected |
Referenced by getLastFontMetrics(), and heightHint().
|
staticprotected |
|
staticprotected |
Referenced by KviInputEditor(), and ~KviInputEditor().
|
staticprotected |
Referenced by applyOptions(), getLastFontMetrics(), and ~KviInputEditor().
|
protected |
Referenced by drawContents(), focusInEvent(), focusOutEvent(), KviInputEditor(), repaintWithCursorOn(), and timerEvent().
|
protected |
Referenced by drawContents(), inputMethodEvent(), keyPressEvent(), and KviInputEditor().
|
protected |
Referenced by keyPressEvent(), and standardNickCompletion().
|
protected |
Referenced by backspaceHit(), cutInternal(), deleteHit(), deleteNextWord(), deletePreviousWord(), historyNext(), historyPrev(), iconPopupActivated(), inputMethodEvent(), insertBold(), insertColor(), insertIcon(), insertItalic(), insertPlainText(), insertReset(), insertReverse(), insertUnderline(), keyPressEvent(), KviInputEditor(), pasteInternal(), popupTextIconWindow(), redoInternal(), showContextPopup(), and undoInternal().
|
protected |
Referenced by KviInputEditor(), pasteFile(), pasteSlow(), showContextPopup(), and stopPasteSlow().
|
protected |
Referenced by inputMethodEvent(), insertChar(), insertText(), KviInputEditor(), and repaintWithCursorOn().
|
protected |
Referenced by addToHistory(), historyNext(), and historyPrev().
|
protected |
Referenced by finishInput(), historyNext(), historyPrev(), KviInputEditor(), sendKvs(), and sendPlain().
|
protected |
Referenced by backspaceHit(), deleteHit(), deleteNextWord(), deletePreviousWord(), drawContents(), end(), endInternalSelection(), ensureCursorVisible(), getWordBeforeCursor(), handleDragSelection(), home(), homeInternal(), homeInternalSelection(), inputMethodEvent(), insertChar(), insertColor(), insertIconCode(), insertText(), internalCursorLeft(), internalCursorRight(), KviInputEditor(), mousePressEvent(), moveCursorTo(), nextCharSelection(), nextWord(), nextWordSelection(), popupTextIconWindow(), previousCharSelection(), previousWord(), previousWordSelection(), replaceWordBeforeCursor(), selectAllInternal(), sendKvs(), sendPlain(), showContextPopupHere(), showSpellCheckerCorrectionsPopup(), standardNickCompletion(), and textBeforeCursor().
|
protected |
Referenced by focusInEvent(), focusOutEvent(), KviInputEditor(), timerEvent(), and ~KviInputEditor().
|
protected |
Referenced by applyOptions(), and drawContents().
|
protected |
Referenced by killDragTimer(), KviInputEditor(), mousePressEvent(), and mouseReleaseEvent().
|
protected |
Referenced by drawContents(), inputMethodEvent(), and KviInputEditor().
|
protected |
Referenced by drawContents(), inputMethodEvent(), and KviInputEditor().
|
protected |
Referenced by drawContents(), inputMethodEvent(), and KviInputEditor().
|
protected |
Referenced by drawContents(), inputMethodEvent(), and KviInputEditor().
|
protected |
Referenced by standardNickCompletion().
|
protected |
Referenced by insertChar(), insertText(), KviInputEditor(), replaceSegment(), replaceWordBeforeCursor(), and setText().
|
protected |
Referenced by handleDragSelection(), KviInputEditor(), mousePressEvent(), and mouseReleaseEvent().
|
protected |
Referenced by backspaceHit(), clearSelection(), copyToClipboard(), copyToSelection(), cut(), endInternalSelection(), handleDragSelection(), hasSelection(), homeInternalSelection(), insertChar(), internalCursorLeft(), internalCursorRight(), KviInputEditor(), mouseDoubleClickEvent(), rebuildTextBlocks(), redo(), removeSelected(), selectAll(), selectAllInternal(), sendKvs(), sendPlain(), spellCheckerPopupCorrectionActionTriggered(), and undo().
|
protected |
Referenced by backspaceHit(), clearSelection(), copyToClipboard(), copyToSelection(), cut(), endInternalSelection(), handleDragSelection(), hasSelection(), homeInternalSelection(), insertChar(), internalCursorLeft(), internalCursorRight(), KviInputEditor(), mouseDoubleClickEvent(), rebuildTextBlocks(), redo(), removeSelected(), selectAll(), selectAllInternal(), sendKvs(), sendPlain(), spellCheckerPopupCorrectionActionTriggered(), and undo().
|
protected |
Referenced by findSpellCheckerBlockAtCursor(), KviInputEditor(), showContextPopup(), and showSpellCheckerCorrectionsPopup().
|
protected |
Referenced by backspaceHit(), charIndexFromXPosition(), clear(), clearSelection(), cut(), deleteHit(), deleteNextWord(), deletePreviousWord(), drawContents(), endInternalSelection(), ensureCursorVisible(), getLastFontMetrics(), handleDragSelection(), historyNext(), historyPrev(), homeInternalSelection(), insertChar(), insertText(), internalCursorLeft(), internalCursorRight(), KviInputEditor(), mouseDoubleClickEvent(), rebuildTextBlocks(), redo(), removeSelected(), replaceSegment(), replaceWordBeforeCursor(), selectAll(), selectAllInternal(), sendKvs(), sendPlain(), setText(), spellCheckerPopupCorrectionActionTriggered(), standardNickCompletion(), undo(), xPositionFromCharIndex(), and ~KviInputEditor().
|
protected |
Referenced by KviInputEditor(), and ~KviInputEditor().
|
protected |
|
protected |
Referenced by checkWordSpelling(), completion(), dropEvent(), KviInputEditor(), nextLine(), nextPage(), paintEvent(), pasteClipboardWithConfirmation(), pasteSelectionWithConfirmation(), previousLine(), previousPage(), scrollBottom(), scrollToLastReadLine(), scrollTop(), search(), sendKvs(), sendPlain(), showContextPopup(), zoomDefault(), zoomIn(), and zoomOut().
|
protected |
Referenced by completion(), KviInputEditor(), and standardNickCompletion().
|
protected |
The redo stack.
Contains owned pointers and has autodelete set to true. The most recently undone command is at the end. Null when no redo is available.
Referenced by clearUndoStack(), redo(), and undo().
|
protected |
Referenced by fillSpellCheckerCorrectionsPopup(), showContextPopup(), and showSpellCheckerCorrectionsPopup().
|
protected |
Referenced by keyPressEvent(), and keyReleaseEvent().
|
protected |
|
protected |
Referenced by completion(), and standardNickCompletion().
|
protected |
Referenced by standardNickCompletion().
|
protected |
Referenced by historyNext(), and historyPrev().
|
protected |
Referenced by backspaceHit(), clear(), completion(), copyToClipboard(), copyToSelection(), cut(), deleteHit(), deleteNextWord(), deletePreviousWord(), end(), endInternalSelection(), ensureCursorVisible(), fillSpellCheckerCorrectionsPopup(), finishInput(), getWordBeforeCursor(), handleDragSelection(), historyNext(), historyPrev(), insertChar(), insertIconCode(), insertText(), internalCursorLeft(), internalCursorRight(), mouseDoubleClickEvent(), mousePressEvent(), moveCursorTo(), nextCharSelection(), nextWord(), nextWordSelection(), previousWord(), previousWordSelection(), rebuildTextBlocks(), redo(), removeSelected(), replaceSegment(), replaceWordBeforeCursor(), selectAll(), selectAllInternal(), sendKvs(), sendPlain(), setText(), showContextPopup(), spellCheckerPopupCorrectionActionTriggered(), standardNickCompletion(), textBeforeCursor(), toggleMultiLineEditor(), and undo().
|
protected |
The undo stack.
Contains owned pointers and has autodelete set to true. The most recent command is at the end. Null when no undo is available.
Referenced by addUndo(), clearUndoStack(), redo(), and undo().
|
read |