~ubuntu-branches/ubuntu/edgy/psi/edgy

« back to all changes in this revision

Viewing changes to src/chatdlg.h

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2004-06-15 00:10:41 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040615001041-enywb6pcpe4sjsw6
Tags: 0.9.2-1
* New upstream release
* Set KDEDIR for ./configure so kde specific files get installed
* Don't install libpsiwidgets.so. It got installed in /usr/share
  where it doesn't belong. May be included (at a better location)
  later.

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
 
****************************************************************************/
 
1
/*
 
2
 * chatdlg.h - dialog for handling chats
 
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 library; if not, write to the Free Software
 
17
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
18
 *
 
19
 */
20
20
 
21
21
#ifndef CHATDLG_H
22
22
#define CHATDLG_H
23
23
 
24
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
 
25
#include"im.h"
 
26
 
 
27
using namespace XMPP;
 
28
 
 
29
class PsiAccount;
 
30
class UserListItem;
 
31
 
 
32
class ChatDlg : public QWidget
36
33
{
37
34
        Q_OBJECT
38
35
public:
39
 
        ChatDlg(UserListItem *item, const QString &, int _localStatus, QWidget *parent=0);
 
36
        ChatDlg(const Jid &, PsiAccount *);
40
37
        ~ChatDlg();
41
38
 
42
 
        QString & jid() { return v_jid; }
43
 
        static ChatDlg *find(const QString &);
 
39
        const Jid & jid() const;
 
40
        void setJid(const Jid &);
 
41
 
44
42
        static QSize defaultSize();
45
43
 
46
 
        MsgMle *t;
47
 
        ChatMle *mle;
 
44
signals:
 
45
        void aInfo(const Jid &);
 
46
        void aHistory(const Jid &);
 
47
        void messagesRead(const Jid &);
 
48
        void aSend(const Message &);
 
49
        void aFile(const Jid &);
48
50
 
 
51
protected:
49
52
        // reimplemented
50
 
protected:
51
53
        void keyPressEvent(QKeyEvent *);
52
54
        void closeEvent(QCloseEvent *);
53
55
        void resizeEvent(QResizeEvent *);
54
56
        void showEvent(QShowEvent *);
55
57
        void windowActivationChange(bool);
56
58
 
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
59
public slots:
66
 
        void localUpdate(const JabRosterEntry &);
67
 
        void updateContact(UserListItem *);
 
60
        void optionsUpdate();
 
61
        void updateContact(const Jid &, bool);
68
62
        void incomingMessage(const Message &);
69
 
        void optionsUpdate();
70
63
 
71
64
private slots:
72
 
        void doSend();
 
65
        void doInfo();
73
66
        void doHistory();
74
 
        void doAuth();
75
 
        void doAdd();
76
 
        void doInfo();
77
67
        void doClear();
78
68
        void doClearButton();
79
 
 
80
 
        void deferredScroll();
 
69
        void doSend();
 
70
        void doFile();
81
71
        void setKeepOpenFalse();
 
72
        void setWarnSendFalse();
82
73
        void flashAnimate();
 
74
        void updatePGP();
 
75
        void encryptedMessageSent(int, bool);
 
76
        void slotScroll();
 
77
        void toggleSmallChat();
 
78
        void toggleEncryption();
 
79
        void buildMenu();
83
80
 
 
81
public:
 
82
        class Private;
84
83
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
 
 
 
84
        Private *d;
 
85
 
 
86
        void contextMenuEvent (QContextMenuEvent *);
 
87
 
 
88
        void doneSend();
101
89
        void setLooks();
102
 
        QTimer *selfDestruct;
103
90
        void setSelfDestruct(int);
104
 
 
 
91
        void updateCaption();
105
92
        void doFlash(bool);
106
 
        QTimer *flashTimer;
107
 
        int flashCount;
 
93
        void deferredScroll();
 
94
 
 
95
        void appendMessage(const Message &, bool local=false);
 
96
        void appendSysMsg(const QString &);
108
97
};
109
98
 
110
99
#endif
111