KVIrc 5.2.0
Developer APIs
KviInput.h
Go to the documentation of this file.
1#ifndef _KVI_INPUT_H_
2#define _KVI_INPUT_H_
3//============================================================================
4//
5// File : KviInput.h
6// Creation date : Sun Jan 3 1999 23:04:10 by Szymon Stefanek
7//
8// This file is part of the KVIrc IRC client distribution
9// Copyright (C) 1999 Szymon Stefanek (pragma at kvirc dot net)
10// Copyright (C) 2008 Elvio Basello (hellvis69 at netsons dot org)
11//
12// This program is FREE software. You can redistribute it and/or
13// modify it under the terms of the GNU General Public License
14// as published by the Free Software Foundation; either version 2
15// of the License, or (at your option) any later version.
16//
17// This program is distributed in the HOPE that it will be USEFUL,
18// but WITHOUT ANY WARRANTY; without even the implied warranty of
19// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20// See the GNU General Public License for more details.
21//
22// You should have received a copy of the GNU General Public License
23// along with this program. If not, write to the Free Software Foundation,
24// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25//
26//============================================================================
27
34#include "kvi_settings.h"
35#include "KviInputHistory.h"
36
37#include <QWidget>
38#include <QToolButton>
39#include <QLabel>
40
41class QGridLayout;
42class KviUserListView;
43class KviWindow;
44class KviInputEditor;
45class KviTalHBox;
46class QMenu;
47class KviScriptEditor;
48
53class KVIRC_API KviInput : public QWidget
54{
55 friend class KviTextIconWindow;
56 Q_OBJECT
57public:
64 KviInput(KviWindow * pPar, KviUserListView * pView = nullptr);
65
69 ~KviInput();
70
71public:
76 QToolButton * m_pMultiEditorButton;
77 QToolButton * m_pHistoryButton;
78 QToolButton * m_pIconButton;
80 QToolButton * m_pHideToolsButton;
81 QGridLayout * m_pLayout;
82 QLabel * m_pHelpLabel;
83
84public:
89 virtual void setFocus();
90
96 void multiLinePaste(const QString & szText);
97
102 bool isUserFriendly() { return m_pCommandlineModeButton->isChecked(); };
103
109 void setUserFriendly(bool bSet) { m_pCommandlineModeButton->setChecked(bSet); };
110
115 int heightHint() const;
116
122 void setText(const QString & szText);
123
129 void insertChar(char c);
130
136 void insertText(const QString & szText);
137
142 void applyOptions();
143
148 bool isButtonsHidden();
149
155 void setButtonsHidden(bool bHidden);
156
161 QString text();
162 //const QString & text();
163
168 KviInputEditor * editor() const { return m_pInputEditor; }
169
175protected:
176 void installShortcuts();
177 void focusInEvent(QFocusEvent * e) override;
178 void setFocusProxy(QWidget * w);
179 void keyPressEvent(QKeyEvent * e) override;
180public slots:
186 void multiLineEditorButtonToggled(bool bOn);
187
192 void historyButtonClicked();
193
198 void iconButtonClicked();
199
204 void inputEditorEnterPressed();
205
210 void toggleToolButtons();
211private slots:
216 void toggleMultiLine();
217};
218
219#endif //_KVI_INPUT_H_
Input history management.
Input editor class.
Definition KviInputEditor.h:89
Input history class.
Definition KviInputHistory.h:54
static KviInputHistory * instance()
Returns the instance of the class.
Definition KviInputHistory.h:79
Input handling class.
Definition KviInput.h:54
QToolButton * m_pMultiEditorButton
Definition KviInput.h:76
QToolButton * m_pIconButton
Definition KviInput.h:78
QToolButton * m_pHistoryButton
Definition KviInput.h:77
KviInputEditor * m_pInputEditor
Definition KviInput.h:73
QToolButton * m_pCommandlineModeButton
Definition KviInput.h:79
KviTalHBox * m_pButtonContainer
Definition KviInput.h:75
KviScriptEditor * m_pMultiLineEditor
Definition KviInput.h:74
QGridLayout * m_pLayout
Definition KviInput.h:81
KviInputHistory * history()
Return the instance of the input history.
Definition KviInput.h:174
void setUserFriendly(bool bSet)
Sets the user-friendly mode to the input line.
Definition KviInput.h:109
QLabel * m_pHelpLabel
Definition KviInput.h:82
KviInputEditor * editor() const
Return the instance of the input editor.
Definition KviInput.h:168
bool isUserFriendly()
Returns true if the input line is in user-friendly mode.
Definition KviInput.h:102
QToolButton * m_pHideToolsButton
Definition KviInput.h:80
KviWindow * m_pWindow
Definition KviInput.h:72
Definition KviScriptEditor.h:45
Toolkit Abstraction Layer: hbox class.
Definition KviTalHBox.h:44
Text icon window class.
Definition KviTextIconWindow.h:41
User list view management class.
Definition KviUserListView.h:226
Base class for all windows in KVIrc.
Definition KviWindow.h:75
#define e
Definition detector.cpp:70
#define w
Definition detector.cpp:88
This file contains compile time settings.
#define KVIRC_API
Definition kvi_settings.h:127