KVIrc  4.9.2
DeveloperAPIs
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 
41 class QGridLayout;
42 class KviUserListView;
43 class KviWindow;
44 class KviInputEditor;
45 class KviTalHBox;
46 class QMenu;
47 class KviScriptEditor;
48 
53 class KVIRC_API KviInput : public QWidget
54 {
55  friend class KviTextIconWindow;
56  Q_OBJECT
57 public:
64  KviInput(KviWindow * pPar, KviUserListView * pView = 0);
65 
69  ~KviInput();
70 
71 public:
76  QToolButton * m_pMultiEditorButton;
77  QToolButton * m_pHistoryButton;
78  QToolButton * m_pIconButton;
79  QToolButton * m_pCommandlineModeButton;
80  QToolButton * m_pHideToolsButton;
81  QGridLayout * m_pLayout;
82  QLabel * m_pHelpLabel;
83 
84 public:
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  inline KviInputEditor * editor() { return m_pInputEditor; };
169 
175 protected:
176  void installShortcuts();
177  virtual void focusInEvent(QFocusEvent * e);
178  virtual void setFocusProxy(QWidget * w);
179  virtual void keyPressEvent(QKeyEvent * e);
180 public slots:
186  void multiLineEditorButtonToggled(bool bOn);
187 
192  void historyButtonClicked();
193 
198  void iconButtonClicked();
199 
204  void inputEditorEnterPressed();
205 
210  void toggleToolButtons();
211 private slots:
216  void toggleMultiLine();
217 };
218 
219 #endif //_KVI_INPUT_H_
QToolButton * m_pMultiEditorButton
Definition: KviInput.h:76
Toolkit Abstraction Layer: hbox class.
Definition: KviTalHBox.h:44
QToolButton * m_pHideToolsButton
Definition: KviInput.h:80
#define KVIRC_API
Definition: kvi_settings.h:128
char s char s char s s s s s char char c s *s c s s s d c s *s d c d d d d c
Definition: KviIrcNumericCodes.h:391
void setUserFriendly(bool bSet)
Sets the user-friendly mode to the input line.
Definition: KviInput.h:109
Input editor class.
Definition: KviInputEditor.h:85
Definition: KviScriptEditor.h:43
QGridLayout * m_pLayout
Definition: KviInput.h:81
QToolButton * m_pCommandlineModeButton
Definition: KviInput.h:79
KviInputEditor * m_pInputEditor
Definition: KviInput.h:73
KviTalHBox * m_pButtonContainer
Definition: KviInput.h:75
Input history management.
QToolButton * m_pIconButton
Definition: KviInput.h:78
QToolButton * m_pHistoryButton
Definition: KviInput.h:77
#define e
Definition: detector.cpp:69
KviWindow * m_pWindow
Definition: KviInput.h:72
Input handling class.
Definition: KviInput.h:53
Text icon window class.
Definition: KviTextIconWindow.h:50
KviInputHistory * history()
Return the instance of the input history.
Definition: KviInput.h:174
Input history class.
Definition: KviInputHistory.h:48
KviScriptEditor * m_pMultiLineEditor
Definition: KviInput.h:74
Base class for all windows in KVIrc.
Definition: KviWindow.h:74
#define w
Definition: detector.cpp:87
static KviInputHistory * instance()
Returns the instance of the class.
Definition: KviInputHistory.h:84
QLabel * m_pHelpLabel
Definition: KviInput.h:82
This file contains compile time settings.
KviInputEditor * editor()
Return the instance of the input editor.
Definition: KviInput.h:168
User list view management class.
Definition: KviUserListView.h:226
bool isUserFriendly()
Returns true if the input line is in user-friendly mode.
Definition: KviInput.h:102