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
|
|
|
|
|
2008-03-29 14:21:17 -04:00
|
|
|
#include <QtGui>
|
|
|
|
#include <QDialog>
|
2007-11-14 22:18:48 -05:00
|
|
|
|
|
|
|
#include "ui_PopupChatDialog.h"
|
2009-01-05 21:33:15 -05:00
|
|
|
#include <gui/Preferences/rsharesettings.h>
|
2007-11-14 22:18:48 -05:00
|
|
|
|
|
|
|
#include "rsiface/rsiface.h"
|
|
|
|
|
|
|
|
|
2009-01-03 21:28:30 -05:00
|
|
|
|
|
|
|
class QAction;
|
|
|
|
class QTextEdit;
|
2007-11-14 22:18:48 -05:00
|
|
|
class QTextCharFormat;
|
|
|
|
|
2008-02-04 12:55:59 -05:00
|
|
|
class ChatInfo;
|
|
|
|
|
2007-11-14 22:18:48 -05:00
|
|
|
class PopupChatDialog : public QMainWindow
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
/** Default constructor */
|
|
|
|
PopupChatDialog(std::string id, std::string name,
|
|
|
|
QWidget *parent = 0, Qt::WFlags flags = 0);
|
|
|
|
/** Default destructor */
|
2008-03-21 13:30:15 -04:00
|
|
|
~PopupChatDialog();
|
2007-11-14 22:18:48 -05:00
|
|
|
|
|
|
|
void updateChat();
|
|
|
|
void addChatMsg(ChatInfo *ci);
|
2008-03-29 14:21:17 -04:00
|
|
|
|
|
|
|
void loadEmoticons();
|
2009-01-05 21:33:15 -05:00
|
|
|
void loadEmoticons2();
|
|
|
|
|
2008-03-29 14:21:17 -04:00
|
|
|
|
2008-04-12 10:19:08 -04:00
|
|
|
QString loadEmptyStyle();
|
2009-01-03 21:28:30 -05:00
|
|
|
|
|
|
|
|
|
|
|
QPixmap picture;
|
|
|
|
|
2008-03-29 14:21:17 -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();
|
2008-03-29 14:21:17 -04:00
|
|
|
|
|
|
|
void smileyWidget();
|
|
|
|
void addSmiley();
|
2008-03-22 22:21:17 -04:00
|
|
|
|
2008-04-12 10:19:08 -04:00
|
|
|
void changeStyle();
|
2008-03-23 10:55:05 -04:00
|
|
|
|
2007-11-14 22:18:48 -05:00
|
|
|
protected:
|
|
|
|
void closeEvent (QCloseEvent * event);
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
2008-03-21 13:30:15 -04:00
|
|
|
void showAvatarFrame(bool show);
|
|
|
|
|
2008-03-22 21:13:09 -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
|
|
|
|
|
|
|
void checkChat();
|
2008-03-22 21:13:09 -04:00
|
|
|
void sendChat();
|
2009-01-03 21:28:30 -05:00
|
|
|
|
|
|
|
void getAvatar();
|
|
|
|
|
2007-11-14 22:18:48 -05:00
|
|
|
|
2008-03-22 22:21:17 -04:00
|
|
|
|
2007-11-14 22:18:48 -05:00
|
|
|
private:
|
|
|
|
|
|
|
|
void colorChanged(const QColor &c);
|
|
|
|
|
2009-01-03 21:28:30 -05:00
|
|
|
QAction *actionTextBold;
|
|
|
|
QAction *actionTextUnderline;
|
2007-11-14 22:18:48 -05:00
|
|
|
QAction *actionTextItalic;
|
|
|
|
|
|
|
|
std::string dialogId, dialogName;
|
|
|
|
unsigned int lastChatTime;
|
|
|
|
std::string lastChatName;
|
2008-03-29 14:21:17 -04:00
|
|
|
|
|
|
|
QHash<QString, QString> smileys;
|
2008-04-05 08:14:49 -04:00
|
|
|
QColor mCurrentColor;
|
|
|
|
QFont mCurrentFont;
|
2008-04-12 10:19:08 -04:00
|
|
|
|
2009-01-03 21:28:30 -05:00
|
|
|
QString styleHtm;
|
2008-04-12 10:19:08 -04:00
|
|
|
QString emptyStyle;
|
|
|
|
QStringList history;
|
|
|
|
QString wholeChat;
|
2009-01-03 21:28:30 -05:00
|
|
|
|
|
|
|
|
2007-11-14 22:18:48 -05:00
|
|
|
|
|
|
|
/** Qt Designer generated object */
|
|
|
|
Ui::PopupChatDialog ui;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|