KVIrc 5.2.6
Developer APIs
KviInput Class Reference

Input handling class. More...

#include <KviInput.h>

+ Inheritance diagram for KviInput:

Public Slots

void historyButtonClicked ()
 Shows the history popup.
 
void iconButtonClicked ()
 Shows the icon popup.
 
void inputEditorEnterPressed ()
 Parses the text written and clears the input line.
 
void multiLineEditorButtonToggled (bool bOn)
 Toggles the multiline editor.
 
void toggleToolButtons ()
 Toggles the buttons.
 

Public Member Functions

void applyOptions ()
 Saves and applies the options.
 
KviInputEditoreditor () const
 Return the instance of the input editor.
 
int heightHint () const
 Returns the height of the input line.
 
KviInputHistoryhistory ()
 Return the instance of the input history.
 
void insertChar (char c)
 Inserts the given character.
 
void insertText (const QString &szText)
 Inserts the given text.
 
bool isButtonsHidden ()
 Returns true if the buttons on the right are hidden.
 
bool isUserFriendly ()
 Returns true if the input line is in user-friendly mode.
 
 KviInput (KviWindow *pPar, KviUserListView *pView=nullptr)
 Constructs the input object.
 
void multiLinePaste (const QString &szText)
 Opens the multiline editor and pastes the given text.
 
void setButtonsHidden (bool bHidden)
 Sets the hidden status of the button on the right.
 
virtual void setFocus ()
 Sets the focus to the input line.
 
void setText (const QString &szText)
 Sets the given text.
 
void setUserFriendly (bool bSet)
 Sets the user-friendly mode to the input line.
 
QString text ()
 Returns the text written in the input line.
 
 ~KviInput ()
 Destroys the input object.
 

Public Attributes

KviTalHBoxm_pButtonContainer
 
QToolButton * m_pCommandlineModeButton
 
QLabel * m_pHelpLabel
 
QToolButton * m_pHideToolsButton
 
QToolButton * m_pHistoryButton
 
QToolButton * m_pIconButton
 
KviInputEditorm_pInputEditor
 
QGridLayout * m_pLayout
 
QToolButton * m_pMultiEditorButton
 
KviScriptEditorm_pMultiLineEditor
 
KviWindowm_pWindow
 

Protected Member Functions

void focusInEvent (QFocusEvent *e) override
 
void installShortcuts ()
 
void keyPressEvent (QKeyEvent *e) override
 
void setFocusProxy (QWidget *w)
 

Private Slots

void toggleMultiLine ()
 Toggles multiline.
 

Friends

class KviTextIconWindow
 

Detailed Description

Input handling class.

Constructor & Destructor Documentation

◆ KviInput()

◆ ~KviInput()

KviInput::~KviInput ( )

Destroys the input object.

References KviScriptEditor::destroyInstance(), and m_pMultiLineEditor.

Member Function Documentation

◆ applyOptions()

◆ editor()

KviInputEditor * KviInput::editor ( ) const
inline

Return the instance of the input editor.

Returns
KviInputEditor *

◆ focusInEvent()

void KviInput::focusInEvent ( QFocusEvent * e)
overrideprotected

◆ heightHint()

◆ history()

KviInputHistory * KviInput::history ( )
inline

Return the instance of the input history.

Returns
KviInputHistory *

References KviInputHistory::instance().

◆ historyButtonClicked

void KviInput::historyButtonClicked ( )
slot

Shows the history popup.

Returns
void

References g_pHistoryWindow, KVI_HISTORY_WIN_HEIGHT, and KviHistoryWindowWidget::popup().

Referenced by applyOptions(), and KviInput().

◆ iconButtonClicked

void KviInput::iconButtonClicked ( )
slot

Shows the icon popup.

Returns
void

References g_pTextIconWindow, KviTextIconWindow, m_pIconButton, and KviTextIconWindow::popup().

Referenced by KviInput().

◆ inputEditorEnterPressed

void KviInput::inputEditorEnterPressed ( )
slot

Parses the text written and clears the input line.

Returns
void

References KviInputEditor::clearUndoStack(), m_pCommandlineModeButton, m_pInputEditor, m_pWindow, KviUserInput::parse(), KviInputEditor::setText(), and KviInputEditor::text().

Referenced by KviInput().

◆ insertChar()

