source: psi/trunk/src/tabdlg.h@ 175

Last change on this file since 175 was 47, checked in by dmik, 19 years ago

Psi: TabDlg: Fixed: ChatDlg::closeEvent() result (accepted or rejected) is now obeyed when chats are in the tabbed mode.

File size: 2.6 KB
Line 
1/*
2 * tabdlg.h - dialog for handling tabbed chats
3 * Copyright (C) 2005 Kevin Smith
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 TABDLG_H
22#define TABDLG_H
23
24#include <qwidget.h>
25#include <qptrlist.h>
26#include <qtabwidget.h>
27#include <qlayout.h>
28#include <qpushbutton.h>
29#include "im.h"
30#include <qmap.h>
31#include "psitabwidget.h"
32#include "advwidget.h"
33using namespace XMPP;
34
35class ChatDlg;
36class PsiCon;
37class ChatTabs;
38
39class QDragObject;
40class QContextMenuEvent;
41
42/*class PsiAccount;
43class UserListItem;
44class QDropEvent;
45class QDragEnterEvent;*/
46
47class TabDlg : public AdvancedWidget<QWidget>//, public QWidget
48{
49 Q_OBJECT
50public:
51 TabDlg(PsiCon*);
52 ~TabDlg();
53 bool managesChat(ChatDlg*);
54 bool chatOnTop(ChatDlg*);
55 QString getName();
56
57signals:
58 void isDying(TabDlg*);
59protected:
60 void closeEvent( QCloseEvent* );
61 void keyPressEvent(QKeyEvent *);
62 void windowActivationChange(bool);
63 void resizeEvent(QResizeEvent *);
64protected slots:
65 void detachChat();
66 void detachChat(QWidget*);
67 void closeChat();
68 void closeChat(QWidget*);
69 void buildTabMenu();
70 void sendChatTo(QWidget*, TabDlg *);
71public slots:
72 void addChat(ChatDlg *chat);
73 void setLooks();
74 bool closeChat(ChatDlg*,bool);
75 void selectTab(ChatDlg*);
76 void activated();
77private slots:
78 void tabSelected(QWidget* chat);
79 void checkHasChats();
80 void closeMe();
81 void updateTab(ChatDlg*);
82 void nextTab();
83 void previousTab();
84 void setTabComposing(ChatDlg*, bool);
85 void setTabHasMessages(ChatDlg*, int);
86 void tabTestCanDecode(const QDragMoveEvent*, bool&);
87 void tabReceivedDropEvent(QDropEvent*);
88 void tabReceivedDropEvent(QWidget*, QDropEvent*);
89 void startDrag(QWidget*);
90
91public:
92 ChatDlg* getChatPointer(QString fullJid);
93private:
94 void updateCaption();
95 PsiCon *psi;
96 QPtrList<ChatDlg> chats;
97 KTabWidget *tabs;
98 QPushButton *detachButton, *closeButton, *closeCross;
99 QPopupMenu *tabMenu;
100 QMap<ChatDlg*, bool> tabIsComposing;
101 QMap<ChatDlg*, bool> tabHasMessages;
102
103 QSize chatSize;
104};
105
106#endif
Note: See TracBrowser for help on using the repository browser.