| 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 |
|
|---|
| 21 | #ifndef CHATDLG_H
|
|---|
| 22 | #define CHATDLG_H
|
|---|
| 23 |
|
|---|
| 24 | #include "advwidget.h"
|
|---|
| 25 | #include "im.h"
|
|---|
| 26 |
|
|---|
| 27 | using namespace XMPP;
|
|---|
| 28 |
|
|---|
| 29 | class PsiAccount;
|
|---|
| 30 | class UserListItem;
|
|---|
| 31 | class QDropEvent;
|
|---|
| 32 | class QDragEnterEvent;
|
|---|
| 33 |
|
|---|
| 34 | class ChatDlg : public AdvancedWidget<QWidget>
|
|---|
| 35 | {
|
|---|
| 36 | Q_OBJECT
|
|---|
| 37 | public:
|
|---|
| 38 | ChatDlg(const Jid &, PsiAccount *);
|
|---|
| 39 | ~ChatDlg();
|
|---|
| 40 |
|
|---|
| 41 | const Jid & jid() const;
|
|---|
| 42 | void setJid(const Jid &);
|
|---|
| 43 | const QString & getDisplayNick();
|
|---|
| 44 |
|
|---|
| 45 | static QSize defaultSize();
|
|---|
| 46 |
|
|---|
| 47 | signals:
|
|---|
| 48 | void aInfo(const Jid &);
|
|---|
| 49 | void aHistory(const Jid &);
|
|---|
| 50 | void messagesRead(const Jid &);
|
|---|
| 51 | void aSend(const Message &);
|
|---|
| 52 | void aFile(const Jid &);
|
|---|
| 53 | void captionChanged(ChatDlg*);
|
|---|
| 54 | void contactIsComposing(ChatDlg*, bool);
|
|---|
| 55 | void unreadMessageUpdate(ChatDlg*, int);
|
|---|
| 56 |
|
|---|
| 57 | protected:
|
|---|
| 58 | // reimplemented
|
|---|
| 59 | void keyPressEvent(QKeyEvent *);
|
|---|
| 60 | void closeEvent(QCloseEvent *);
|
|---|
| 61 | void resizeEvent(QResizeEvent *);
|
|---|
| 62 | void showEvent(QShowEvent *);
|
|---|
| 63 | void windowActivationChange(bool);
|
|---|
| 64 | void dropEvent(QDropEvent* event);
|
|---|
| 65 | void dragEnterEvent(QDragEnterEvent* event);
|
|---|
| 66 |
|
|---|
| 67 | public slots:
|
|---|
| 68 | void optionsUpdate();
|
|---|
| 69 | void updateContact(const Jid &, bool);
|
|---|
| 70 | void incomingMessage(const Message &);
|
|---|
| 71 | void activated();
|
|---|
| 72 | void updateAvatar();
|
|---|
| 73 | void updateAvatar(const Jid&);
|
|---|
| 74 |
|
|---|
| 75 | private slots:
|
|---|
| 76 | void doInfo();
|
|---|
| 77 | void doHistory();
|
|---|
| 78 | void doClear();
|
|---|
| 79 | void doClearButton();
|
|---|
| 80 | void doSend();
|
|---|
| 81 | void doFile();
|
|---|
| 82 | void setKeepOpenFalse();
|
|---|
| 83 | void setWarnSendFalse();
|
|---|
| 84 | void updatePGP();
|
|---|
| 85 | void encryptedMessageSent(int, bool);
|
|---|
| 86 | void slotScroll();
|
|---|
| 87 | void updateIsComposing(bool);
|
|---|
| 88 | void updateContactIsComposing(bool);
|
|---|
| 89 | void toggleSmallChat();
|
|---|
| 90 | void toggleEncryption();
|
|---|
| 91 | void buildMenu();
|
|---|
| 92 | void logSelectionChanged();
|
|---|
| 93 |
|
|---|
| 94 | public:
|
|---|
| 95 | class Private;
|
|---|
| 96 | private:
|
|---|
| 97 | Private *d;
|
|---|
| 98 |
|
|---|
| 99 | void contextMenuEvent(QContextMenuEvent *);
|
|---|
| 100 |
|
|---|
| 101 | void doneSend();
|
|---|
| 102 | void setLooks();
|
|---|
| 103 | void setSelfDestruct(int);
|
|---|
| 104 | void updateCaption();
|
|---|
| 105 | void deferredScroll();
|
|---|
| 106 |
|
|---|
| 107 | void appendMessage(const Message &, bool local=false);
|
|---|
| 108 | void appendSysMsg(const QString &);
|
|---|
| 109 | };
|
|---|
| 110 |
|
|---|
| 111 | #endif
|
|---|