source: psi/trunk/src/msgmle.h@ 146

Last change on this file since 146 was 18, checked in by dmik, 19 years ago

Chat: Added popular Ctrl+Tab and Ctrl+Shift+Tab as hotkeys to switch between tabs in the Tabbed chat mode.

File size: 2.1 KB
Line 
1/*
2 * msgmle.h - subclass of PsiTextView to handle various hotkeys
3 * Copyright (C) 2001-2003 Justin Karneges, Michail Pishchagin
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
9 *
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.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 */
20
21#ifndef MSGMLE_H
22#define MSGMLE_H
23
24#include"psitextview.h"
25
26class QTimer;
27
28class ChatView : public PsiTextView
29{
30 Q_OBJECT
31public:
32 ChatView(QWidget *parent, const char *name = 0);
33 ~ChatView();
34
35protected:
36 // override the tab/esc behavior
37 bool focusNextPrevChild(bool next);
38 void keyPressEvent(QKeyEvent *);
39 void resizeEvent(QResizeEvent *);
40
41protected slots:
42 void autoCopy(bool copyAvailable);
43};
44
45class ChatEdit : public PsiTextView
46{
47public:
48 ChatEdit(QWidget *parent, const char *name = 0);
49 ~ChatEdit();
50
51protected:
52 void keyPressEvent(QKeyEvent *);
53};
54
55
56class LineEdit : public ChatEdit
57{
58 Q_OBJECT
59public:
60 LineEdit(QWidget *parent, const char *name = 0);
61 ~LineEdit();
62
63 QSize minimumSizeHint() const;
64 QSize sizeHint() const;
65 bool eventFilter(QObject *watched, QEvent *e);
66
67public slots:
68 void recalculateSize();
69 void setUpdatesEnabled( bool enable );
70
71private slots:
72 void checkMoved();
73
74protected:
75 void resizeEvent( QResizeEvent * );
76 bool allowResize() const;
77 bool movedWindow() const;
78
79private:
80 QTimer *moveTimer;
81 mutable QSize lastSize;
82 mutable QRect initialWindowGeometry; // used to return window to its original location
83 mutable QPoint moveTo; // used to differentiate user move message from the ones generated by LineEdit
84};
85
86
87#endif
Note: See TracBrowser for help on using the repository browser.