~ubuntu-branches/ubuntu/feisty/psi/feisty

« back to all changes in this revision

Viewing changes to src/chatdlg.h

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2002-04-19 02:28:44 UTC
  • Revision ID: james.westby@ubuntu.com-20020419022844-za7xgai5qyfd9xv6
Tags: upstream-0.8.5
ImportĀ upstreamĀ versionĀ 0.8.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/****************************************************************************
 
2
** chatdlg.h - a single window chat dialog
 
3
** Copyright (C) 2001, 2002  Justin Karneges
 
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 program; 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 CHATDLG_H
 
22
#define CHATDLG_H
 
23
 
 
24
#include<qwidget.h>
 
25
#include<qlineedit.h>
 
26
#include<qlabel.h>
 
27
#include<qtoolbutton.h>
 
28
#include<qtimer.h>
 
29
#include"jabcommon.h"
 
30
#include"msgmle.h"
 
31
#include"message.h"
 
32
#include"userlist.h"
 
33
#include"uniquewindow.h"
 
34
 
 
35
class ChatDlg : public QWidget, public UniqueWindow
 
36
{
 
37
        Q_OBJECT
 
38
public:
 
39
        ChatDlg(UserListItem *item, const QString &, int _localStatus, QWidget *parent=0);
 
40
        ~ChatDlg();
 
41
 
 
42
        QString & jid() { return v_jid; }
 
43
        static ChatDlg *find(const QString &);
 
44
        static QSize defaultSize();
 
45
 
 
46
        MsgMle *t;
 
47
        ChatMle *mle;
 
48
 
 
49
        // reimplemented
 
50
protected:
 
51
        void keyPressEvent(QKeyEvent *);
 
52
        void closeEvent(QCloseEvent *);
 
53
        void resizeEvent(QResizeEvent *);
 
54
        void showEvent(QShowEvent *);
 
55
        void windowActivationChange(bool);
 
56
 
 
57
signals:
 
58
        void aSend(const Message &);
 
59
        void aHistory(const QString &jid);
 
60
        void aAuth(const QString &jid);
 
61
        void aAdd(const QString &jid);
 
62
        void aInfo(const QString &jid);
 
63
        void aOpenURL(const QString &url);
 
64
 
 
65
public slots:
 
66
        void localUpdate(const JabRosterEntry &);
 
67
        void updateContact(UserListItem *);
 
68
        void incomingMessage(const Message &);
 
69
        void optionsUpdate();
 
70
 
 
71
private slots:
 
72
        void doSend();
 
73
        void doHistory();
 
74
        void doAuth();
 
75
        void doAdd();
 
76
        void doInfo();
 
77
        void doClear();
 
78
        void doClearButton();
 
79
 
 
80
        void deferredScroll();
 
81
        void setKeepOpenFalse();
 
82
        void flashAnimate();
 
83
 
 
84
private:
 
85
        QString v_jid, v_nick;
 
86
        int v_status;
 
87
        int localStatus;
 
88
        QString whoami, dispNick;
 
89
        int pending;
 
90
        bool keepOpen;
 
91
 
 
92
        QWidget *lo_single;
 
93
        QLineEdit *le_nick, *le_jid;
 
94
        QLabel *lb_statusIcon;
 
95
        QToolButton *tb_send, *tb_history, *tb_info;
 
96
 
 
97
        void appendMessage(const Message &);
 
98
        void appendSysMsg(const QString &);
 
99
        void updateCaption();
 
100
 
 
101
        void setLooks();
 
102
        QTimer *selfDestruct;
 
103
        void setSelfDestruct(int);
 
104
 
 
105
        void doFlash(bool);
 
106
        QTimer *flashTimer;
 
107
        int flashCount;
 
108
};
 
109
 
 
110
#endif
 
111