2007-11-14 22:18:48 -05:00
|
|
|
/****************************************************************
|
|
|
|
* RetroShare is distributed under the following license:
|
|
|
|
*
|
|
|
|
* Copyright (C) 2006, crypton
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
|
|
|
****************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef _POPUPCHATDIALOG_H
|
|
|
|
#define _POPUPCHATDIALOG_H
|
|
|
|
|
|
|
|
#include "ui_PopupChatDialog.h"
|
|
|
|
|
2009-01-03 21:28:30 -05:00
|
|
|
class QAction;
|
|
|
|
class QTextEdit;
|
2007-11-14 22:18:48 -05:00
|
|
|
class QTextCharFormat;
|
2010-07-23 14:52:58 -04:00
|
|
|
class AttachFileItem;
|
2008-02-04 12:55:59 -05:00
|
|
|
class ChatInfo;
|
|
|
|
|
2010-09-04 10:23:30 -04:00
|
|
|
#include "ChatStyle.h"
|
|
|
|
|
2007-11-14 22:18:48 -05:00
|
|
|
class PopupChatDialog : public QMainWindow
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2010-09-01 13:56:15 -04:00
|
|
|
static PopupChatDialog *getPrivateChat(std::string id, uint chatflags);
|
2010-06-17 13:39:32 -04:00
|
|
|
static void cleanupChat();
|
|
|
|
static void chatFriend(std::string id);
|
|
|
|
static void updateAllAvatars();
|
2010-09-20 20:08:06 -04:00
|
|
|
static void privateChatChanged(int list, int type);
|
2007-11-14 22:18:48 -05:00
|
|
|
|
|
|
|
void updateChat();
|
2009-09-30 16:53:18 -04:00
|
|
|
void updatePeerAvatar(const std::string&);
|
2010-09-02 06:15:13 -04:00
|
|
|
|
2008-03-22 22:21:17 -04:00
|
|
|
public slots:
|
|
|
|
/** Overloaded QWidget.show */
|
2008-03-29 14:21:17 -04:00
|
|
|
void show();
|
2008-12-07 09:19:13 -05:00
|
|
|
|
|
|
|
void getfocus();
|
|
|
|
void flash();
|
2010-03-17 11:34:36 -04:00
|
|
|
void pasteLink() ;
|
|
|
|
void contextMenu(QPoint) ;
|
2010-09-02 06:15:13 -04:00
|
|
|
|
2008-03-29 14:21:17 -04:00
|
|
|
void smileyWidget();
|
|
|
|
void addSmiley();
|
2010-09-02 06:15:13 -04:00
|
|
|
|
2010-01-25 09:35:32 -05:00
|
|
|
void fileHashingFinished(AttachFileItem* file);
|
2008-03-23 10:55:05 -04:00
|
|
|
|
2009-05-05 09:18:53 -04:00
|
|
|
void resetStatusBar() ;
|
|
|
|
void updateStatusTyping() ;
|
2010-08-30 14:33:19 -04:00
|
|
|
void updateStatusString(const QString& peer_id, const QString& statusString) ;
|
2009-05-11 10:21:11 -04:00
|
|
|
void anchorClicked (const QUrl &);
|
|
|
|
|
2010-08-20 14:45:44 -04:00
|
|
|
void updateStatus(const QString &peer_id, int status);
|
2009-05-11 10:21:11 -04:00
|
|
|
|
2007-11-14 22:18:48 -05:00
|
|
|
protected:
|
2010-06-17 13:39:32 -04:00
|
|
|
/** Default constructor */
|
|
|
|
PopupChatDialog(std::string id, std::string name,
|
|
|
|
QWidget *parent = 0, Qt::WFlags flags = 0);
|
|
|
|
/** Default destructor */
|
|
|
|
~PopupChatDialog();
|
|
|
|
|
2007-11-14 22:18:48 -05:00
|
|
|
void closeEvent (QCloseEvent * event);
|
2010-09-01 13:56:15 -04:00
|
|
|
void showEvent (QShowEvent * event);
|
2009-05-11 10:27:45 -04:00
|
|
|
virtual void dragEnterEvent(QDragEnterEvent *event);
|
|
|
|
virtual void dropEvent(QDropEvent *event);
|
|
|
|
|
2010-09-04 10:23:30 -04:00
|
|
|
bool eventFilter(QObject *obj, QEvent *ev);
|
2010-09-01 13:56:15 -04:00
|
|
|
|
2010-09-04 10:23:30 -04:00
|
|
|
void insertChatMsgs();
|
2010-09-20 20:08:06 -04:00
|
|
|
void addChatMsg(std::string &id, uint sendTime, std::wstring &msg, bool offline);
|
2010-09-01 13:56:15 -04:00
|
|
|
|
|
|
|
void updateAvatar();
|
2010-09-01 21:37:47 -04:00
|
|
|
|
2010-09-01 13:56:15 -04:00
|
|
|
QPixmap picture;
|
2009-05-11 10:27:45 -04:00
|
|
|
|
2007-11-14 22:18:48 -05:00
|
|
|
private slots:
|
2009-05-11 10:21:11 -04:00
|
|
|
void addExtraFile();
|
2010-08-06 08:30:06 -04:00
|
|
|
void addExtraPicture();
|
2008-03-21 13:30:15 -04:00
|
|
|
void showAvatarFrame(bool show);
|
2010-08-24 11:28:50 -04:00
|
|
|
void on_closeInfoFrameButton_clicked();
|
2008-03-21 13:30:15 -04:00
|
|
|
|
2010-09-02 06:15:13 -04:00
|
|
|
void setColor();
|
2008-03-26 21:29:04 -04:00
|
|
|
void getFont();
|
2008-03-22 21:13:09 -04:00
|
|
|
void setFont();
|
2008-03-31 17:02:12 -04:00
|
|
|
|
2008-03-22 21:13:09 -04:00
|
|
|
void sendChat();
|
2009-01-03 21:28:30 -05:00
|
|
|
|
2010-09-02 06:15:13 -04:00
|
|
|
void updatePeersCustomStateString(const QString& peer_id, const QString& status_string) ;
|
2009-01-03 21:28:30 -05:00
|
|
|
void getAvatar();
|
2010-09-02 06:15:13 -04:00
|
|
|
|
2010-02-19 17:31:32 -05:00
|
|
|
void on_actionClear_Chat_triggered();
|
2010-09-02 06:15:13 -04:00
|
|
|
|
2010-04-27 18:08:38 -04:00
|
|
|
bool fileSave();
|
|
|
|
bool fileSaveAs();
|
2010-09-20 20:08:06 -04:00
|
|
|
void clearOfflineMessages();
|
2009-01-03 21:28:30 -05:00
|
|
|
|
2010-08-18 08:02:36 -04:00
|
|
|
|
2007-11-14 22:18:48 -05:00
|
|
|
private:
|
|
|
|
|
2010-09-20 20:08:06 -04:00
|
|
|
void setCurrentFileName(const QString &fileName);
|
|
|
|
|
2007-11-14 22:18:48 -05:00
|
|
|
void colorChanged(const QColor &c);
|
2010-09-10 14:38:46 -04:00
|
|
|
void fontChanged(const QFont &font);
|
2010-08-06 08:30:06 -04:00
|
|
|
void addAttachment(std::string,int flag);
|
2010-08-06 10:58:53 -04:00
|
|
|
void processSettings(bool bLoad);
|
2009-05-11 10:27:45 -04:00
|
|
|
|
2010-09-20 20:08:06 -04:00
|
|
|
void onPrivateChatChanged(int list, int type);
|
|
|
|
|
2010-09-02 06:15:13 -04:00
|
|
|
QAction *actionTextBold;
|
|
|
|
QAction *actionTextUnderline;
|
|
|
|
QAction *actionTextItalic;
|
|
|
|
QAction *pasteLinkAct ;
|
|
|
|
|
2007-11-14 22:18:48 -05:00
|
|
|
std::string dialogId, dialogName;
|
|
|
|
unsigned int lastChatTime;
|
|
|
|
std::string lastChatName;
|
2010-09-02 06:15:13 -04:00
|
|
|
|
2010-04-27 18:08:38 -04:00
|
|
|
time_t last_status_send_time ;
|
2008-04-05 08:14:49 -04:00
|
|
|
QColor mCurrentColor;
|
|
|
|
QFont mCurrentFont;
|
2010-09-02 06:15:13 -04:00
|
|
|
|
2010-09-04 10:23:30 -04:00
|
|
|
// QStringList history;
|
2010-09-02 06:15:13 -04:00
|
|
|
QString wholeChat;
|
2010-04-27 18:08:38 -04:00
|
|
|
QString fileName;
|
2010-09-01 13:56:15 -04:00
|
|
|
|
|
|
|
bool m_bInsertOnVisible;
|
2010-09-04 10:23:30 -04:00
|
|
|
ChatStyle style;
|
2010-09-01 13:56:15 -04:00
|
|
|
|
2007-11-14 22:18:48 -05:00
|
|
|
/** Qt Designer generated object */
|
|
|
|
Ui::PopupChatDialog ui;
|
2009-05-11 10:21:11 -04:00
|
|
|
|
2007-11-14 22:18:48 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|