2009-12-28 17:40:45 -05:00
|
|
|
#ifndef RSIFACE_NOTIFY_TXT_H
|
|
|
|
#define RSIFACE_NOTIFY_TXT_H
|
|
|
|
|
2010-08-06 05:40:23 -04:00
|
|
|
#include <retroshare/rsiface.h>
|
|
|
|
#include <retroshare/rsturtle.h>
|
2009-12-28 17:40:45 -05:00
|
|
|
#include <QObject>
|
2010-12-07 19:14:12 -05:00
|
|
|
//#include <QMutex>
|
2009-12-28 17:40:45 -05:00
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
2010-12-07 19:14:12 -05:00
|
|
|
class QTimer;
|
2009-12-28 17:40:45 -05:00
|
|
|
class NetworkDialog;
|
2011-05-17 13:27:47 -04:00
|
|
|
class FriendsDialog;
|
2009-12-28 17:40:45 -05:00
|
|
|
class SharedFilesDialog;
|
|
|
|
class TransfersDialog;
|
|
|
|
class ChatDialog;
|
|
|
|
class MessagesDialog;
|
|
|
|
class ChannelsDialog;
|
|
|
|
class MessengerWindow;
|
2010-12-07 19:14:12 -05:00
|
|
|
class Toaster;
|
2010-09-07 11:49:31 -04:00
|
|
|
struct TurtleFileInfo;
|
2009-12-28 17:40:45 -05:00
|
|
|
|
|
|
|
//class NotifyQt: public NotifyBase, public QObject
|
|
|
|
class NotifyQt: public QObject, public NotifyBase
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2010-07-18 07:43:39 -04:00
|
|
|
static NotifyQt *Create ();
|
|
|
|
static NotifyQt *getInstance ();
|
2009-12-28 17:40:45 -05:00
|
|
|
|
|
|
|
virtual ~NotifyQt() { return; }
|
|
|
|
|
|
|
|
void setNetworkDialog(NetworkDialog *c) { cDialog = c; }
|
|
|
|
|
|
|
|
virtual void notifyListPreChange(int list, int type);
|
|
|
|
virtual void notifyListChange(int list, int type);
|
|
|
|
virtual void notifyErrorMsg(int list, int sev, std::string msg);
|
|
|
|
virtual void notifyChatStatus(const std::string& peer_id,const std::string& status_string,bool is_private);
|
2010-09-02 06:15:13 -04:00
|
|
|
virtual void notifyCustomState(const std::string& peer_id, const std::string& status_string);
|
2010-10-09 14:35:34 -04:00
|
|
|
virtual void notifyHashingInfo(uint32_t type, const std::string& fileinfo);
|
2009-12-28 17:40:45 -05:00
|
|
|
virtual void notifyTurtleSearchResult(uint32_t search_id,const std::list<TurtleFileInfo>& found_files);
|
|
|
|
virtual void notifyPeerHasNewAvatar(std::string peer_id) ;
|
|
|
|
virtual void notifyOwnAvatarChanged() ;
|
|
|
|
virtual void notifyOwnStatusMessageChanged() ;
|
2010-05-21 16:49:48 -04:00
|
|
|
virtual void notifyDiskFull(uint32_t loc,uint32_t size_in_mb) ;
|
2010-08-20 14:45:44 -04:00
|
|
|
/* peer has changed the state */
|
|
|
|
virtual void notifyPeerStatusChanged(const std::string& peer_id, uint32_t state);
|
|
|
|
/* one or more peers has changed the states */
|
|
|
|
virtual void notifyPeerStatusChangedSummary();
|
2010-10-06 20:17:42 -04:00
|
|
|
virtual void notifyChannelMsgReadSatusChanged(const std::string& channelId, const std::string& msgId, uint32_t status);
|
2011-09-29 05:20:09 -04:00
|
|
|
virtual void notifyHistoryChanged(uint32_t msgId, int type);
|
2010-10-06 20:17:42 -04:00
|
|
|
|
2010-11-05 18:46:40 -04:00
|
|
|
virtual void notifyDiscInfoChanged() ;
|
2010-11-24 19:20:25 -05:00
|
|
|
virtual void notifyDownloadComplete(const std::string& fileHash);
|
|
|
|
virtual void notifyDownloadCompleteCount(uint32_t count);
|
2011-08-05 16:45:09 -04:00
|
|
|
virtual bool askForPassword(const std::string& key_details, bool prev_is_bad, std::string& password);
|
2009-12-28 17:40:45 -05:00
|
|
|
|
2010-09-07 11:49:31 -04:00
|
|
|
/* Notify from GUI */
|
|
|
|
void notifyChatStyleChanged(int /*ChatStyle::enumStyleType*/ styleType);
|
|
|
|
|
2009-12-28 17:40:45 -05:00
|
|
|
signals:
|
|
|
|
// It's beneficial to send info to the GUI using signals, because signals are thread-safe
|
|
|
|
// as they get queued by Qt.
|
|
|
|
//
|
|
|
|
void hashingInfoChanged(const QString&) const ;
|
|
|
|
void filesPreModChanged(bool) const ;
|
|
|
|
void filesPostModChanged(bool) const ;
|
|
|
|
void transfersChanged() const ;
|
|
|
|
void friendsChanged() const ;
|
2011-08-21 18:28:19 -04:00
|
|
|
void neighboursChanged() const ;
|
2009-12-28 17:40:45 -05:00
|
|
|
void messagesChanged() const ;
|
2010-08-22 18:12:26 -04:00
|
|
|
void messagesTagsChanged() const;
|
2010-08-09 17:20:34 -04:00
|
|
|
void forumsChanged() const ; // use connect with Qt::QueuedConnection
|
2010-10-06 20:17:42 -04:00
|
|
|
void channelsChanged(int type) const ; // use connect with Qt::QueuedConnection
|
2009-12-28 17:40:45 -05:00
|
|
|
void configChanged() const ;
|
|
|
|
void logInfoChanged(const QString&) const ;
|
|
|
|
void chatStatusChanged(const QString&,const QString&,bool) const ;
|
2010-09-02 06:15:13 -04:00
|
|
|
void peerHasNewCustomStateString(const QString& /* peer_id */, const QString& /* status_string */) const ;
|
2009-12-28 17:40:45 -05:00
|
|
|
void gotTurtleSearchResult(qulonglong search_id,FileDetail file) const ;
|
|
|
|
void peerHasNewAvatar(const QString& peer_id) const ;
|
|
|
|
void ownAvatarChanged() const ;
|
|
|
|
void ownStatusMessageChanged() const ;
|
2010-02-07 13:10:12 -05:00
|
|
|
void errorOccurred(int,int,const QString&) const ;
|
2010-05-21 16:49:48 -04:00
|
|
|
void diskFull(int,int) const ;
|
2010-08-31 13:13:52 -04:00
|
|
|
void peerStatusChanged(const QString& /* peer_id */, int /* status */);
|
|
|
|
void peerStatusChangedSummary() const;
|
2010-09-01 13:56:15 -04:00
|
|
|
void publicChatChanged(int type) const ;
|
2010-09-20 20:08:06 -04:00
|
|
|
void privateChatChanged(int list, int type) const ;
|
2010-09-22 18:37:57 -04:00
|
|
|
void groupsChanged(int type) const ;
|
2010-11-05 18:46:40 -04:00
|
|
|
void discInfoChanged() const ;
|
2010-11-24 19:20:25 -05:00
|
|
|
void downloadComplete(const QString& /* fileHash */);
|
|
|
|
void downloadCompleteCountChanged(int /* count */);
|
2010-10-06 20:17:42 -04:00
|
|
|
void channelMsgReadSatusChanged(const QString& channelId, const QString& msgId, int status);
|
2011-09-29 05:20:09 -04:00
|
|
|
void historyChanged(uint msgId, int type);
|
2009-12-28 17:40:45 -05:00
|
|
|
|
2010-09-07 11:49:31 -04:00
|
|
|
/* Notify from GUI */
|
|
|
|
void chatStyleChanged(int /*ChatStyle::enumStyleType*/ styleType);
|
|
|
|
|
2009-12-28 17:40:45 -05:00
|
|
|
public slots:
|
|
|
|
|
|
|
|
void UpdateGUI(); /* called by timer */
|
|
|
|
|
2010-12-07 19:14:12 -05:00
|
|
|
private slots:
|
|
|
|
void runningTick();
|
|
|
|
|
2009-12-28 17:40:45 -05:00
|
|
|
private:
|
2010-12-07 19:14:12 -05:00
|
|
|
NotifyQt();
|
2010-07-18 07:43:39 -04:00
|
|
|
|
|
|
|
static NotifyQt *_instance;
|
2009-12-28 17:40:45 -05:00
|
|
|
|
2010-12-07 19:14:12 -05:00
|
|
|
void startWaitingToasters();
|
|
|
|
|
|
|
|
// QMutex waitingToasterMutex; // for lock of the waiting toaster list
|
|
|
|
QList<Toaster*> waitingToasterList;
|
|
|
|
|
|
|
|
QTimer *runningToasterTimer;
|
|
|
|
// QMutex runningToasterMutex; // for lock of the running toaster list
|
|
|
|
QList<Toaster*> runningToasterList;
|
|
|
|
|
2009-12-28 17:40:45 -05:00
|
|
|
// void displayNeighbours();
|
|
|
|
// void displayFriends();
|
|
|
|
// void displayDirectories();
|
|
|
|
// void displaySearch();
|
|
|
|
// void displayChat();
|
|
|
|
// void displayMessages();
|
|
|
|
// void displayChannels();
|
|
|
|
// void displayTransfers();
|
|
|
|
|
|
|
|
// void preDisplayNeighbours();
|
|
|
|
// void preDisplayFriends();
|
|
|
|
// void preDisplayDirectories();
|
|
|
|
// void preDisplaySearch();
|
|
|
|
// void preDisplayMessages();
|
|
|
|
// void preDisplayChannels();
|
|
|
|
// void preDisplayTransfers();
|
|
|
|
|
|
|
|
/* so we can update windows */
|
|
|
|
NetworkDialog *cDialog;
|
2011-05-17 13:27:47 -04:00
|
|
|
// FriendsDialog *fDialog;
|
2009-12-28 17:40:45 -05:00
|
|
|
// SharedFilesDialog *dDialog;
|
|
|
|
// TransfersDialog *tDialog;
|
|
|
|
// ChatDialog *hDialog;
|
|
|
|
// MessagesDialog *mDialog;
|
|
|
|
// ChannelsDialog *sDialog;
|
|
|
|
// MessengerWindow *mWindow;
|
|
|
|
|
|
|
|
// RsIface *iface;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|