-
Notifications
You must be signed in to change notification settings - Fork 52
/
Copy pathroomchat.h
145 lines (130 loc) · 3.13 KB
/
roomchat.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
#ifndef ROOMCHAT_H
#define ROOMCHAT_H
#include <QDialog>
#include <QKeyEvent>
#include <QStringList>
#include <QList>
#include <QTreeView>
#include <QStandardItemModel>
#include <QStandardItem>
#include <QModelIndex>
#include <QTreeWidget>
#include <QByteArray>
#include "set_dirpath.h"
#include "chats.h"
namespace Ui {
class RoomChat;
}
class RoomChat : public QDialog
{
Q_OBJECT
public:
enum ChatType { CommonChat, GroupChat};
explicit RoomChat(QWidget *parent = 0);
~RoomChat();
void closeEvent(QCloseEvent *e);
void keyPressEvent(QKeyEvent *e);
void setSelfJid(QString s)
{
selfjid_=s;
}
void setChatType(int t){
chatType_ = t;
}
int getChatType() {
return chatType_;
}
//?????????
void setGrouplist(QStringList &s)
{
groupchatlist=s;
}
void setKey(QString s)
{
key = s;
}
static RoomChat* GetInstance()
{
if(!instance)
{
instance = new RoomChat;
}
return instance;
}
void clearList();
void pushFriend(QStringList &list); //
void scrollToBottom();
QString getCurrentTime(); //
public slots:
void slotclosed();
void slotloadmessage(QRect);
void flushfilelist(int);
void sendMessages(); //
void setchats();
void addMessage(QString fromjid, QString msg);//
void handleMessage(QString id,QString fromjid,QString body);
void download();
void push();
void pull();
void filepush();
void slotQAction();
void slotQActionfile();
void slotQActionopenfile();
void slotQActionopendir();
void slotaddfriend();
void slotpushfinished();
void slotfiledownloadfinished();
void slotaddfile();
////
void upload();
public:
void repostatus();
void set_remotepath(QString);//
void set_path(QString);//
void set_downloadflag();
void get_filename(QString);
void chat_initwindow(QString);
void setfilename(QString);
void releasebutton();
QString getpath();
void timerEvent(QTimerEvent *event);
void setcommitor(QString);
void setcommit_msg(QString);
int timer;
bool commit;
char commitor[256];//
char commit_msg[256];//
char file_name[256];//
QString head;
private slots:
void on_version_list_customContextMenuRequested(const QPoint &pos);
void on_file_list_customContextMenuRequested(const QPoint &pos);
void on_listWidget_customContextMenuRequested(const QPoint &pos);
void on_file_list_doubleClicked(const QModelIndex &index);
signals:
void addnewfreind(QString);
private:
Ui::RoomChat *ui;
QString selfjid_;
int chatType_;
chats* chat;
QStringList groupchatlist;
QString key;
QString version;
QString fname_fversion;
QString str_addFriend;
QString addJID;
bool version_reset;
bool file_reset;
static RoomChat* instance;
char remote_url[256];//
char path[256];//
int flag_down;//
QString chatspath;
QString chatsremote;
QList<QString> v_list;//
QList<QString> f_list;//
bool msgflag;
bool flushflag;
};
#endif // ROOMCHAT_H