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

Last change on this file since 5 was 2, checked in by dmik, 19 years ago

Imported original Psi 0.10 sources from Affinix

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 // override the tab/esc behavior
53 bool focusNextPrevChild(bool next);
54 void keyPressEvent(QKeyEvent *);
55};
56
57
58class LineEdit : public ChatEdit
59{
60 Q_OBJECT
61public:
62 LineEdit(QWidget *parent, const char *name = 0);
63 ~LineEdit();
64
65 QSize minimumSizeHint() const;
66 QSize sizeHint() const;
67 bool eventFilter(QObject *watched, QEvent *e);
68
69public slots:
70 void recalculateSize();
71 void setUpdatesEnabled( bool enable );
72
73private slots:
74 void checkMoved();
75
76protected:
77 void resizeEvent( QResizeEvent * );
78 bool allowResize() const;
79 bool movedWindow() const;
80
81private:
82 QTimer *moveTimer;
83 mutable QSize lastSize;
84 mutable QRect initialWindowGeometry; // used to return window to its original location
85 mutable QPoint moveTo; // used to differentiate user move message from the ones generated by LineEdit
86};
87
88
89#endif
Note: See TracBrowser for help on using the repository browser.