2010-09-01 10:15:50 -04:00
|
|
|
/****************************************************************
|
|
|
|
* RetroShare is distributed under the following license:
|
|
|
|
*
|
|
|
|
* Copyright (C) 2006 - 2010 The RetroShare Team
|
|
|
|
*
|
|
|
|
* 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 _IMHISTORYBROWSER_H
|
|
|
|
#define _IMHISTORYBROWSER_H
|
|
|
|
|
|
|
|
#include <QDialog>
|
|
|
|
|
|
|
|
#include "IMHistoryKeeper.h"
|
2010-09-04 19:59:08 -04:00
|
|
|
#include "gui/chat/ChatStyle.h"
|
2010-09-01 10:15:50 -04:00
|
|
|
|
|
|
|
#include "ui_ImHistoryBrowser.h"
|
|
|
|
|
2010-09-05 16:50:34 -04:00
|
|
|
class QTextEdit;
|
|
|
|
|
2010-09-01 10:15:50 -04:00
|
|
|
class ImHistoryBrowser : public QDialog
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
/** Default constructor */
|
2010-09-05 16:50:34 -04:00
|
|
|
ImHistoryBrowser(bool isPrivateChat, IMHistoryKeeper &histKeeper, QTextEdit *edit, QWidget *parent = 0, Qt::WFlags flags = 0);
|
2010-09-01 10:15:50 -04:00
|
|
|
/** Default destructor */
|
2010-09-05 06:32:32 -04:00
|
|
|
virtual ~ImHistoryBrowser();
|
|
|
|
|
2010-09-05 16:50:34 -04:00
|
|
|
protected:
|
|
|
|
bool eventFilter(QObject *obj, QEvent *ev);
|
|
|
|
|
2010-09-01 10:15:50 -04:00
|
|
|
private slots:
|
2010-09-04 10:23:30 -04:00
|
|
|
void historyAdd(IMHistoryItem item);
|
2010-09-05 16:50:34 -04:00
|
|
|
void historyRemove(IMHistoryItem item);
|
2010-09-04 10:23:30 -04:00
|
|
|
void historyClear();
|
2010-09-01 10:15:50 -04:00
|
|
|
|
2010-09-04 19:59:08 -04:00
|
|
|
void filterRegExpChanged();
|
|
|
|
void clearFilter();
|
|
|
|
|
2010-09-05 16:50:34 -04:00
|
|
|
void itemSelectionChanged();
|
|
|
|
void customContextMenuRequested(QPoint pos);
|
|
|
|
|
|
|
|
void copyMessage();
|
|
|
|
void removeMessages();
|
|
|
|
void clearHistory();
|
|
|
|
void sendMessage();
|
|
|
|
|
2010-09-01 10:15:50 -04:00
|
|
|
private:
|
2010-09-04 19:59:08 -04:00
|
|
|
QListWidgetItem *addItem(IMHistoryItem &item);
|
|
|
|
void filterItems(QListWidgetItem *item = NULL);
|
2010-09-04 10:23:30 -04:00
|
|
|
|
2010-09-05 16:50:34 -04:00
|
|
|
void getSelectedItems(QList<int> &items);
|
|
|
|
|
2010-09-04 19:59:08 -04:00
|
|
|
bool isPrivateChat;
|
2010-09-05 16:50:34 -04:00
|
|
|
QTextEdit *textEdit;
|
2010-09-04 19:59:08 -04:00
|
|
|
bool embedSmileys;
|
2010-09-04 10:23:30 -04:00
|
|
|
IMHistoryKeeper &historyKeeper;
|
2010-09-04 19:59:08 -04:00
|
|
|
ChatStyle style;
|
2010-09-01 10:15:50 -04:00
|
|
|
|
|
|
|
/** Qt Designer generated object */
|
|
|
|
Ui::ImHistoryBrowser ui;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|