author | wazlaf <wazlaf> | 2002-09-30 13:43:36 (UTC) |
---|---|---|
committer | wazlaf <wazlaf> | 2002-09-30 13:43:36 (UTC) |
commit | 5db3af80f392f8f063f53cbbad67bbe7c5c6eb6d (patch) (unidiff) | |
tree | 12d8e59152c434e0774f067d5b0163578d603daf /noncore/net/opieirc/ircmisc.h | |
parent | b753c264b7acd26aba9f5a73c1fa0a7deb0b73a3 (diff) | |
download | opie-5db3af80f392f8f063f53cbbad67bbe7c5c6eb6d.zip opie-5db3af80f392f8f063f53cbbad67bbe7c5c6eb6d.tar.gz opie-5db3af80f392f8f063f53cbbad67bbe7c5c6eb6d.tar.bz2 |
history functionality, tabs switch colors, extended settings dialog
-rw-r--r-- | noncore/net/opieirc/ircmisc.h | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/noncore/net/opieirc/ircmisc.h b/noncore/net/opieirc/ircmisc.h index 4df6ce0..7151e6b 100644 --- a/noncore/net/opieirc/ircmisc.h +++ b/noncore/net/opieirc/ircmisc.h | |||
@@ -1,72 +1,91 @@ | |||
1 | /* | 1 | /* |
2 | OpieIRC - An embedded IRC client | 2 | OpieIRC - An embedded IRC client |
3 | Copyright (C) 2002 Wenzel Jakob | 3 | Copyright (C) 2002 Wenzel Jakob |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 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 | 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 | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
18 | 18 | ||
19 | */ | 19 | */ |
20 | 20 | ||
21 | #ifndef __IRCMISC_H | 21 | #ifndef __IRCMISC_H |
22 | #define __IRCMISC_H | 22 | #define __IRCMISC_H |
23 | 23 | ||
24 | #include <qtabwidget.h> | 24 | #include <qtabwidget.h> |
25 | #include <qlineedit.h> | ||
25 | #include <qtabbar.h> | 26 | #include <qtabbar.h> |
26 | #include <qlabel.h> | 27 | #include <qlabel.h> |
27 | #include <qcolor.h> | 28 | #include <qcolor.h> |
28 | #include <qvector.h> | 29 | #include <qarray.h> |
29 | 30 | ||
30 | /* IRCFramedColorLabel is used to display a color */ | 31 | /* IRCFramedColorLabel is used to display a color */ |
31 | 32 | ||
32 | class IRCColorLabel : public QLabel { | 33 | class IRCColorLabel : public QLabel { |
33 | Q_OBJECT | 34 | Q_OBJECT |
34 | public: | 35 | public: |
35 | IRCColorLabel(QColor color, QWidget *parent = 0, const char *name = 0, WFlags f = 0); | 36 | IRCColorLabel(QColor color, QWidget *parent = 0, const char *name = 0, WFlags f = 0); |
36 | QColor color(); | 37 | QColor color(); |
37 | void mousePressEvent(QMouseEvent *event); | 38 | void mousePressEvent(QMouseEvent *event); |
38 | protected: | 39 | protected: |
39 | QColor m_color; | 40 | QColor m_color; |
40 | }; | 41 | }; |
41 | 42 | ||
42 | class IRCFramedColorLabel : public QWidget { | 43 | class IRCFramedColorLabel : public QWidget { |
43 | Q_OBJECT | 44 | Q_OBJECT |
44 | public: | 45 | public: |
45 | IRCFramedColorLabel(QColor color, QWidget *parent = 0, const char *name = 0, WFlags f = 0); | 46 | IRCFramedColorLabel(QColor color, QWidget *parent = 0, const char *name = 0, WFlags f = 0); |
46 | QColor color(); | 47 | QColor color(); |
47 | protected: | 48 | protected: |
48 | IRCColorLabel *m_label; | 49 | IRCColorLabel *m_label; |
49 | }; | 50 | }; |
50 | 51 | ||
51 | /* Custom colored QTabWidget */ | 52 | /* Custom colored QTabWidget */ |
52 | 53 | ||
54 | class QExtTab : public QTab { | ||
55 | public: | ||
56 | QColor color; | ||
57 | }; | ||
58 | |||
53 | class IRCTabWidget : public QTabWidget { | 59 | class IRCTabWidget : public QTabWidget { |
54 | Q_OBJECT | 60 | Q_OBJECT |
55 | public: | 61 | public: |
56 | IRCTabWidget(QWidget *parent = 0, const char *name = 0); | 62 | IRCTabWidget(QWidget *parent = 0, const char *name = 0); |
57 | void setTabColor(int index, const QColor *color); | 63 | void setTabColor(int index, QColor color); |
58 | }; | 64 | }; |
59 | 65 | ||
60 | class IRCTabBar : public QTabBar { | 66 | class IRCTabBar : public QTabBar { |
61 | Q_OBJECT | 67 | Q_OBJECT |
62 | public: | 68 | public: |
63 | IRCTabBar(QWidget *parent = 0, const char *name = 0); | 69 | IRCTabBar(QWidget *parent = 0, const char *name = 0); |
64 | void setTabColor(int index, const QColor *color); | 70 | void setTabColor(int index, QColor color); |
65 | protected: | 71 | protected: |
66 | void paintLabel(QPainter*, const QRect&, QTab*, bool) const; | 72 | void paintLabel(QPainter*, const QRect&, QTab*, bool) const; |
67 | int insertTab(QTab *, int index = -1); | 73 | int insertTab(QTab *, int index = -1); |
68 | protected: | 74 | protected: |
69 | QVector<QColor> m_colors; | 75 | QArray<QColor> m_colors; |
76 | }; | ||
77 | |||
78 | /* A QLineEdit with history functionality */ | ||
79 | |||
80 | class IRCHistoryLineEdit : public QLineEdit { | ||
81 | Q_OBJECT | ||
82 | public: | ||
83 | IRCHistoryLineEdit(QWidget *parent = 0, const char *name = 0); | ||
84 | protected: | ||
85 | void keyPressEvent(QKeyEvent *); | ||
86 | protected: | ||
87 | QStringList m_history; | ||
88 | int m_index; | ||
70 | }; | 89 | }; |
71 | 90 | ||
72 | #endif /* __IRCMISC_H */ | 91 | #endif /* __IRCMISC_H */ |