2018-07-20 19:48:29 +02:00
|
|
|
/*******************************************************************************
|
|
|
|
* gui/chat/PopupChatWindow.h *
|
|
|
|
* *
|
|
|
|
* LibResAPI: API for local socket server *
|
|
|
|
* *
|
|
|
|
* Copyright (C) 2006, Crypton <retroshare.project@gmail.com> *
|
|
|
|
* *
|
|
|
|
* This program is free software: you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU Affero General Public License as *
|
|
|
|
* published by the Free Software Foundation, either version 3 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 Affero General Public License for more details. *
|
|
|
|
* *
|
|
|
|
* You should have received a copy of the GNU Affero General Public License *
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
|
|
|
|
* *
|
|
|
|
*******************************************************************************/
|
2010-11-15 20:49:24 +00:00
|
|
|
|
|
|
|
#ifndef _POPUPCHATWINDOW_H
|
|
|
|
#define _POPUPCHATWINDOW_H
|
|
|
|
|
|
|
|
#include <QTimer>
|
|
|
|
#include "ui_PopupChatWindow.h"
|
2014-03-17 20:56:06 +00:00
|
|
|
#include <retroshare/rstypes.h>
|
2014-12-29 21:41:05 +00:00
|
|
|
#include <retroshare/rsmsgs.h>
|
2022-05-08 20:38:35 +09:00
|
|
|
Q_DECLARE_METATYPE(RsGxsId)
|
|
|
|
Q_DECLARE_METATYPE(QList<RsGxsId>)
|
2010-11-15 20:49:24 +00:00
|
|
|
|
2012-01-17 20:36:36 +00:00
|
|
|
class ChatDialog;
|
2010-11-15 20:49:24 +00:00
|
|
|
|
|
|
|
class PopupChatWindow : public QMainWindow
|
|
|
|
{
|
2012-01-17 20:36:36 +00:00
|
|
|
Q_OBJECT
|
2010-11-15 20:49:24 +00:00
|
|
|
|
|
|
|
public:
|
2012-01-17 20:36:36 +00:00
|
|
|
static PopupChatWindow *getWindow(bool needSingleWindow);
|
|
|
|
static void cleanup();
|
2010-11-15 20:49:24 +00:00
|
|
|
|
|
|
|
public:
|
2012-01-17 20:36:36 +00:00
|
|
|
void addDialog(ChatDialog *dialog);
|
|
|
|
void removeDialog(ChatDialog *dialog);
|
|
|
|
void showDialog(ChatDialog *dialog, uint chatflags);
|
|
|
|
void alertDialog(ChatDialog *dialog);
|
|
|
|
void calculateTitle(ChatDialog *dialog);
|
2010-11-15 20:49:24 +00:00
|
|
|
|
|
|
|
protected:
|
2012-01-17 20:36:36 +00:00
|
|
|
/** Default constructor */
|
2013-10-18 21:10:33 +00:00
|
|
|
PopupChatWindow(bool tabbed, QWidget *parent = 0, Qt::WindowFlags flags = 0);
|
2012-01-17 20:36:36 +00:00
|
|
|
/** Default destructor */
|
|
|
|
~PopupChatWindow();
|
2010-11-15 20:49:24 +00:00
|
|
|
|
2012-01-27 14:49:48 +00:00
|
|
|
void showEvent(QShowEvent *event);
|
|
|
|
void closeEvent(QCloseEvent *event);
|
2010-11-15 20:49:24 +00:00
|
|
|
|
|
|
|
private slots:
|
2019-08-25 11:10:13 +02:00
|
|
|
void setStyle();
|
2012-01-17 20:36:36 +00:00
|
|
|
void getAvatar();
|
|
|
|
void tabChanged(ChatDialog *dialog);
|
|
|
|
void tabInfoChanged(ChatDialog *dialog);
|
|
|
|
void tabNewMessage(ChatDialog *dialog);
|
2012-01-26 21:30:57 +00:00
|
|
|
void tabClosed(ChatDialog *dialog);
|
2012-01-27 14:49:48 +00:00
|
|
|
void dialogClose(ChatDialog *dialog);
|
2012-01-17 20:36:36 +00:00
|
|
|
void dockTab();
|
|
|
|
void undockTab();
|
|
|
|
void setOnTop();
|
2012-10-25 18:06:33 +00:00
|
|
|
void blink(bool on);
|
2019-08-25 11:10:13 +02:00
|
|
|
void showContextMenu(QPoint p);
|
2022-05-08 20:38:35 +09:00
|
|
|
void voteParticipant();
|
2010-11-15 20:49:24 +00:00
|
|
|
|
|
|
|
private:
|
2012-01-17 20:36:36 +00:00
|
|
|
bool tabbedWindow;
|
|
|
|
bool firstShow;
|
2014-12-29 21:41:05 +00:00
|
|
|
ChatId chatId;
|
2012-01-17 20:36:36 +00:00
|
|
|
ChatDialog *chatDialog;
|
2012-10-25 18:06:33 +00:00
|
|
|
QIcon mBlinkIcon;
|
|
|
|
QIcon *mEmptyIcon;
|
2022-05-08 20:38:35 +09:00
|
|
|
QAction* votePositive;
|
|
|
|
QAction* voteNegative;
|
|
|
|
QAction* voteNeutral;
|
2010-11-15 20:49:24 +00:00
|
|
|
|
2012-01-17 20:36:36 +00:00
|
|
|
ChatDialog *getCurrentDialog();
|
|
|
|
void saveSettings();
|
|
|
|
void calculateStyle(ChatDialog *dialog);
|
2011-04-09 22:52:52 +00:00
|
|
|
|
2012-01-17 20:36:36 +00:00
|
|
|
/** Qt Designer generated object */
|
|
|
|
Ui::PopupChatWindow ui;
|
2010-11-15 20:49:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|