2007-11-14 22:18:48 -05:00
|
|
|
/****************************************************************
|
|
|
|
* RShare is distributed under the following license:
|
|
|
|
*
|
2011-05-17 13:27:47 -04:00
|
|
|
* Copyright (C) 2006 - 2011 RetroShare Team
|
2007-11-14 22:18:48 -05:00
|
|
|
*
|
|
|
|
* 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.
|
2009-01-22 20:58:56 -05:00
|
|
|
****************************************************************/
|
|
|
|
|
2011-05-17 13:27:47 -04:00
|
|
|
#ifndef _FRIENDSDIALOG_H
|
|
|
|
#define _FRIENDSDIALOG_H
|
2009-01-22 20:58:56 -05:00
|
|
|
|
2010-09-04 10:23:30 -04:00
|
|
|
#include "chat/ChatStyle.h"
|
2009-11-17 07:45:06 -05:00
|
|
|
#include "RsAutoUpdatePage.h"
|
2009-01-22 20:58:56 -05:00
|
|
|
|
|
|
|
#include "mainpage.h"
|
|
|
|
|
2010-08-31 16:00:49 -04:00
|
|
|
#ifndef MINIMAL_RSGUI
|
2011-05-17 13:27:47 -04:00
|
|
|
#include "ui_FriendsDialog.h"
|
2010-08-31 16:00:49 -04:00
|
|
|
|
2008-07-10 06:34:49 -04:00
|
|
|
class QFont;
|
|
|
|
class QAction;
|
|
|
|
class QTextEdit;
|
|
|
|
class QTextCharFormat;
|
2012-01-18 15:02:19 -05:00
|
|
|
class ChatTabWidget;
|
2007-11-14 22:18:48 -05:00
|
|
|
|
2011-10-20 17:34:44 -04:00
|
|
|
class FriendsDialog : public RsAutoUpdatePage
|
2009-01-22 20:58:56 -05:00
|
|
|
{
|
2010-09-22 18:37:57 -04:00
|
|
|
Q_OBJECT
|
2009-10-04 18:27:42 -04:00
|
|
|
|
2010-01-31 17:29:30 -05:00
|
|
|
public:
|
2010-09-22 18:37:57 -04:00
|
|
|
/** Default Constructor */
|
2011-05-17 13:27:47 -04:00
|
|
|
FriendsDialog(QWidget *parent = 0);
|
2010-09-22 18:37:57 -04:00
|
|
|
/** Default Destructor */
|
2011-05-17 13:27:47 -04:00
|
|
|
~FriendsDialog ();
|
2009-10-04 18:27:42 -04:00
|
|
|
|
2010-09-22 18:37:57 -04:00
|
|
|
virtual void updateDisplay() ; // overloaded from RsAutoUpdatePage
|
2009-10-04 18:27:42 -04:00
|
|
|
|
2012-01-18 15:02:19 -05:00
|
|
|
static ChatTabWidget *getTabWidget();
|
|
|
|
|
2010-01-31 17:29:30 -05:00
|
|
|
public slots:
|
2009-10-04 18:27:42 -04:00
|
|
|
|
2010-09-22 18:37:57 -04:00
|
|
|
void publicChatChanged(int type);
|
2010-09-24 07:38:46 -04:00
|
|
|
// void toggleSendItem( QTreeWidgetItem *item, int col );
|
2009-10-04 18:27:42 -04:00
|
|
|
|
2010-09-22 18:37:57 -04:00
|
|
|
void insertChat();
|
|
|
|
void setChatInfo(QString info, QColor color=QApplication::palette().color(QPalette::WindowText));
|
|
|
|
void resetStatusBar() ;
|
2009-10-04 18:27:42 -04:00
|
|
|
|
2011-12-07 08:08:12 -05:00
|
|
|
void fileHashingFinished(QList<HashedFile> hashedFiles);
|
2009-10-04 18:27:42 -04:00
|
|
|
|
2010-09-22 18:37:57 -04:00
|
|
|
void smileyWidgetgroupchat();
|
|
|
|
void addSmileys();
|
2009-10-04 18:27:42 -04:00
|
|
|
|
2010-09-22 18:37:57 -04:00
|
|
|
// called by notifyQt when another peer is typing (in group chant and private chat)
|
|
|
|
void updatePeerStatusString(const QString& peer_id,const QString& status_string,bool is_private_chat) ;
|
|
|
|
|
2010-01-31 17:29:30 -05:00
|
|
|
protected:
|
2010-09-04 10:23:30 -04:00
|
|
|
bool eventFilter(QObject *obj, QEvent *ev);
|
|
|
|
void showEvent (QShowEvent *event);
|
2009-10-04 18:27:42 -04:00
|
|
|
|
2010-01-31 17:29:30 -05:00
|
|
|
private slots:
|
2010-09-22 18:37:57 -04:00
|
|
|
void pasteLink() ;
|
|
|
|
void contextMenu(QPoint) ;
|
|
|
|
|
2011-02-08 16:59:17 -05:00
|
|
|
void on_actionClear_Chat_History_triggered();
|
|
|
|
void on_actionDelete_Chat_History_triggered();
|
|
|
|
void on_actionMessageHistory_triggered();
|
|
|
|
|
2010-09-22 18:37:57 -04:00
|
|
|
void updateStatusString(const QString& peer_id, const QString& statusString) ; // called when a peer is typing in group chat
|
|
|
|
void updateStatusTyping() ; // called each time a key is hit
|
2009-10-04 18:27:42 -04:00
|
|
|
|
2010-09-22 18:37:57 -04:00
|
|
|
//void updatePeerStatusString(const QString& peer_id,const QString& chat_status) ;
|
2009-10-04 18:27:42 -04:00
|
|
|
|
2010-09-29 15:30:59 -04:00
|
|
|
void addFriend();
|
2010-07-15 07:25:34 -04:00
|
|
|
|
2010-09-22 18:37:57 -04:00
|
|
|
void setColor();
|
|
|
|
void insertSendList();
|
|
|
|
void sendMsg();
|
2009-10-04 18:27:42 -04:00
|
|
|
|
2010-09-22 18:37:57 -04:00
|
|
|
void statusmessage();
|
2009-10-04 18:27:42 -04:00
|
|
|
|
2010-09-22 18:37:57 -04:00
|
|
|
void setFont();
|
|
|
|
void getFont();
|
2009-10-04 18:27:42 -04:00
|
|
|
|
2010-09-22 18:37:57 -04:00
|
|
|
void getAvatar();
|
2009-10-04 18:27:42 -04:00
|
|
|
|
2010-09-22 18:37:57 -04:00
|
|
|
void on_actionAdd_Group_activated();
|
|
|
|
void on_actionCreate_New_Forum_activated();
|
|
|
|
void on_actionCreate_New_Channel_activated();
|
2009-10-04 18:27:42 -04:00
|
|
|
|
2010-09-22 18:37:57 -04:00
|
|
|
void loadmypersonalstatus();
|
2009-10-04 18:27:42 -04:00
|
|
|
|
2010-09-22 18:37:57 -04:00
|
|
|
void addExtraFile();
|
2009-10-04 18:27:42 -04:00
|
|
|
|
2010-09-22 18:37:57 -04:00
|
|
|
bool fileSave();
|
|
|
|
bool fileSaveAs();
|
2010-01-31 17:29:30 -05:00
|
|
|
|
2010-09-22 18:37:57 -04:00
|
|
|
void setCurrentFileName(const QString &fileName);
|
2010-06-18 17:59:33 -04:00
|
|
|
|
2010-11-10 07:24:36 -05:00
|
|
|
void newsFeedChanged(int count);
|
|
|
|
|
2012-01-12 11:24:36 -05:00
|
|
|
void createChatLobby();
|
2012-02-09 14:18:15 -05:00
|
|
|
void recommendFriends();
|
2012-01-11 19:13:25 -05:00
|
|
|
|
2009-05-15 08:07:37 -04:00
|
|
|
signals:
|
2010-09-22 18:37:57 -04:00
|
|
|
void notifyGroupChat(const QString&,const QString&) ;
|
2009-10-04 18:27:42 -04:00
|
|
|
|
2010-01-31 17:29:30 -05:00
|
|
|
private:
|
2010-09-22 18:37:57 -04:00
|
|
|
void processSettings(bool bLoad);
|
2011-09-29 05:20:09 -04:00
|
|
|
void addChatMsg(bool incoming, bool history, const QString &name, const QDateTime &sendTime, const QDateTime &recvTime, const QString &message);
|
2010-06-08 17:38:36 -04:00
|
|
|
|
2010-10-07 20:07:44 -04:00
|
|
|
void colorChanged(const QColor &c);
|
|
|
|
void fontChanged(const QFont &font);
|
|
|
|
|
2010-09-22 18:37:57 -04:00
|
|
|
QString fileName;
|
2009-10-04 18:27:42 -04:00
|
|
|
|
2010-09-22 18:37:57 -04:00
|
|
|
ChatStyle style;
|
2009-10-04 18:27:42 -04:00
|
|
|
|
2010-10-07 20:07:44 -04:00
|
|
|
QColor mCurrentColor;
|
2010-09-22 18:37:57 -04:00
|
|
|
time_t last_status_send_time ;
|
2010-05-11 20:17:10 -04:00
|
|
|
|
2010-09-22 18:37:57 -04:00
|
|
|
QFont mCurrentFont; /* how the text will come out */
|
2009-10-04 18:27:42 -04:00
|
|
|
|
2012-01-25 16:45:23 -05:00
|
|
|
QWidget *newsFeed;
|
2010-11-10 07:24:36 -05:00
|
|
|
QColor newsFeedTabColor;
|
|
|
|
QString newsFeedText;
|
|
|
|
|
2010-09-22 18:37:57 -04:00
|
|
|
/** Qt Designer generated object */
|
2011-05-17 13:27:47 -04:00
|
|
|
Ui::FriendsDialog ui;
|
2009-01-22 20:58:56 -05:00
|
|
|
};
|
|
|
|
|
2010-08-31 16:00:49 -04:00
|
|
|
#endif // MINIMAL_RSGUI
|
2009-01-22 20:58:56 -05:00
|
|
|
|
2011-08-14 18:31:05 -04:00
|
|
|
#endif
|