1 /***************************************************************************
2 * Copyright (C) 2003 by Sébastien Laoût *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
21 #ifndef FOCUSEDWIDGETS_H
22 #define FOCUSEDWIDGETS_H
24 #include <ktextedit.h>
25 #include <kcolorcombo.h>
26 #include <kfontcombo.h>
27 #include <kcombobox.h>
28 #include <klineedit.h>
29 #include <kapplication.h>
30 #include <qclipboard.h>
32 #include <Q3PopupMenu>
35 #include <QWheelEvent>
37 class FocusedTextEdit
: public KTextEdit
41 FocusedTextEdit(bool disableUpdatesOnKeyPress
, QWidget
*parent
= 0, const char *name
= 0);
44 QTextCursor
* textCursor() const;
46 void adaptClipboardText(QClipboard::Mode mode
);
47 void keyPressEvent(QKeyEvent
*event
);
48 void wheelEvent(QWheelEvent
*event
);
49 void enterEvent(QEvent
*event
);
50 Q3PopupMenu
* createPopupMenu(const QPoint
&pos
);
55 bool m_disableUpdatesOnKeyPress
;
58 // TODO: Rename to EscapableKColorCombo
59 class FocusedColorCombo
: public KColorCombo
63 FocusedColorCombo(QWidget
*parent
= 0, const char *name
= 0);
66 void keyPressEvent(QKeyEvent
*event
);
69 void returnPressed2();
72 // TODO: Rename to EscapableKFontCombo
73 class FocusedFontCombo
: public KFontCombo
77 FocusedFontCombo(QWidget
*parent
= 0, const char *name
= 0);
80 void keyPressEvent(QKeyEvent
*event
);
83 void returnPressed2();
86 // TODO: Rename to EscapableKComboBox
87 class FocusedComboBox
: public KComboBox
91 FocusedComboBox(QWidget
*parent
= 0, const char *name
= 0);
94 void keyPressEvent(QKeyEvent
*event
);
97 void returnPressed2();
100 // TODO: Rename to EscapableKLineEdit
101 class FocusedLineEdit
: public KLineEdit
105 FocusedLineEdit(QWidget
*parent
= 0, const char *name
= 0);
108 void keyPressEvent(QKeyEvent
*event
);
109 void enterEvent(QEvent
*event
);
111 void escapePressed();
115 #endif // FOCUSEDWIDGETS_H