void KviInput::insertChar ( char c)

Inserts the given character.

Parameters
cThe character to insert
Returns
void

References KviInputEditor::insertChar(), and m_pInputEditor.

◆ insertText()

void KviInput::insertText ( const QString & szText)

Inserts the given text.

Parameters
szTextThe text to insert
Returns
void

References KviInputEditor::insertText(), and m_pInputEditor.

Referenced by window_kvs_cmd_insertInInputText().

◆ installShortcuts()

void KviInput::installShortcuts ( )
protected

◆ isButtonsHidden()

bool KviInput::isButtonsHidden ( )

Returns true if the buttons on the right are hidden.

Returns
bool

References m_pButtonContainer.

Referenced by KviWindow::saveProperties(), and toggleToolButtons().

◆ isUserFriendly()

bool KviInput::isUserFriendly ( )
inline

Returns true if the input line is in user-friendly mode.

Returns
bool

Referenced by KviWindow::saveProperties().

◆ keyPressEvent()

◆ multiLineEditorButtonToggled

◆ multiLinePaste()

void KviInput::multiLinePaste ( const QString & szText)

Opens the multiline editor and pastes the given text.

Parameters
szTextThe text to paste
Returns
void

References m_pInputEditor, m_pMultiLineEditor, multiLineEditorButtonToggled(), KviScriptEditor::setText(), and KviInputEditor::text().

◆ setButtonsHidden()

void KviInput::setButtonsHidden ( bool bHidden)

Sets the hidden status of the button on the right.

Parameters
bHiddenWhether to hide the buttons
Returns
void

References g_pIconManager, KviIconManager::getBigIcon(), m_pButtonContainer, and m_pHideToolsButton.

Referenced by KviWindow::loadProperties(), and toggleToolButtons().

◆ setFocus()

void KviInput::setFocus ( )
virtual

◆ setFocusProxy()

void KviInput::setFocusProxy ( QWidget * w)
protected

◆ setText()

void KviInput::setText ( const QString & szText)

Sets the given text.

Parameters
szTextThe text to set in the input line
Returns
void

References m_pInputEditor, m_pMultiLineEditor, KviInputEditor::setText(), and KviScriptEditor::setText().

Referenced by KviHistoryWindow::itemSelected(), and window_kvs_cmd_setInputText().

◆ setUserFriendly()

void KviInput::setUserFriendly ( bool bSet)
inline

Sets the user-friendly mode to the input line.

Parameters
bSetWhether to set the user-friendly mode
Returns
void

Referenced by KviWindow::loadProperties().

◆ text()

QString KviInput::text ( )

Returns the text written in the input line.

Returns
QString

References KviScriptEditor::getText(), m_pInputEditor, m_pMultiLineEditor, and KviInputEditor::text().

◆ toggleMultiLine

void KviInput::toggleMultiLine ( )
privateslot

Toggles multiline.

Returns
void

References m_pMultiLineEditor, and multiLineEditorButtonToggled().

Referenced by installShortcuts().

◆ toggleToolButtons

void KviInput::toggleToolButtons ( )
slot

Toggles the buttons.

Returns
void

References isButtonsHidden(), and setButtonsHidden().

Referenced by KviInput().

Friends And Related Symbol Documentation

◆ KviTextIconWindow

friend class KviTextIconWindow
friend

Referenced by iconButtonClicked().

Member Data Documentation

◆ m_pButtonContainer

KviTalHBox* KviInput::m_pButtonContainer

◆ m_pCommandlineModeButton

QToolButton* KviInput::m_pCommandlineModeButton

◆ m_pHelpLabel

QLabel* KviInput::m_pHelpLabel

◆ m_pHideToolsButton

QToolButton* KviInput::m_pHideToolsButton

Referenced by KviInput(), and setButtonsHidden().

◆ m_pHistoryButton

QToolButton* KviInput::m_pHistoryButton

Referenced by applyOptions(), and KviInput().

◆ m_pIconButton

QToolButton* KviInput::m_pIconButton

Referenced by iconButtonClicked(), and KviInput().

◆ m_pInputEditor

◆ m_pLayout

QGridLayout* KviInput::m_pLayout

◆ m_pMultiEditorButton

QToolButton* KviInput::m_pMultiEditorButton

◆ m_pMultiLineEditor

◆ m_pWindow


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