├── IMClient ├── IMClient ├── IMClient.pro ├── IMClient.pro.user ├── Makefile ├── control │ ├── IMClientFileCtrl.cpp │ ├── IMClientFileCtrl.h │ ├── IMClientMessageCtrl.cpp │ ├── IMClientMessageCtrl.h │ ├── IMDatabaseCtrl.cpp │ ├── IMDatabaseCtrl.h │ ├── IMLoginCtrl.cpp │ ├── IMLoginCtrl.h │ ├── IMMailCtrl.cpp │ ├── IMMailCtrl.h │ ├── IMMainCtrl.cpp │ ├── IMMainCtrl.h │ ├── IMRegisterCtrl.cpp │ ├── IMRegisterCtrl.h │ ├── IMVideoCtrl.cpp │ └── IMVideoCtrl.h ├── external │ └── CustomCalendar │ │ ├── CalendarDialog.cpp │ │ ├── CalendarDialog.h │ │ ├── CustomCalendar.cpp │ │ ├── CustomCalendar.h │ │ ├── CustomCalendar.pro │ │ ├── CustomComboBox.cpp │ │ ├── CustomComboBox.h │ │ ├── CustomLineEdit.cpp │ │ ├── CustomLineEdit.h │ │ ├── Makefile │ │ ├── include │ │ ├── CalendarDialog.h │ │ ├── CustomCalendar.h │ │ ├── CustomComboBox.h │ │ └── CustomLineEdit.h │ │ ├── lib │ │ ├── libCustomCalendar.so │ │ ├── libCustomCalendar.so.1 │ │ ├── libCustomCalendar.so.1.0 │ │ └── libCustomCalendar.so.1.0.0 │ │ ├── moc_CalendarDialog.cpp │ │ ├── moc_CustomCalendar.cpp │ │ ├── moc_CustomComboBox.cpp │ │ └── moc_CustomLineEdit.cpp ├── main.cpp ├── model │ ├── IMConstant.h │ ├── IMEncryption.cpp │ ├── IMEncryption.h │ ├── IMTcpSocket.cpp │ ├── IMTcpSocket.h │ ├── IMUser.cpp │ └── IMUser.h ├── resource │ ├── config │ │ └── auto_login.im │ └── image │ │ ├── add.png │ │ ├── addDiscussion.png │ │ ├── addFlock.png │ │ ├── addFriend.png │ │ ├── add_file.png │ │ ├── add_folder.png │ │ ├── attach.png │ │ ├── camera.png │ │ ├── cancel.png │ │ ├── clear.png │ │ ├── color.png │ │ ├── colour.png │ │ ├── config.png │ │ ├── deleteAll.png │ │ ├── deleteDate.png │ │ ├── deleteOne.png │ │ ├── delete_file.png │ │ ├── delete_folder.png │ │ ├── discussion.png │ │ ├── download_file.png │ │ ├── download_folder.png │ │ ├── download_message.png │ │ ├── edit_file.png │ │ ├── export.png │ │ ├── exportAll.png │ │ ├── exportOne.png │ │ ├── file.png │ │ ├── flock.png │ │ ├── folder.png │ │ ├── font.png │ │ ├── font_bold.png │ │ ├── font_italic.png │ │ ├── font_underline.png │ │ ├── head │ │ ├── 1.bmp │ │ ├── 10.bmp │ │ ├── 100.bmp │ │ ├── 101.bmp │ │ ├── 102.bmp │ │ ├── 103.bmp │ │ ├── 104.bmp │ │ ├── 105.bmp │ │ ├── 106.bmp │ │ ├── 107.bmp │ │ ├── 108.bmp │ │ ├── 109.bmp │ │ ├── 11.bmp │ │ ├── 110.bmp │ │ ├── 111.bmp │ │ ├── 112.bmp │ │ ├── 113.bmp │ │ ├── 114.bmp │ │ ├── 115.bmp │ │ ├── 116.bmp │ │ ├── 117.bmp │ │ ├── 118.bmp │ │ ├── 119.bmp │ │ ├── 12.bmp │ │ ├── 120.bmp │ │ ├── 121.bmp │ │ ├── 122.bmp │ │ ├── 123.bmp │ │ ├── 124.bmp │ │ ├── 125.bmp │ │ ├── 126.bmp │ │ ├── 127.bmp │ │ ├── 128.bmp │ │ ├── 129.bmp │ │ ├── 13.bmp │ │ ├── 130.bmp │ │ ├── 131.bmp │ │ ├── 132.bmp │ │ ├── 133.bmp │ │ ├── 14.bmp │ │ ├── 15.bmp │ │ ├── 16.bmp │ │ ├── 17.bmp │ │ ├── 18.bmp │ │ ├── 19.bmp │ │ ├── 2.bmp │ │ ├── 20.bmp │ │ ├── 21.bmp │ │ ├── 22.bmp │ │ ├── 23.bmp │ │ ├── 24.bmp │ │ ├── 25.bmp │ │ ├── 26.bmp │ │ ├── 27.bmp │ │ ├── 28.bmp │ │ ├── 29.bmp │ │ ├── 3.bmp │ │ ├── 30.bmp │ │ ├── 31.bmp │ │ ├── 32.bmp │ │ ├── 33.bmp │ │ ├── 34.bmp │ │ ├── 35.bmp │ │ ├── 36.bmp │ │ ├── 37.bmp │ │ ├── 38.bmp │ │ ├── 39.bmp │ │ ├── 4.bmp │ │ ├── 40.bmp │ │ ├── 41.bmp │ │ ├── 42.bmp │ │ ├── 43.bmp │ │ ├── 44.bmp │ │ ├── 45.bmp │ │ ├── 46.bmp │ │ ├── 47.bmp │ │ ├── 48.bmp │ │ ├── 49.bmp │ │ ├── 5.bmp │ │ ├── 50.bmp │ │ ├── 51.bmp │ │ ├── 52.bmp │ │ ├── 53.bmp │ │ ├── 54.bmp │ │ ├── 55.bmp │ │ ├── 56.bmp │ │ ├── 57.bmp │ │ ├── 58.bmp │ │ ├── 59.bmp │ │ ├── 6.bmp │ │ ├── 60.bmp │ │ ├── 61.bmp │ │ ├── 62.bmp │ │ ├── 63.bmp │ │ ├── 64.bmp │ │ ├── 65.bmp │ │ ├── 66.bmp │ │ ├── 67.bmp │ │ ├── 68.bmp │ │ ├── 69.bmp │ │ ├── 7.bmp │ │ ├── 70.bmp │ │ ├── 71.bmp │ │ ├── 72.bmp │ │ ├── 73.bmp │ │ ├── 74.bmp │ │ ├── 75.bmp │ │ ├── 76.bmp │ │ ├── 77.bmp │ │ ├── 78.bmp │ │ ├── 79.bmp │ │ ├── 8.bmp │ │ ├── 80.bmp │ │ ├── 81.bmp │ │ ├── 82.bmp │ │ ├── 83.bmp │ │ ├── 84.bmp │ │ ├── 85.bmp │ │ ├── 86.bmp │ │ ├── 87.bmp │ │ ├── 88.bmp │ │ ├── 89.bmp │ │ ├── 9.bmp │ │ ├── 90.bmp │ │ ├── 91.bmp │ │ ├── 92.bmp │ │ ├── 93.bmp │ │ ├── 94.bmp │ │ ├── 95.bmp │ │ ├── 96.bmp │ │ ├── 97.bmp │ │ ├── 98.bmp │ │ └── 99.bmp │ │ ├── history.png │ │ ├── imgRes.qrc │ │ ├── import.png │ │ ├── importAll.png │ │ ├── mail.png │ │ ├── mailRead.png │ │ ├── mailUnRead.png │ │ ├── message.png │ │ ├── messageBox.png │ │ ├── microphone.png │ │ ├── newMessage.png │ │ ├── no.png │ │ ├── noMessage.png │ │ ├── picture.png │ │ ├── plane.png │ │ ├── replay_calendar_left_arrow_btn.png │ │ ├── replay_calendar_right_arrow_btn.png │ │ ├── search.png │ │ ├── searchAdd.png │ │ ├── send_file.png │ │ ├── space.png │ │ └── upload_folder.png └── view │ ├── CalendarDialog.cpp │ ├── CalendarDialog.h │ ├── CustomCalendar.cpp │ ├── CustomCalendar.h │ ├── CustomComboBox.cpp │ ├── CustomComboBox.h │ ├── CustomLineEdit.cpp │ ├── CustomLineEdit.h │ ├── IMChatWidget.cpp │ ├── IMChatWidget.h │ ├── IMClickLabel.cpp │ ├── IMClickLabel.h │ ├── IMDiscussionButton.cpp │ ├── IMDiscussionButton.h │ ├── IMDiscussionChatWidget.cpp │ ├── IMDiscussionChatWidget.h │ ├── IMDiscussionInformationWidget.cpp │ ├── IMDiscussionInformationWidget.h │ ├── IMDiscussionListWidget.cpp │ ├── IMDiscussionListWidget.h │ ├── IMDiscussionMemberButton.cpp │ ├── IMDiscussionMemberButton.h │ ├── IMDiscussionMemberListWidget.cpp │ ├── IMDiscussionMemberListWidget.h │ ├── IMFileReceiverWidget.cpp │ ├── IMFileReceiverWidget.h │ ├── IMFileSenderWidget.cpp │ ├── IMFileSenderWidget.h │ ├── IMFlockButton.cpp │ ├── IMFlockButton.h │ ├── IMFlockChatWidget.cpp │ ├── IMFlockChatWidget.h │ ├── IMFlockInformationWidget.cpp │ ├── IMFlockInformationWidget.h │ ├── IMFlockListWidget.cpp │ ├── IMFlockListWidget.h │ ├── IMFlockMemberButton.cpp │ ├── IMFlockMemberButton.h │ ├── IMFlockMemberListWidget.cpp │ ├── IMFlockMemberListWidget.h │ ├── IMForgotPwdWidget.cpp │ ├── IMForgotPwdWidget.h │ ├── IMFriendButton.cpp │ ├── IMFriendButton.h │ ├── IMFriendListWidget.cpp │ ├── IMFriendListWidget.h │ ├── IMInformationWidget.cpp │ ├── IMInformationWidget.h │ ├── IMInputTextEdit.cpp │ ├── IMInputTextEdit.h │ ├── IMLatestMessageListWidget.cpp │ ├── IMLatestMessageListWidget.h │ ├── IMLinkButton.cpp │ ├── IMLinkButton.h │ ├── IMLinkDiscussionButton.cpp │ ├── IMLinkDiscussionButton.h │ ├── IMLinkFlockButton.cpp │ ├── IMLinkFlockButton.h │ ├── IMLinkFriendButton.cpp │ ├── IMLinkFriendButton.h │ ├── IMLittleWidget.cpp │ ├── IMLittleWidget.h │ ├── IMLocalMessageWidget.cpp │ ├── IMLocalMessageWidget.h │ ├── IMLoginWidget.cpp │ ├── IMLoginWidget.h │ ├── IMMailButton.cpp │ ├── IMMailButton.h │ ├── IMMailInWidget.cpp │ ├── IMMailInWidget.h │ ├── IMMailInformationWidget.cpp │ ├── IMMailInformationWidget.h │ ├── IMMailListWidget.cpp │ ├── IMMailListWidget.h │ ├── IMMailOutWidget.cpp │ ├── IMMailOutWidget.h │ ├── IMMailWidget.cpp │ ├── IMMailWidget.h │ ├── IMMailWriteWidget.cpp │ ├── IMMailWriteWidget.h │ ├── IMMainWidget.cpp │ ├── IMMainWidget.h │ ├── IMMessageManageWidget.cpp │ ├── IMMessageManageWidget.h │ ├── IMMessageWidget.cpp │ ├── IMMessageWidget.h │ ├── IMNetWorkMessageWidget.cpp │ ├── IMNetWorkMessageWidget.h │ ├── IMRegisterWidget.cpp │ ├── IMRegisterWidget.h │ ├── IMSearchListWidget.cpp │ ├── IMSearchListWidget.h │ ├── IMToolBox.cpp │ └── IMToolBox.h ├── IMServer ├── IMServer ├── IMServer.pro ├── Makefile ├── control │ ├── IMClientSocketCtrl.cpp │ ├── IMClientSocketCtrl.h │ ├── IMDatabaseCtrl.cpp │ ├── IMDatabaseCtrl.h │ ├── IMServerMessageCtrl.cpp │ └── IMServerMessageCtrl.h ├── main.cpp ├── model │ ├── IMConstant.h │ ├── IMEncryption.h │ ├── IMTcpServer.cpp │ ├── IMTcpServer.h │ ├── IMThread.cpp │ ├── IMThread.h │ ├── IMUser.cpp │ └── IMUser.h └── view │ ├── IMServerWindow.cpp │ └── IMServerWindow.h ├── README.md └── 数据库文件 ├── client.sql └── server.sql /IMClient/IMClient: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/IMClient -------------------------------------------------------------------------------- /IMClient/control/IMClientFileCtrl.h: -------------------------------------------------------------------------------- 1 | /********************************************* 2 | File Name: IMClientFileCtrl.h 3 | Author: jet.F.R 4 | Date: 2014.3.23 5 | Description: xml文件读写 6 | Changes: 7 | ********************************************/ 8 | #ifndef IMCLIENTFILECTRL_H 9 | #define IMCLIENTFILECTRL_H 10 | 11 | #include 12 | class QXmlStreamWriter; 13 | class QXmlStreamReader; 14 | class QTextBrowser; 15 | 16 | class IMClientFileCtrl : public QObject 17 | { 18 | Q_OBJECT 19 | public: 20 | explicit IMClientFileCtrl(QObject *parent = 0); 21 | // 写自动登录的文件 22 | static bool writeAutoLogin(const QString &fileName, const QString &id, 23 | const QString &pwd, const bool isAuto = false); 24 | // 读自动登录的文件 25 | static bool readAutoLogin(const QString &fileName,QString &id, 26 | QString &pwd, bool &isAuto); 27 | 28 | // 删除文件 29 | static bool remove(const QString &filename); 30 | 31 | static QString simplifyRichText(QString richText); 32 | 33 | static void saveTalkHistory(const QString filePath, const QString fileName, 34 | const QTextBrowser *messagaShow); 35 | static void readTalkHistory(const QString filePath, const QString fileName, 36 | QTextBrowser *messagaShow); 37 | 38 | signals: 39 | 40 | public slots: 41 | 42 | private: 43 | // QXmlStreamWriter m_write; 44 | // QXmlStreamReader m_read; 45 | 46 | }; 47 | 48 | #endif // IMCLIENTFILECTRL_H 49 | -------------------------------------------------------------------------------- /IMClient/control/IMClientMessageCtrl.h: -------------------------------------------------------------------------------- 1 | ///********************************************* 2 | //File Name: IMClientMessageCtrl.h 3 | //Author: jet.F.R 4 | //Date: 2014.3.10 5 | //Description: 用于控制通信的类 6 | //Changes: 7 | //********************************************/ 8 | 9 | //#ifndef IMCLIENTMESSAGECTRL_H 10 | //#define IMCLIENTMESSAGECTRL_H 11 | 12 | //#include 13 | //#include 14 | //#include 15 | 16 | //class IMTcpSocket; 17 | //class IMUser; 18 | 19 | //enum MessageType 20 | //{ 21 | // CONNECT = 0, // 连接 22 | // LOGIN = 1, // 登录 23 | // REGISTER = 2 // 注册 24 | //}; 25 | 26 | //enum LoginStatus 27 | //{ 28 | // ONLINE = 0, // 在线 29 | // INVISIBLE = 1, // 隐身 30 | // BUSY = 2, // 忙碌 31 | // LEAVE = 3, // 离开 32 | // NOTDISTURB = 4 // 请勿打扰 33 | //}; 34 | 35 | ///************************************************* 36 | //Class Name: IMClientMessageCtrl 37 | //Description: 用于控制通信的类 38 | //*************************************************/ 39 | //class IMClientMessageCtrl : public QObject 40 | //{ 41 | // Q_OBJECT 42 | //public: 43 | // explicit IMClientMessageCtrl(QObject *parent = 0); 44 | // ~IMClientMessageCtrl(); 45 | // // 发送信息 46 | // void sendMessage(MessageType, const QString &mes1, 47 | // const QString &mes2 = "", LoginStatus status = ONLINE, 48 | // const IMUser * user = NULL); 49 | 50 | // static QHostAddress sm_hostAddress; 51 | // static qint16 sm_hostPort; 52 | 53 | //signals: 54 | // void showLoginStatus(const QString &, bool isLogin = false); 55 | 56 | //public slots: 57 | 58 | //private slots: 59 | // // 连接被客户端关闭 60 | // //void connectionClosed(); 61 | // // 读取信息 62 | // void readMessage(); 63 | // // 显示错误 64 | // //void dispalyError(QAbstractSocket::SocketError); 65 | // // 发送登录请求 66 | // void requestLogin(); 67 | // // 发送注册请求 68 | // void requsetRegister(const IMUser *); 69 | 70 | //private: 71 | // // 初始化 72 | // void initIMClientMessageCtrl(); 73 | // // 链接信号与槽 74 | // //void linkSignalWithSlot(); 75 | // // 请求连接 76 | // void requestConnect(); 77 | // // 获取ip 78 | // //QString getIP(); 79 | 80 | //private: 81 | // IMTcpSocket *m_tcpSocket; 82 | // quint16 m_blockSize; 83 | 84 | // QString m_id; 85 | // QString m_pwd; 86 | // LoginStatus m_status; 87 | 88 | // bool m_isConnected; 89 | 90 | //}; 91 | //#endif // IMCLIENTMESSAGECTRL_H 92 | -------------------------------------------------------------------------------- /IMClient/control/IMDatabaseCtrl.h: -------------------------------------------------------------------------------- 1 | #ifndef IMDATABASECTRL_H 2 | #define IMDATABASECTRL_H 3 | 4 | #include 5 | #include "model/IMConstant.h" 6 | 7 | class QSqlQuery; 8 | class QSqlDatabase; 9 | class QDateTime; 10 | 11 | class IMDatabaseCtrl : public QObject 12 | { 13 | Q_OBJECT 14 | public: 15 | IMDatabaseCtrl(const QString myID, QObject *parent = 0); 16 | ~IMDatabaseCtrl(); 17 | // 创建连接 18 | bool createConnection(); 19 | // 关闭数据库 20 | void close(); 21 | // 打开数据库 22 | bool isOpen(); 23 | 24 | /************消息管理*********************/ 25 | // 存储历史记录 26 | bool addHistoryMessage(const TalkMessage &); 27 | // 获取某日的消息记录 28 | bool searchHistoryMessage(const QString &myID , const QString &friendID, 29 | const QDate &date, QVector &mesVec); 30 | // 导出与某位好友的消息记录 31 | int exportHistoryMessageOneFriend(const QString &myID , 32 | const QString &friendID, 33 | const QString &fileName); 34 | // 导出所有好友消息记录 35 | int exportHistoryMessageAll(const QString &myID, const QString &fileName); 36 | 37 | // 删除单个好友消息记录 38 | int deleteHistoryMessageOneFriend(const QString myID, const QString friendID); 39 | // 删除所有好友消息记录 40 | int deleteHistoryMessageAll(const QString myID); 41 | 42 | signals: 43 | 44 | public slots: 45 | 46 | private: 47 | //检查SQL语句的正确性 48 | void errorSQLOrder(QSqlQuery query, QString mark); 49 | //创建数据库表格 50 | void createTable(); 51 | private: 52 | QSqlDatabase *m_db; 53 | QString m_myID; 54 | QString m_localHistoryTableName; 55 | }; 56 | 57 | #endif // IMDATABASECTRL_H 58 | -------------------------------------------------------------------------------- /IMClient/control/IMLoginCtrl.h: -------------------------------------------------------------------------------- 1 | /********************************************* 2 | File Name: IMLoginCtrl.h 3 | Author: jet.F.R 4 | Date: 2014.3.10 5 | Description: 用于控制登录的类 6 | Changes: 7 | ********************************************/ 8 | 9 | #ifndef IMLOGINCTRL_H 10 | #define IMLOGINCTRL_H 11 | 12 | #include 13 | #include "model/IMTcpSocket.h" 14 | 15 | class IMTcpSocket; 16 | 17 | /************************************************* 18 | Class Name: IMLoginCtrl 19 | Description: 用于控制登录的类 20 | *************************************************/ 21 | class IMLoginCtrl : public QObject 22 | { 23 | Q_OBJECT 24 | public: 25 | explicit IMLoginCtrl(QObject *parent = 0); 26 | 27 | ~IMLoginCtrl(); 28 | 29 | // 发送登录信息 30 | void login(const QString &id ,const QString & pwd = "", 31 | const int status = ONLINE); 32 | // 获取密保信息 33 | void getQuestionAndAnswer(const QString &id); 34 | 35 | signals: 36 | void getLoginMessgae(const QString &, bool isLogin = false, 37 | const UserInformation * me = 0); 38 | void getQuestionAndAnswerSuccess(const TempStrings & tmpStr); 39 | 40 | public slots: 41 | // 改变登录信息 42 | void changeLoginMessage(const QString &mes, bool isLogin); 43 | 44 | 45 | private slots: 46 | // 发送获取密保问题以及答案的请求 47 | void requestGetQuestionAndAnswer(); 48 | // 发送登录请求 49 | void requestLogin(); 50 | 51 | // 发送请求 52 | void sendRequest(); 53 | 54 | // 读取信息 55 | void readMessage(); 56 | 57 | private: 58 | 59 | private: 60 | int m_kind; 61 | quint16 m_blockSize; 62 | IMTcpSocket *m_tcpSocket; 63 | LoginInformation m_loginInfo; 64 | UserInformation m_myself; 65 | TempStrings m_tempStr; 66 | QString m_id; 67 | }; 68 | 69 | #endif // IMLOGINCTRL_H 70 | -------------------------------------------------------------------------------- /IMClient/control/IMMailCtrl.h: -------------------------------------------------------------------------------- 1 | #ifndef IMMAILCTRL_H 2 | #define IMMAILCTRL_H 3 | 4 | #include 5 | #include "model/IMConstant.h" 6 | #include 7 | 8 | 9 | class IMTcpSocket; 10 | class QString; 11 | class QTreeView; 12 | class QModelIndex; 13 | class QStandardItem; 14 | class QStandardItemModel; 15 | 16 | 17 | class IMMailCtrl : public QObject 18 | { 19 | Q_OBJECT 20 | public: 21 | IMMailCtrl(const QString & id, QObject *parent = 0); 22 | ~IMMailCtrl(); 23 | 24 | signals: 25 | void getInMailsSuccess(const QVector &); 26 | void getOutMailsSuccess(const QVector &); 27 | void deleteMailSuccess(const int &); 28 | void getOutMail(const MailInformation &); 29 | void getInMail(const MailInformation &); 30 | 31 | public slots: 32 | // 请求发送邮件 33 | void requestSendMail(const MailInformation &); 34 | // 请求获取收件箱邮件 35 | void requestGetInMails(); 36 | // 请求获取发件箱邮件 37 | void requestGetOutMails(); 38 | // 请求删除邮件 39 | void requestDeleteMail(const MailInformation & mail); 40 | // 请求修改邮件为已读 41 | void requestSetMailRead(const MailInformation & mail); 42 | 43 | // 读取信息 44 | void readMessage(); 45 | 46 | private: 47 | 48 | private: 49 | QString m_myID; 50 | IMTcpSocket *m_tcpSocket; 51 | quint16 m_blockSize; 52 | 53 | QVector m_inMailsVec; 54 | QVector m_outMailsVec; 55 | MailInformation m_mail; 56 | QString m_peerID; 57 | int m_mailID; 58 | }; 59 | 60 | #endif // IMMAILCTRL_H 61 | -------------------------------------------------------------------------------- /IMClient/control/IMRegisterCtrl.h: -------------------------------------------------------------------------------- 1 | /********************************************* 2 | File Name: IMRegisterCtrl.h 3 | Author: jet.F.R 4 | Date: 2014.3.17 5 | Description: 用于控制注册的类 6 | Changes: 7 | ********************************************/ 8 | 9 | #ifndef IMREGISTERCTRL_H 10 | #define IMREGISTERCTRL_H 11 | 12 | #include 13 | #include "model/IMConstant.h" 14 | 15 | class IMUser; 16 | class IMTcpSocket; 17 | 18 | /************************************************* 19 | Class Name: IMRegisterCtrl 20 | Description: 用于控制注册的类 21 | *************************************************/ 22 | class IMRegisterCtrl : public QObject 23 | { 24 | Q_OBJECT 25 | public: 26 | explicit IMRegisterCtrl(QObject *parent = 0); 27 | 28 | ~IMRegisterCtrl(); 29 | // 注册 30 | void registerAccount(const UserInformation &); 31 | 32 | signals: 33 | void signalResetBtnRegister(bool ); 34 | public slots: 35 | 36 | private slots: 37 | // 请求注册 38 | void requestRegister(); 39 | // 读取信息 40 | void readMessage(); 41 | // 重置按钮 42 | void resetBtnRegister(); 43 | private: 44 | 45 | private: 46 | UserInformation m_user; 47 | quint16 m_blockSize; 48 | IMTcpSocket *m_tcpSocket; 49 | 50 | }; 51 | 52 | #endif // IMREGISTERCTRL_H 53 | -------------------------------------------------------------------------------- /IMClient/control/IMVideoCtrl.h: -------------------------------------------------------------------------------- 1 | #ifndef IMVIDEOCTRL_H 2 | #define IMVIDEOCTRL_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | #define CLEAR(x) memset(&(x), 0, sizeof(x)) 16 | 17 | class IMVideoCtrl : public QObject 18 | { 19 | Q_OBJECT 20 | public: 21 | IMVideoCtrl(const QString & devName = "/dev/video0", QObject *parent = 0); 22 | ~IMVideoCtrl(); 23 | 24 | int openDevice(); 25 | int closeDevice(); 26 | int initDevice(); 27 | int startCapturing(); 28 | int stopCapturing(); 29 | int uninitDevice(); 30 | int getFrame(void **, size_t*); 31 | int ungetFrame(); 32 | 33 | signals: 34 | void displayError(QString); 35 | public slots: 36 | 37 | private: 38 | int initMmap(); 39 | 40 | struct buffer 41 | { 42 | void * m_start; 43 | size_t m_length; 44 | }; 45 | QString m_devName; 46 | int m_fd; 47 | buffer* m_buffers; 48 | 49 | unsigned int m_nBuffers; 50 | int m_index; 51 | }; 52 | 53 | #endif // IMVIDEOCTRL_H 54 | -------------------------------------------------------------------------------- /IMClient/external/CustomCalendar/CustomCalendar.h: -------------------------------------------------------------------------------- 1 | #ifndef CUSTOMCALENDAR_H 2 | #define CUSTOMCALENDAR_H 3 | 4 | #include 5 | #include 6 | 7 | /************************************************* 8 | Class Name: CustomCalendar 9 | Description: a custom calendar 10 | *************************************************/ 11 | class CustomCalendar : public QCalendarWidget 12 | { 13 | Q_OBJECT 14 | public: 15 | explicit CustomCalendar(QWidget *parent = 0); 16 | 17 | ~CustomCalendar(); 18 | 19 | //paint the cell by the given date, using the given painter and rect 20 | void paintCell (QPainter * painter, 21 | const QRect & rect, 22 | const QDate & date) const; 23 | 24 | //set whether the table grid is displayed or not 25 | void setCurrentDateRedBorderVisible(bool show); 26 | 27 | //set the selected date's foreground and background color 28 | void setSelectedColor(QColor foregroundColor, QColor backgroundColor); 29 | 30 | //set the QTextCharFormat of current date 31 | void setCurrentDateFormat(const QTextCharFormat &); 32 | 33 | //set the QTextCharFormat of selected date 34 | void setSelectedDateFormat(const QTextCharFormat &); 35 | 36 | //set the QTextCharFormat of valid date 37 | void setValidDateFormat(const QTextCharFormat &); 38 | 39 | //set the QTextCharFormat of invalid date 40 | void setInvalidDateFormat(const QTextCharFormat &); 41 | 42 | //insert data to hasVideoDateList 43 | void insertHasVideoDataList(const QDate &date); 44 | 45 | //set m_selectedMonth 46 | void setSelectedMonth(int month); 47 | 48 | bool m_isShowCalendar; //whether the calendar is show or not 49 | 50 | protected: 51 | void keyPressEvent(QKeyEvent *); //receive key press events for the widget 52 | 53 | private: 54 | bool m_currentDateRedBorderVisible; // whether the table grid is displayed or not 55 | 56 | QTextCharFormat m_currentDateFormat; // QTextCharFormat of current date 57 | QTextCharFormat m_selectedDateFormat; // QTextCharFormat of selected date 58 | QTextCharFormat m_validDateFormat; // QTextCharFormat of valid date 59 | QTextCharFormat m_invalidDateFormat; // QTextCharFormat of invalid date 60 | 61 | int m_selectedMonth; // month of previous selected date 62 | int m_selectedDay; // day of previous selected date 63 | 64 | QList *m_hasVideoDateList; // list contains dates which have video 65 | QPixmap *m_videoPixmap; // pixmap of vidoe,be used to mark date 66 | 67 | //draw red border 68 | void drawRedBorder(QPainter *painter, const QRect & rect) const; 69 | 70 | void linkSignalWithSlot(); //link the signals with slots 71 | 72 | signals: 73 | 74 | public slots: 75 | 76 | void setCurrentSelecetdDate(int year, int month); // set selected date 77 | }; 78 | 79 | #endif // CUSTOMCALENDAR_H 80 | -------------------------------------------------------------------------------- /IMClient/external/CustomCalendar/CustomCalendar.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2014-03-21T11:09:14 4 | # 5 | #------------------------------------------------- 6 | QT -= gui 7 | 8 | TARGET = CustomCalendar 9 | TEMPLATE = lib 10 | 11 | DEFINES += CUSTOMCALENDAR_LIBRARY 12 | 13 | SOURCES += CustomCalendar.cpp\ 14 | CalendarDialog.cpp\ 15 | CustomComboBox.cpp\ 16 | CustomLineEdit.cpp 17 | 18 | HEADERS += CustomCalendar.h\ 19 | CalendarDialog.h\ 20 | CustomComboBox.h\ 21 | CustomLineEdit.h 22 | 23 | -------------------------------------------------------------------------------- /IMClient/external/CustomCalendar/CustomComboBox.h: -------------------------------------------------------------------------------- 1 | #ifndef CUSTOMCOMBOBOX_H 2 | #define CUSTOMCOMBOBOX_H 3 | 4 | #include 5 | #include 6 | 7 | 8 | /************************************************* 9 | Class Name: MonthLineEdit 10 | Description: a custom QLineEdit 11 | *************************************************/ 12 | class MonthLineEdit : public QLineEdit 13 | { 14 | Q_OBJECT 15 | public: 16 | MonthLineEdit(QWidget *parent = 0); 17 | 18 | protected: 19 | //receive mouse press events for the widget 20 | void mousePressEvent(QMouseEvent* event); 21 | 22 | signals: 23 | void mousePress(bool press); 24 | 25 | }; 26 | 27 | /************************************************* 28 | Class Name: CustomComboBox 29 | Description: a custom QComboBox 30 | *************************************************/ 31 | class CustomComboBox : public QComboBox 32 | { 33 | Q_OBJECT 34 | public: 35 | CustomComboBox(QWidget *parent = 0); 36 | ~CustomComboBox(); 37 | 38 | protected: 39 | 40 | //receive key press events for the widget 41 | void keyPressEvent(QKeyEvent * event); 42 | 43 | //receive focus events (focus received) for the widget 44 | void focusInEvent(QFocusEvent * event); 45 | 46 | //receive focus events (focus lost) for the widget 47 | void focusOutEvent(QFocusEvent * event); 48 | 49 | //receive mouse press events for the widget 50 | void mousePressEvent(QMouseEvent* event); 51 | 52 | //receive widget move events 53 | void mouseReleaseEvent(QMouseEvent* event); 54 | 55 | //hide the list of items in the combobox 56 | void hidePopup(); 57 | 58 | private: 59 | bool m_isMousePress; 60 | 61 | public slots: 62 | void setIsMousePress(bool press); 63 | }; 64 | 65 | #endif // CUSTOMCOMBOBOX_H 66 | -------------------------------------------------------------------------------- /IMClient/external/CustomCalendar/include/CustomCalendar.h: -------------------------------------------------------------------------------- 1 | #ifndef CUSTOMCALENDAR_H 2 | #define CUSTOMCALENDAR_H 3 | 4 | #include 5 | #include 6 | 7 | /************************************************* 8 | Class Name: CustomCalendar 9 | Description: a custom calendar 10 | *************************************************/ 11 | class CustomCalendar : public QCalendarWidget 12 | { 13 | Q_OBJECT 14 | public: 15 | explicit CustomCalendar(QWidget *parent = 0); 16 | 17 | ~CustomCalendar(); 18 | 19 | //paint the cell by the given date, using the given painter and rect 20 | void paintCell (QPainter * painter, 21 | const QRect & rect, 22 | const QDate & date) const; 23 | 24 | //set whether the table grid is displayed or not 25 | void setCurrentDateRedBorderVisible(bool show); 26 | 27 | //set the selected date's foreground and background color 28 | void setSelectedColor(QColor foregroundColor, QColor backgroundColor); 29 | 30 | //set the QTextCharFormat of current date 31 | void setCurrentDateFormat(const QTextCharFormat &); 32 | 33 | //set the QTextCharFormat of selected date 34 | void setSelectedDateFormat(const QTextCharFormat &); 35 | 36 | //set the QTextCharFormat of valid date 37 | void setValidDateFormat(const QTextCharFormat &); 38 | 39 | //set the QTextCharFormat of invalid date 40 | void setInvalidDateFormat(const QTextCharFormat &); 41 | 42 | //insert data to hasVideoDateList 43 | void insertHasVideoDataList(const QDate &date); 44 | 45 | //set m_selectedMonth 46 | void setSelectedMonth(int month); 47 | 48 | bool m_isShowCalendar; //whether the calendar is show or not 49 | 50 | protected: 51 | void keyPressEvent(QKeyEvent *); //receive key press events for the widget 52 | 53 | private: 54 | bool m_currentDateRedBorderVisible; // whether the table grid is displayed or not 55 | 56 | QTextCharFormat m_currentDateFormat; // QTextCharFormat of current date 57 | QTextCharFormat m_selectedDateFormat; // QTextCharFormat of selected date 58 | QTextCharFormat m_validDateFormat; // QTextCharFormat of valid date 59 | QTextCharFormat m_invalidDateFormat; // QTextCharFormat of invalid date 60 | 61 | int m_selectedMonth; // month of previous selected date 62 | int m_selectedDay; // day of previous selected date 63 | 64 | QList *m_hasVideoDateList; // list contains dates which have video 65 | QPixmap *m_videoPixmap; // pixmap of vidoe,be used to mark date 66 | 67 | //draw red border 68 | void drawRedBorder(QPainter *painter, const QRect & rect) const; 69 | 70 | void linkSignalWithSlot(); //link the signals with slots 71 | 72 | signals: 73 | 74 | public slots: 75 | 76 | void setCurrentSelecetdDate(int year, int month); // set selected date 77 | }; 78 | 79 | #endif // CUSTOMCALENDAR_H 80 | -------------------------------------------------------------------------------- /IMClient/external/CustomCalendar/include/CustomComboBox.h: -------------------------------------------------------------------------------- 1 | #ifndef CUSTOMCOMBOBOX_H 2 | #define CUSTOMCOMBOBOX_H 3 | 4 | #include 5 | #include 6 | 7 | 8 | /************************************************* 9 | Class Name: MonthLineEdit 10 | Description: a custom QLineEdit 11 | *************************************************/ 12 | class MonthLineEdit : public QLineEdit 13 | { 14 | Q_OBJECT 15 | public: 16 | MonthLineEdit(QWidget *parent = 0); 17 | 18 | protected: 19 | //receive mouse press events for the widget 20 | void mousePressEvent(QMouseEvent* event); 21 | 22 | signals: 23 | void mousePress(bool press); 24 | 25 | }; 26 | 27 | /************************************************* 28 | Class Name: CustomComboBox 29 | Description: a custom QComboBox 30 | *************************************************/ 31 | class CustomComboBox : public QComboBox 32 | { 33 | Q_OBJECT 34 | public: 35 | CustomComboBox(QWidget *parent = 0); 36 | ~CustomComboBox(); 37 | 38 | protected: 39 | 40 | //receive key press events for the widget 41 | void keyPressEvent(QKeyEvent * event); 42 | 43 | //receive focus events (focus received) for the widget 44 | void focusInEvent(QFocusEvent * event); 45 | 46 | //receive focus events (focus lost) for the widget 47 | void focusOutEvent(QFocusEvent * event); 48 | 49 | //receive mouse press events for the widget 50 | void mousePressEvent(QMouseEvent* event); 51 | 52 | //receive widget move events 53 | void mouseReleaseEvent(QMouseEvent* event); 54 | 55 | //hide the list of items in the combobox 56 | void hidePopup(); 57 | 58 | private: 59 | bool m_isMousePress; 60 | 61 | public slots: 62 | void setIsMousePress(bool press); 63 | }; 64 | 65 | #endif // CUSTOMCOMBOBOX_H 66 | -------------------------------------------------------------------------------- /IMClient/external/CustomCalendar/lib/libCustomCalendar.so: -------------------------------------------------------------------------------- 1 | IntxLNKlibCustomCalendar.so.1.0.0 -------------------------------------------------------------------------------- /IMClient/external/CustomCalendar/lib/libCustomCalendar.so.1: -------------------------------------------------------------------------------- 1 | IntxLNKlibCustomCalendar.so.1.0.0 -------------------------------------------------------------------------------- /IMClient/external/CustomCalendar/lib/libCustomCalendar.so.1.0: -------------------------------------------------------------------------------- 1 | IntxLNKlibCustomCalendar.so.1.0.0 -------------------------------------------------------------------------------- /IMClient/external/CustomCalendar/lib/libCustomCalendar.so.1.0.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/external/CustomCalendar/lib/libCustomCalendar.so.1.0.0 -------------------------------------------------------------------------------- /IMClient/external/CustomCalendar/moc_CustomCalendar.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Meta object code from reading C++ file 'CustomCalendar.h' 3 | ** 4 | ** Created: Mon Apr 14 22:34:24 2014 5 | ** by: The Qt Meta Object Compiler version 63 (Qt 4.8.1) 6 | ** 7 | ** WARNING! All changes made in this file will be lost! 8 | *****************************************************************************/ 9 | 10 | #include "CustomCalendar.h" 11 | #if !defined(Q_MOC_OUTPUT_REVISION) 12 | #error "The header file 'CustomCalendar.h' doesn't include ." 13 | #elif Q_MOC_OUTPUT_REVISION != 63 14 | #error "This file was generated using the moc from 4.8.1. It" 15 | #error "cannot be used with the include files from this version of Qt." 16 | #error "(The moc has changed too much.)" 17 | #endif 18 | 19 | QT_BEGIN_MOC_NAMESPACE 20 | static const uint qt_meta_data_CustomCalendar[] = { 21 | 22 | // content: 23 | 6, // revision 24 | 0, // classname 25 | 0, 0, // classinfo 26 | 1, 14, // methods 27 | 0, 0, // properties 28 | 0, 0, // enums/sets 29 | 0, 0, // constructors 30 | 0, // flags 31 | 0, // signalCount 32 | 33 | // slots: signature, parameters, type, tag, flags 34 | 27, 16, 15, 15, 0x0a, 35 | 36 | 0 // eod 37 | }; 38 | 39 | static const char qt_meta_stringdata_CustomCalendar[] = { 40 | "CustomCalendar\0\0year,month\0" 41 | "setCurrentSelecetdDate(int,int)\0" 42 | }; 43 | 44 | void CustomCalendar::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) 45 | { 46 | if (_c == QMetaObject::InvokeMetaMethod) { 47 | Q_ASSERT(staticMetaObject.cast(_o)); 48 | CustomCalendar *_t = static_cast(_o); 49 | switch (_id) { 50 | case 0: _t->setCurrentSelecetdDate((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break; 51 | default: ; 52 | } 53 | } 54 | } 55 | 56 | const QMetaObjectExtraData CustomCalendar::staticMetaObjectExtraData = { 57 | 0, qt_static_metacall 58 | }; 59 | 60 | const QMetaObject CustomCalendar::staticMetaObject = { 61 | { &QCalendarWidget::staticMetaObject, qt_meta_stringdata_CustomCalendar, 62 | qt_meta_data_CustomCalendar, &staticMetaObjectExtraData } 63 | }; 64 | 65 | #ifdef Q_NO_DATA_RELOCATION 66 | const QMetaObject &CustomCalendar::getStaticMetaObject() { return staticMetaObject; } 67 | #endif //Q_NO_DATA_RELOCATION 68 | 69 | const QMetaObject *CustomCalendar::metaObject() const 70 | { 71 | return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; 72 | } 73 | 74 | void *CustomCalendar::qt_metacast(const char *_clname) 75 | { 76 | if (!_clname) return 0; 77 | if (!strcmp(_clname, qt_meta_stringdata_CustomCalendar)) 78 | return static_cast(const_cast< CustomCalendar*>(this)); 79 | return QCalendarWidget::qt_metacast(_clname); 80 | } 81 | 82 | int CustomCalendar::qt_metacall(QMetaObject::Call _c, int _id, void **_a) 83 | { 84 | _id = QCalendarWidget::qt_metacall(_c, _id, _a); 85 | if (_id < 0) 86 | return _id; 87 | if (_c == QMetaObject::InvokeMetaMethod) { 88 | if (_id < 1) 89 | qt_static_metacall(this, _c, _id, _a); 90 | _id -= 1; 91 | } 92 | return _id; 93 | } 94 | QT_END_MOC_NAMESPACE 95 | -------------------------------------------------------------------------------- /IMClient/external/CustomCalendar/moc_CustomLineEdit.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Meta object code from reading C++ file 'CustomLineEdit.h' 3 | ** 4 | ** Created: Mon Apr 14 22:34:28 2014 5 | ** by: The Qt Meta Object Compiler version 63 (Qt 4.8.1) 6 | ** 7 | ** WARNING! All changes made in this file will be lost! 8 | *****************************************************************************/ 9 | 10 | #include "CustomLineEdit.h" 11 | #if !defined(Q_MOC_OUTPUT_REVISION) 12 | #error "The header file 'CustomLineEdit.h' doesn't include ." 13 | #elif Q_MOC_OUTPUT_REVISION != 63 14 | #error "This file was generated using the moc from 4.8.1. It" 15 | #error "cannot be used with the include files from this version of Qt." 16 | #error "(The moc has changed too much.)" 17 | #endif 18 | 19 | QT_BEGIN_MOC_NAMESPACE 20 | static const uint qt_meta_data_CustomLineEdit[] = { 21 | 22 | // content: 23 | 6, // revision 24 | 0, // classname 25 | 0, 0, // classinfo 26 | 1, 14, // methods 27 | 0, 0, // properties 28 | 0, 0, // enums/sets 29 | 0, 0, // constructors 30 | 0, // flags 31 | 0, // signalCount 32 | 33 | // slots: signature, parameters, type, tag, flags 34 | 16, 15, 15, 15, 0x0a, 35 | 36 | 0 // eod 37 | }; 38 | 39 | static const char qt_meta_stringdata_CustomLineEdit[] = { 40 | "CustomLineEdit\0\0moveCalendarPos()\0" 41 | }; 42 | 43 | void CustomLineEdit::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) 44 | { 45 | if (_c == QMetaObject::InvokeMetaMethod) { 46 | Q_ASSERT(staticMetaObject.cast(_o)); 47 | CustomLineEdit *_t = static_cast(_o); 48 | switch (_id) { 49 | case 0: _t->moveCalendarPos(); break; 50 | default: ; 51 | } 52 | } 53 | Q_UNUSED(_a); 54 | } 55 | 56 | const QMetaObjectExtraData CustomLineEdit::staticMetaObjectExtraData = { 57 | 0, qt_static_metacall 58 | }; 59 | 60 | const QMetaObject CustomLineEdit::staticMetaObject = { 61 | { &QLineEdit::staticMetaObject, qt_meta_stringdata_CustomLineEdit, 62 | qt_meta_data_CustomLineEdit, &staticMetaObjectExtraData } 63 | }; 64 | 65 | #ifdef Q_NO_DATA_RELOCATION 66 | const QMetaObject &CustomLineEdit::getStaticMetaObject() { return staticMetaObject; } 67 | #endif //Q_NO_DATA_RELOCATION 68 | 69 | const QMetaObject *CustomLineEdit::metaObject() const 70 | { 71 | return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; 72 | } 73 | 74 | void *CustomLineEdit::qt_metacast(const char *_clname) 75 | { 76 | if (!_clname) return 0; 77 | if (!strcmp(_clname, qt_meta_stringdata_CustomLineEdit)) 78 | return static_cast(const_cast< CustomLineEdit*>(this)); 79 | return QLineEdit::qt_metacast(_clname); 80 | } 81 | 82 | int CustomLineEdit::qt_metacall(QMetaObject::Call _c, int _id, void **_a) 83 | { 84 | _id = QLineEdit::qt_metacall(_c, _id, _a); 85 | if (_id < 0) 86 | return _id; 87 | if (_c == QMetaObject::InvokeMetaMethod) { 88 | if (_id < 1) 89 | qt_static_metacall(this, _c, _id, _a); 90 | _id -= 1; 91 | } 92 | return _id; 93 | } 94 | QT_END_MOC_NAMESPACE 95 | -------------------------------------------------------------------------------- /IMClient/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "view/IMLoginWidget.h" 3 | #include 4 | #include 5 | 6 | #include "view/IMInformationWidget.h" 7 | 8 | int main(int argc, char *argv[]) 9 | { 10 | QApplication a(argc, argv); 11 | 12 | // 以下部分解决中文乱码 13 | QTextCodec::setCodecForTr(QTextCodec::codecForName("utf-8")); 14 | QTextCodec::setCodecForLocale(QTextCodec::codecForName("utf-8")); 15 | QTextCodec::setCodecForCStrings(QTextCodec::codecForName("utf-8")); 16 | // 以上部分解决中文乱码 17 | 18 | IMLoginWidget w; 19 | w.show(); 20 | if (true == w.getIsAutoLogin()) 21 | { 22 | qDebug() << "click"; 23 | w.onClickBtnLogin(); 24 | } 25 | 26 | // IMInformationWidget w; 27 | // w.setReadOnly(true, true); 28 | // w.show(); 29 | 30 | return a.exec(); 31 | } 32 | 33 | //192.168.50.133 34 | -------------------------------------------------------------------------------- /IMClient/model/IMEncryption.cpp: -------------------------------------------------------------------------------- 1 | #include "IMEncryption.h" 2 | 3 | QMutex IMEncryption::s_mutex;//实例互斥锁。 4 | QAtomicPointer IMEncryption::s_instance = 0; //使用原子指针,默认初始化为0 5 | 6 | IMEncryption& IMEncryption::getInstace(void) 7 | { 8 | #ifndef Q_ATOMIC_POINTER_TEST_AND_SET_IS_ALWAYS_NATIVE 9 | // 运行时检测 10 | if (!QAtomicPointer::isTestAndSetNative()) 11 | { 12 | qDebug() << "Error: TestAndSetNative not supported!"; 13 | } 14 | #endif 15 | 16 | //使用双重检测。 17 | //testAndSetOrders操作保证在原子操作前和后的的内存访问不会被重新排序。 18 | 19 | if (s_instance.testAndSetOrdered(0, 0))//第一次检测 20 | { 21 | QMutexLocker locker(&s_mutex);//加互斥锁。 22 | s_instance.testAndSetOrdered(0, new IMEncryption);//第二次检测。 23 | } 24 | return *s_instance; 25 | } 26 | 27 | QString IMEncryption::getXorEncryptDecrypt(const QString &str, const char &key) 28 | { 29 | QString result; 30 | QByteArray bs = qstringToByte(str); 31 | 32 | for(int i=0; i 0) 46 | { 47 | QTextCodec *codec = QTextCodec::codecForName("utf-8"); 48 | result = codec->toUnicode(byte); 49 | } 50 | 51 | return result; 52 | } 53 | 54 | QByteArray IMEncryption::qstringToByte(const QString &strInfo) 55 | { 56 | QByteArray result; 57 | if (strInfo.length() > 0) 58 | { 59 | QTextCodec *codec = QTextCodec::codecForName("utf-8"); 60 | result = codec->fromUnicode(strInfo); 61 | } 62 | return result; 63 | } 64 | -------------------------------------------------------------------------------- /IMClient/model/IMEncryption.h: -------------------------------------------------------------------------------- 1 | /********************************************* 2 | File Name: IMEncryption.h 3 | Author: jet.F.R 4 | Date: 2014.3.17 5 | Description: 加密解密 6 | Changes: 7 | ********************************************/ 8 | 9 | #ifndef IMENCRYPTION_H 10 | #define IMENCRYPTION_H 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | class IMEncryption 20 | { 21 | public: 22 | // 用户获取实例,返回实例的引用 23 | static IMEncryption& getInstace(void); 24 | 25 | // 使用异或运算加密 26 | QString getXorEncryptDecrypt(const QString &, const char &); 27 | // QByteArray 转 QString 28 | QString byteToQString(const QByteArray &byte); 29 | // QString 转 QByteArray 30 | QByteArray qstringToByte(const QString &strInfo); 31 | 32 | private: 33 | IMEncryption(){}//禁止构造函数。 34 | IMEncryption(const IMEncryption &);//禁止拷贝构造函数。 35 | IMEncryption & operator =(const IMEncryption &);//禁止赋值拷贝函数。 36 | 37 | QReadWriteLock m_internalMutex;//函数使用的读写锁。 38 | static QMutex s_mutex;//实例互斥锁。 39 | static QAtomicPointer s_instance; //使用原子指针,默认初始化为0 40 | }; 41 | 42 | #endif // IMENCRYPTION_H 43 | -------------------------------------------------------------------------------- /IMClient/model/IMTcpSocket.h: -------------------------------------------------------------------------------- 1 | /********************************************* 2 | File Name: IMTcpSocket.h 3 | Author: jet.F.R 4 | Date: 2014.3.10 5 | Description: 客户端tcpsocket类 6 | Changes: 7 | ********************************************/ 8 | 9 | #ifndef IMTCPSOCKET_H 10 | #define IMTCPSOCKET_H 11 | 12 | #include 13 | #include "IMConstant.h" 14 | 15 | /************************************************* 16 | Class Name: IMTcpSocket 17 | Description: 客户端tcpsocket类 18 | *************************************************/ 19 | class IMTcpSocket : public QTcpSocket 20 | { 21 | Q_OBJECT 22 | public: 23 | IMTcpSocket(QObject *parent = 0); 24 | // 请求连接 25 | void requestConnect(); 26 | // 是否连接 27 | bool isConnected(); 28 | 29 | void setFlag(int); 30 | int flag(); 31 | 32 | // 获取ip 33 | static QString getIP(); 34 | //获取当前的日期和时间 35 | static QString getCurrentDateTime(); 36 | 37 | static QHostAddress s_hostAddress; 38 | static int s_hostPort; 39 | 40 | signals: 41 | void showConnectionStatus(const QString &, bool isLogin = false); 42 | 43 | private slots: 44 | // 连接被客户端关闭 45 | void connectionClosed(); 46 | // 连接创建 47 | void connectionCreate(); 48 | // 显示错误 49 | void dispalyError(QAbstractSocket::SocketError); 50 | 51 | private: 52 | // 链接信号与槽 53 | void linkSignalWithSlot(); 54 | 55 | 56 | bool m_isConnected; 57 | 58 | int m_flag; 59 | 60 | }; 61 | 62 | #endif // IMTCPSOCKET_H 63 | -------------------------------------------------------------------------------- /IMClient/model/IMUser.cpp: -------------------------------------------------------------------------------- 1 | /********************************************* 2 | File Name: IMUser.cpp 3 | Author: jet.F.R 4 | Date: 2014.3.17 5 | Description: 用户类 6 | Changes: 7 | ********************************************/ 8 | 9 | #include "IMUser.h" 10 | 11 | 12 | 13 | // mark: public------------------------------------------------------ 14 | IMUser::IMUser(QObject *parent) : 15 | QObject(parent) 16 | { 17 | } 18 | 19 | IMUser::IMUser(QString id, const QString &nick, const QString &pwd, const QString &sex, 20 | const QDate birth, const QString &name, const QString &addr, 21 | const QString &phone, const QString &ques, const QString &ans, 22 | const QDateTime regDate, const int status) 23 | { 24 | m_userID = id; 25 | m_nickname = nick; 26 | m_password = pwd; 27 | m_sex = sex; 28 | m_birthday = birth; 29 | m_question = ques; 30 | m_answer = ans; 31 | m_name = name; 32 | m_phone = phone; 33 | m_address = addr; 34 | m_regDateTime = regDate; 35 | m_status = status; 36 | } 37 | 38 | 39 | /************************************************* 40 | Function Name: getXX() 41 | Description: 获取用户信息 42 | Input: NULL 43 | Output:**(QString / int / QDateTime) 44 | Changes: NULL 45 | *************************************************/ 46 | 47 | /********************* bgein getXX()****************************/ 48 | QString IMUser::getUserID() const { return m_userID; } 49 | 50 | QString IMUser::getNickname() const { return m_nickname; } 51 | 52 | QString IMUser::getPassword() const { return m_password; } 53 | 54 | QString IMUser::getSex() const { return m_sex; } 55 | 56 | QDate IMUser::getBirthday() const { return m_birthday;} 57 | 58 | QString IMUser::getQuestion() const { return m_question; } 59 | 60 | QString IMUser::getAnswer() const { return m_answer; } 61 | 62 | QString IMUser::getName() const { return m_name; } 63 | 64 | QString IMUser::getPhone() const { return m_phone; } 65 | 66 | QString IMUser::getAddress() const { return m_address; } 67 | 68 | QDateTime IMUser::getRegDateTime() const { return m_regDateTime; } 69 | 70 | int IMUser::getStatus() const {return m_status; } 71 | 72 | /********************* end getXX()******************************/ 73 | 74 | /********************* bgein setXX()****************************/ 75 | void IMUser::setUserID(const QString &id) { m_userID = id; } 76 | void IMUser::setNickname(const QString &nick) { m_nickname = nick; } 77 | void IMUser::setPassword(const QString &pwd) { m_password = pwd; } 78 | void IMUser::setSex(const QString &sex) { m_sex = sex; } 79 | void IMUser::setBirthday(const QDate &birth) { m_birthday = birth; } 80 | void IMUser::setQusetion(const QString &ques) { m_question = ques; } 81 | void IMUser::setAnswer(const QString &ans) { m_answer = ans; } 82 | void IMUser::setName(const QString &name) { m_name = name; } 83 | void IMUser::setPhone(const QString &phone) { m_phone = phone; } 84 | void IMUser::setAddress(const QString & add) { m_address = add; } 85 | void IMUser::setRegDateTime(const QDateTime &date) { m_regDateTime = date; } 86 | void IMUser::setStatus(const int status) { m_status = status; } 87 | /********************* end setXX()******************************/ 88 | 89 | 90 | QDataStream &operator<<(QDataStream &out, const IMUser &user) 91 | { 92 | out << user.m_userID << user.m_nickname << user.m_password 93 | << user.m_sex << user.m_birthday << user.m_question 94 | << user.m_answer << user.m_name << user.m_phone 95 | << user.m_address << user.m_regDateTime << user.m_status; 96 | return out; 97 | } 98 | 99 | QDataStream &operator>>(QDataStream &in, IMUser &user) 100 | { 101 | in >> user.m_userID >> user.m_nickname >> user.m_password 102 | >> user.m_sex >> user.m_birthday >> user.m_question 103 | >> user.m_answer >> user.m_name >> user.m_phone 104 | >> user.m_address >> user.m_regDateTime >> user.m_status; 105 | return in; 106 | } 107 | -------------------------------------------------------------------------------- /IMClient/model/IMUser.h: -------------------------------------------------------------------------------- 1 | /********************************************* 2 | File Name: IMUser.h 3 | Author: jet.F.R 4 | Date: 2014.3.17 5 | Description: 用户类 6 | Changes: 7 | ********************************************/ 8 | #ifndef IMUSER_H 9 | #define IMUSER_H 10 | 11 | #include 12 | #include 13 | #include "model/IMConstant.h" 14 | 15 | class IMUser : public QObject 16 | { 17 | Q_OBJECT 18 | public: 19 | IMUser(QObject *parent = 0); 20 | IMUser(QString id, const QString &nick, const QString &pwd = "", 21 | const QString &sex = "", 22 | const QDate birth = QDate::currentDate(), 23 | const QString &name ="", const QString &addr = "", 24 | const QString &phone = "",const QString &ques = "", 25 | const QString &ans = "", 26 | const QDateTime regDate = QDateTime::currentDateTime(), 27 | const int status = ONLINE); 28 | 29 | QString getUserID() const; 30 | QString getNickname() const; 31 | QString getPassword() const; 32 | QString getSex() const; 33 | QDate getBirthday() const; 34 | QString getQuestion() const; 35 | QString getAnswer() const; 36 | QString getName() const; 37 | QString getPhone() const; 38 | QString getAddress() const; 39 | QDateTime getRegDateTime() const; 40 | int getStatus() const; 41 | 42 | void setUserID(const QString &); 43 | void setNickname(const QString &); 44 | void setPassword(const QString &); 45 | void setSex(const QString &); 46 | void setBirthday(const QDate &); 47 | void setQusetion(const QString &); 48 | void setAnswer(const QString &); 49 | void setName(const QString &); 50 | void setPhone(const QString &); 51 | void setAddress(const QString &); 52 | void setRegDateTime(const QDateTime &); 53 | void setStatus(const int status); 54 | 55 | signals: 56 | 57 | public slots: 58 | 59 | private: 60 | QString m_userID; 61 | QString m_nickname; 62 | QString m_password; 63 | QString m_sex; 64 | QDate m_birthday; 65 | QString m_question; 66 | QString m_answer; 67 | QString m_name; 68 | QString m_phone; 69 | QString m_address; 70 | QDateTime m_regDateTime; 71 | int m_status; 72 | 73 | friend QDataStream &operator<<(QDataStream &out, const IMUser &user); 74 | 75 | friend QDataStream &operator>>(QDataStream &in, IMUser &user); 76 | }; 77 | 78 | 79 | 80 | 81 | #endif // IMUSER_H 82 | -------------------------------------------------------------------------------- /IMClient/resource/config/auto_login.im: -------------------------------------------------------------------------------- 1 | 2014050704 123456 -------------------------------------------------------------------------------- /IMClient/resource/image/add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/add.png -------------------------------------------------------------------------------- /IMClient/resource/image/addDiscussion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/addDiscussion.png -------------------------------------------------------------------------------- /IMClient/resource/image/addFlock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/addFlock.png -------------------------------------------------------------------------------- /IMClient/resource/image/addFriend.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/addFriend.png -------------------------------------------------------------------------------- /IMClient/resource/image/add_file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/add_file.png -------------------------------------------------------------------------------- /IMClient/resource/image/add_folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/add_folder.png -------------------------------------------------------------------------------- /IMClient/resource/image/attach.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/attach.png -------------------------------------------------------------------------------- /IMClient/resource/image/camera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/camera.png -------------------------------------------------------------------------------- /IMClient/resource/image/cancel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/cancel.png -------------------------------------------------------------------------------- /IMClient/resource/image/clear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/clear.png -------------------------------------------------------------------------------- /IMClient/resource/image/color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/color.png -------------------------------------------------------------------------------- /IMClient/resource/image/colour.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/colour.png -------------------------------------------------------------------------------- /IMClient/resource/image/config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/config.png -------------------------------------------------------------------------------- /IMClient/resource/image/deleteAll.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/deleteAll.png -------------------------------------------------------------------------------- /IMClient/resource/image/deleteDate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/deleteDate.png -------------------------------------------------------------------------------- /IMClient/resource/image/deleteOne.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/deleteOne.png -------------------------------------------------------------------------------- /IMClient/resource/image/delete_file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/delete_file.png -------------------------------------------------------------------------------- /IMClient/resource/image/delete_folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/delete_folder.png -------------------------------------------------------------------------------- /IMClient/resource/image/discussion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/discussion.png -------------------------------------------------------------------------------- /IMClient/resource/image/download_file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/download_file.png -------------------------------------------------------------------------------- /IMClient/resource/image/download_folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/download_folder.png -------------------------------------------------------------------------------- /IMClient/resource/image/download_message.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/download_message.png -------------------------------------------------------------------------------- /IMClient/resource/image/edit_file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/edit_file.png -------------------------------------------------------------------------------- /IMClient/resource/image/export.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/export.png -------------------------------------------------------------------------------- /IMClient/resource/image/exportAll.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/exportAll.png -------------------------------------------------------------------------------- /IMClient/resource/image/exportOne.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/exportOne.png -------------------------------------------------------------------------------- /IMClient/resource/image/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/file.png -------------------------------------------------------------------------------- /IMClient/resource/image/flock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/flock.png -------------------------------------------------------------------------------- /IMClient/resource/image/folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/folder.png -------------------------------------------------------------------------------- /IMClient/resource/image/font.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/font.png -------------------------------------------------------------------------------- /IMClient/resource/image/font_bold.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/font_bold.png -------------------------------------------------------------------------------- /IMClient/resource/image/font_italic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/font_italic.png -------------------------------------------------------------------------------- /IMClient/resource/image/font_underline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/font_underline.png -------------------------------------------------------------------------------- /IMClient/resource/image/head/1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/1.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/10.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/10.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/100.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/100.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/101.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/101.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/102.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/102.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/103.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/103.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/104.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/104.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/105.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/105.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/106.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/106.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/107.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/107.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/108.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/108.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/109.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/109.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/11.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/11.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/110.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/110.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/111.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/111.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/112.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/112.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/113.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/113.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/114.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/114.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/115.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/115.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/116.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/116.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/117.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/117.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/118.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/118.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/119.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/119.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/12.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/12.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/120.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/120.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/121.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/121.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/122.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/122.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/123.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/123.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/124.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/124.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/125.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/125.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/126.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/126.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/127.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/127.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/128.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/128.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/129.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/129.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/13.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/13.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/130.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/130.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/131.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/131.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/132.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/132.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/133.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/133.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/14.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/14.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/15.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/15.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/16.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/16.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/17.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/17.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/18.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/18.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/19.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/19.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/2.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/20.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/20.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/21.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/21.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/22.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/22.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/23.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/23.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/24.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/24.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/25.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/25.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/26.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/26.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/27.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/27.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/28.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/28.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/29.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/29.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/3.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/3.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/30.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/30.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/31.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/31.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/32.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/32.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/33.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/33.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/34.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/34.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/35.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/35.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/36.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/36.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/37.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/37.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/38.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/38.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/39.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/39.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/4.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/4.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/40.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/40.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/41.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/41.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/42.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/42.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/43.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/43.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/44.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/44.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/45.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/45.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/46.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/46.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/47.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/47.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/48.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/48.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/49.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/49.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/5.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/5.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/50.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/50.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/51.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/51.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/52.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/52.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/53.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/53.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/54.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/54.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/55.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/55.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/56.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/56.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/57.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/57.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/58.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/58.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/59.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/59.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/6.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/6.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/60.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/60.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/61.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/61.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/62.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/62.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/63.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/63.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/64.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/64.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/65.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/65.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/66.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/66.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/67.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/67.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/68.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/68.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/69.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/69.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/7.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/7.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/70.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/70.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/71.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/71.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/72.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/72.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/73.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/73.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/74.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/74.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/75.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/75.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/76.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/76.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/77.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/77.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/78.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/78.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/79.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/79.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/8.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/8.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/80.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/80.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/81.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/81.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/82.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/82.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/83.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/83.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/84.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/84.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/85.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/85.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/86.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/86.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/87.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/87.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/88.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/88.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/89.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/89.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/9.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/9.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/90.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/90.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/91.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/91.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/92.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/92.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/93.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/93.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/94.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/94.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/95.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/95.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/96.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/96.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/97.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/97.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/98.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/98.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/head/99.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/head/99.bmp -------------------------------------------------------------------------------- /IMClient/resource/image/history.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/history.png -------------------------------------------------------------------------------- /IMClient/resource/image/imgRes.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | messageBox.png 4 | mail.png 5 | space.png 6 | search.png 7 | config.png 8 | searchAdd.png 9 | add.png 10 | addFriend.png 11 | discussion.png 12 | flock.png 13 | microphone.png 14 | camera.png 15 | add_file.png 16 | add_folder.png 17 | attach.png 18 | delete_file.png 19 | delete_folder.png 20 | download_file.png 21 | download_folder.png 22 | edit_file.png 23 | file.png 24 | folder.png 25 | send_file.png 26 | picture.png 27 | plane.png 28 | upload_folder.png 29 | clear.png 30 | color.png 31 | colour.png 32 | history.png 33 | message.png 34 | font.png 35 | font_bold.png 36 | font_underline.png 37 | font_italic.png 38 | addDiscussion.png 39 | addFlock.png 40 | mailRead.png 41 | mailUnRead.png 42 | export.png 43 | deleteAll.png 44 | download_message.png 45 | exportAll.png 46 | importAll.png 47 | import.png 48 | deleteDate.png 49 | deleteOne.png 50 | exportOne.png 51 | newMessage.png 52 | noMessage.png 53 | cancel.png 54 | 55 | 56 | -------------------------------------------------------------------------------- /IMClient/resource/image/import.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/import.png -------------------------------------------------------------------------------- /IMClient/resource/image/importAll.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/importAll.png -------------------------------------------------------------------------------- /IMClient/resource/image/mail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/mail.png -------------------------------------------------------------------------------- /IMClient/resource/image/mailRead.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/mailRead.png -------------------------------------------------------------------------------- /IMClient/resource/image/mailUnRead.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/mailUnRead.png -------------------------------------------------------------------------------- /IMClient/resource/image/message.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/message.png -------------------------------------------------------------------------------- /IMClient/resource/image/messageBox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/messageBox.png -------------------------------------------------------------------------------- /IMClient/resource/image/microphone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/microphone.png -------------------------------------------------------------------------------- /IMClient/resource/image/newMessage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/newMessage.png -------------------------------------------------------------------------------- /IMClient/resource/image/no.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/no.png -------------------------------------------------------------------------------- /IMClient/resource/image/noMessage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/noMessage.png -------------------------------------------------------------------------------- /IMClient/resource/image/picture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/picture.png -------------------------------------------------------------------------------- /IMClient/resource/image/plane.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/plane.png -------------------------------------------------------------------------------- /IMClient/resource/image/replay_calendar_left_arrow_btn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/replay_calendar_left_arrow_btn.png -------------------------------------------------------------------------------- /IMClient/resource/image/replay_calendar_right_arrow_btn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/replay_calendar_right_arrow_btn.png -------------------------------------------------------------------------------- /IMClient/resource/image/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/search.png -------------------------------------------------------------------------------- /IMClient/resource/image/searchAdd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/searchAdd.png -------------------------------------------------------------------------------- /IMClient/resource/image/send_file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/send_file.png -------------------------------------------------------------------------------- /IMClient/resource/image/space.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/space.png -------------------------------------------------------------------------------- /IMClient/resource/image/upload_folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMClient/resource/image/upload_folder.png -------------------------------------------------------------------------------- /IMClient/view/CustomCalendar.h: -------------------------------------------------------------------------------- 1 | #ifndef CUSTOMCALENDAR_H 2 | #define CUSTOMCALENDAR_H 3 | 4 | #include 5 | #include 6 | 7 | /************************************************* 8 | Class Name: CustomCalendar 9 | Description: a custom calendar 10 | *************************************************/ 11 | class CustomCalendar : public QCalendarWidget 12 | { 13 | Q_OBJECT 14 | public: 15 | explicit CustomCalendar(QWidget *parent = 0); 16 | 17 | ~CustomCalendar(); 18 | 19 | //paint the cell by the given date, using the given painter and rect 20 | void paintCell (QPainter * painter, 21 | const QRect & rect, 22 | const QDate & date) const; 23 | 24 | //set whether the table grid is displayed or not 25 | void setCurrentDateRedBorderVisible(bool show); 26 | 27 | //set the selected date's foreground and background color 28 | void setSelectedColor(QColor foregroundColor, QColor backgroundColor); 29 | 30 | //set the QTextCharFormat of current date 31 | void setCurrentDateFormat(const QTextCharFormat &); 32 | 33 | //set the QTextCharFormat of selected date 34 | void setSelectedDateFormat(const QTextCharFormat &); 35 | 36 | //set the QTextCharFormat of valid date 37 | void setValidDateFormat(const QTextCharFormat &); 38 | 39 | //set the QTextCharFormat of invalid date 40 | void setInvalidDateFormat(const QTextCharFormat &); 41 | 42 | //insert data to hasVideoDateList 43 | void insertHasVideoDataList(const QDate &date); 44 | 45 | //set m_selectedMonth 46 | void setSelectedMonth(int month); 47 | 48 | bool m_isShowCalendar; //whether the calendar is show or not 49 | 50 | protected: 51 | void keyPressEvent(QKeyEvent *); //receive key press events for the widget 52 | 53 | private: 54 | bool m_currentDateRedBorderVisible; // whether the table grid is displayed or not 55 | 56 | QTextCharFormat m_currentDateFormat; // QTextCharFormat of current date 57 | QTextCharFormat m_selectedDateFormat; // QTextCharFormat of selected date 58 | QTextCharFormat m_validDateFormat; // QTextCharFormat of valid date 59 | QTextCharFormat m_invalidDateFormat; // QTextCharFormat of invalid date 60 | 61 | int m_selectedMonth; // month of previous selected date 62 | int m_selectedDay; // day of previous selected date 63 | 64 | QList *m_hasVideoDateList; // list contains dates which have video 65 | QPixmap *m_videoPixmap; // pixmap of vidoe,be used to mark date 66 | 67 | //draw red border 68 | void drawRedBorder(QPainter *painter, const QRect & rect) const; 69 | 70 | void linkSignalWithSlot(); //link the signals with slots 71 | 72 | signals: 73 | 74 | public slots: 75 | 76 | void setCurrentSelecetdDate(int year, int month); // set selected date 77 | }; 78 | 79 | #endif // CUSTOMCALENDAR_H 80 | -------------------------------------------------------------------------------- /IMClient/view/CustomComboBox.h: -------------------------------------------------------------------------------- 1 | #ifndef CUSTOMCOMBOBOX_H 2 | #define CUSTOMCOMBOBOX_H 3 | 4 | #include 5 | #include 6 | 7 | 8 | /************************************************* 9 | Class Name: MonthLineEdit 10 | Description: a custom QLineEdit 11 | *************************************************/ 12 | class MonthLineEdit : public QLineEdit 13 | { 14 | Q_OBJECT 15 | public: 16 | MonthLineEdit(QWidget *parent = 0); 17 | 18 | protected: 19 | //receive mouse press events for the widget 20 | void mousePressEvent(QMouseEvent* event); 21 | 22 | signals: 23 | void mousePress(bool press); 24 | 25 | }; 26 | 27 | /************************************************* 28 | Class Name: CustomComboBox 29 | Description: a custom QComboBox 30 | *************************************************/ 31 | class CustomComboBox : public QComboBox 32 | { 33 | Q_OBJECT 34 | public: 35 | CustomComboBox(QWidget *parent = 0); 36 | ~CustomComboBox(); 37 | 38 | protected: 39 | 40 | //receive key press events for the widget 41 | void keyPressEvent(QKeyEvent * event); 42 | 43 | //receive focus events (focus received) for the widget 44 | void focusInEvent(QFocusEvent * event); 45 | 46 | //receive focus events (focus lost) for the widget 47 | void focusOutEvent(QFocusEvent * event); 48 | 49 | //receive mouse press events for the widget 50 | void mousePressEvent(QMouseEvent* event); 51 | 52 | //receive widget move events 53 | void mouseReleaseEvent(QMouseEvent* event); 54 | 55 | //hide the list of items in the combobox 56 | void hidePopup(); 57 | 58 | private: 59 | bool m_isMousePress; 60 | 61 | public slots: 62 | void setIsMousePress(bool press); 63 | }; 64 | 65 | #endif // CUSTOMCOMBOBOX_H 66 | -------------------------------------------------------------------------------- /IMClient/view/IMClickLabel.cpp: -------------------------------------------------------------------------------- 1 | /********************************************* 2 | File Name: IMClickLabel.cpp 3 | Author: jet.F.R 4 | Date: 2014.3.10 5 | Description: 具有单击相应的标签类 6 | Changes: 7 | ********************************************/ 8 | 9 | 10 | #include "IMClickLabel.h" 11 | #include 12 | 13 | // mark: public:-------------------------------------------------- 14 | IMClickLabel::IMClickLabel(QWidget *parent) : 15 | QLabel(parent) 16 | { 17 | QPalette pa; 18 | pa.setColor(QPalette::WindowText, Qt::darkGreen); 19 | setPalette(pa); 20 | } 21 | 22 | IMClickLabel::IMClickLabel(const QString &text, QWidget *parent) : 23 | QLabel(parent) 24 | { 25 | setText(text); 26 | } 27 | 28 | // mark: protected:------------------------------------------------ 29 | void IMClickLabel::mouseReleaseEvent(QMouseEvent *ev) 30 | { 31 | if (ev->button() == Qt::LeftButton) 32 | emit clicked();//(this); 33 | } 34 | 35 | void IMClickLabel::enterEvent(QEvent * ) 36 | { 37 | QPalette pa; 38 | pa.setColor(QPalette::WindowText, Qt::blue); 39 | setPalette(pa); 40 | } 41 | 42 | void IMClickLabel::leaveEvent(QEvent *) 43 | { 44 | QPalette pa; 45 | pa.setColor(QPalette::WindowText, Qt::darkGreen); 46 | setPalette(pa); 47 | } 48 | -------------------------------------------------------------------------------- /IMClient/view/IMClickLabel.h: -------------------------------------------------------------------------------- 1 | /********************************************* 2 | File Name: IMClickLabel.h 3 | Author: jet.F.R 4 | Date: 2014.3.10 5 | Description: 具有单击相应的标签类 6 | Changes: 7 | ********************************************/ 8 | 9 | #ifndef IMCLICKLABEL_H 10 | #define IMCLICKLABEL_H 11 | 12 | #include 13 | 14 | 15 | /************************************************* 16 | Class Name: IMClickLabel 17 | Description: 具有单击相应的标签类 18 | *************************************************/ 19 | class IMClickLabel : public QLabel 20 | { 21 | Q_OBJECT 22 | public: 23 | explicit IMClickLabel(QWidget *parent = 0); 24 | IMClickLabel(const QString &text, QWidget *parent=0); 25 | signals: 26 | // 鼠标单击信号 27 | void clicked();//IMClickLabel* label); 28 | 29 | protected: 30 | // 鼠标单击事件 31 | void mouseReleaseEvent(QMouseEvent *); 32 | void enterEvent(QEvent *); 33 | void leaveEvent(QEvent *); 34 | public slots: 35 | 36 | }; 37 | 38 | #endif // IMCLICKLABEL_H 39 | -------------------------------------------------------------------------------- /IMClient/view/IMDiscussionButton.h: -------------------------------------------------------------------------------- 1 | #ifndef IMDISCUSSIONBUTTON_H 2 | #define IMDISCUSSIONBUTTON_H 3 | 4 | #include 5 | #include "model/IMConstant.h" 6 | 7 | class QMenu; 8 | class QLabel; 9 | class IMMainWidget; 10 | class IMDiscussionChatWidget; 11 | class IMMainCtrl; 12 | 13 | class IMDiscussionButton : public QPushButton 14 | { 15 | Q_OBJECT 16 | public: 17 | IMDiscussionButton(const DiscussionInformation &info, IMMainWidget *mainWidget = 0, 18 | QWidget *parent = 0); 19 | ~IMDiscussionButton(); 20 | 21 | bool isRoomOpen() const 22 | { 23 | return m_isOpen; 24 | } 25 | bool isRoomShow() const 26 | { 27 | return m_isShow; 28 | } 29 | IMDiscussionChatWidget *getRoomPoint() const 30 | { 31 | return m_discussionRoom; 32 | } 33 | DiscussionInformation &getInformation() 34 | { return m_discussionInfo; } 35 | DiscussionInformation getInformation() const 36 | { return m_discussionInfo; } 37 | void setChangedInformation(const DiscussionInformation & discussion) 38 | { 39 | if (m_discussionInfo.m_discussionID != discussion.m_discussionID) 40 | return; 41 | 42 | m_discussionInfo.m_creatorID = discussion.m_creatorID; 43 | m_discussionInfo.m_createDate = discussion.m_createDate; 44 | m_discussionInfo.m_discussionName = discussion.m_discussionName; 45 | m_discussionInfo.m_theme = discussion.m_theme; 46 | setButtonStatus(); 47 | } 48 | // 打开聊天窗口 49 | void openChatRoom(); 50 | // 显示聊天窗口 51 | void showChatRoom(); 52 | // 关闭聊天窗口 53 | void closeChatRoom(); 54 | 55 | // 设置button显示信息 56 | void setButtonStatus(); 57 | 58 | // 删除成员 59 | void deleteDiscussionMember(const QString & memberID); 60 | // 添加成员 61 | void addDiscussionMember(const QString & memberID); 62 | 63 | signals: 64 | void leaveDiscussionSignal(const QString &); 65 | 66 | public slots: 67 | // 左键 双击 68 | void onDoubleClickDiscussionButton(); 69 | // 右键点击按键 70 | void onClickRightButton(); 71 | // 发送讨论组消息 72 | void onClickSendMessage(); 73 | // 查看消息记录 74 | void onClickShowRecord(); 75 | // 解散讨论组 76 | void onClickDropDiscussion(); 77 | // 退出讨论组 78 | void onClickLeaveDiscussion(); 79 | // 添加讨论组成员 80 | void onClickAddMember(); 81 | // 显示详细信息 82 | void onClickShowInformation(); 83 | //聊天窗口关闭了 84 | void chatRoomQuit(); 85 | 86 | // 设置成员列表 87 | void setDiscussionMemberList(const QVector &); 88 | 89 | protected: 90 | void mousePressEvent(QMouseEvent *e); 91 | void mouseDoubleClickEvent(QMouseEvent *); 92 | 93 | private: 94 | // 创建右键菜单 95 | void creatMenu(/*const QList *groutList*/); 96 | 97 | private: 98 | DiscussionInformation m_discussionInfo; 99 | 100 | // 聊天窗口是否打开了 101 | bool m_isOpen; 102 | // 聊天窗口是否显示 103 | bool m_isShow; 104 | // 右键菜单 105 | QMenu *m_menu; 106 | IMDiscussionChatWidget *m_discussionRoom; 107 | IMMainWidget *m_mainWidget; 108 | IMMainCtrl *m_mainCtrl; 109 | QVector m_discussionMembersVec; 110 | 111 | QLabel *m_labelHead; 112 | // QIcon *m_iconHead; 113 | QLabel *m_labelMes; 114 | }; 115 | 116 | #endif // IMDISCUSSIONBUTTON_H 117 | -------------------------------------------------------------------------------- /IMClient/view/IMDiscussionInformationWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef IMDISCUSSIONINFORMATIONWIDGET_H 2 | #define IMDISCUSSIONINFORMATIONWIDGET_H 3 | 4 | #include 5 | #include "model/IMConstant.h" 6 | class QPushButton; 7 | class QLabel; 8 | class QLineEdit; 9 | class IMMainWidget; 10 | 11 | class IMDiscussionInformationWidget : public QWidget 12 | { 13 | Q_OBJECT 14 | public: 15 | IMDiscussionInformationWidget(IMMainWidget *mainWidget, QWidget *parent = 0); 16 | ~IMDiscussionInformationWidget(); 17 | 18 | void setReadOnly(bool isReadOnly, bool isEdit); 19 | void setDiscussionInformation(const DiscussionInformation &); 20 | DiscussionInformation getInformation(); 21 | 22 | signals: 23 | 24 | protected: 25 | void closeEvent(QCloseEvent *); 26 | public slots: 27 | void onClickCancelButton(); 28 | void onClickOKButton(); 29 | private: 30 | void initIMLoginWidget(); 31 | 32 | QLabel *m_labelDiscussionHead; 33 | QLabel *m_labelDiscussionName; 34 | QLabel *m_labelDiscussionID; 35 | QLabel *m_labelCreatorID; 36 | QLabel *m_labelTheme; 37 | QLabel *m_labelCreateDate; 38 | 39 | QLineEdit *m_leDiscussionName; 40 | QLineEdit *m_leDiscussionID; 41 | QLineEdit *m_leCreatorID; 42 | QLineEdit *m_leTheme; 43 | QLineEdit *m_leCreateDate; 44 | 45 | QPushButton *m_btnOk;// "注册" 按钮 46 | QPushButton *m_btnCancel; // "取消" 按钮 47 | 48 | bool m_isReadOnly; 49 | bool m_isEdit; 50 | 51 | DiscussionInformation m_discussionInf; 52 | IMMainWidget *m_mainWidget; 53 | 54 | }; 55 | 56 | #endif // IMDISCUSSIONINFORMATIONWIDGET_H 57 | -------------------------------------------------------------------------------- /IMClient/view/IMDiscussionListWidget.cpp: -------------------------------------------------------------------------------- 1 | #include "IMDiscussionListWidget.h" 2 | #include 3 | #include 4 | #include 5 | #include "IMMainWidget.h" 6 | #include 7 | #include 8 | IMDiscussionListWidget::IMDiscussionListWidget(IMMainWidget *mainWidget, QWidget *parent) : 9 | QWidget(parent), m_layout(new QVBoxLayout) 10 | { 11 | m_mainWidget = mainWidget; 12 | QVBoxLayout *mainLayout=new QVBoxLayout(); 13 | mainLayout->setContentsMargins(0,0,0,0); 14 | mainLayout->setSpacing(0); 15 | 16 | m_contentsWidget = new QWidget; 17 | m_layout->setContentsMargins(0,0,0,0); 18 | m_layout->setSpacing(0); 19 | m_contentsWidget->setLayout(m_layout); 20 | m_contentsWidget->setStyleSheet("QWidget{border: 0;}"); 21 | 22 | m_discussionsScrollArea = new QScrollArea(this); 23 | m_discussionsScrollArea->setWidgetResizable(true); 24 | m_discussionsScrollArea->setAlignment(Qt::AlignLeft); 25 | 26 | m_discussionsScrollArea->setWidget(m_contentsWidget); 27 | 28 | mainLayout->addWidget(m_discussionsScrollArea); 29 | setLayout(mainLayout); 30 | 31 | setStyleSheet("QWidget{border: 0;}"); 32 | 33 | //创建右键菜单 34 | creatMenu(); 35 | } 36 | 37 | 38 | /************************************************* 39 | Function Name: addItem() 40 | Description: 添加 41 | *************************************************/ 42 | void IMDiscussionListWidget::addItem(QWidget *item) 43 | { 44 | // Remove last spacer item if present. 45 | int count = m_layout->count(); 46 | if (count > 1) 47 | { 48 | m_layout->removeItem(m_layout->itemAt(count - 1)); 49 | } 50 | 51 | // Add item and make sure it stretches the remaining space. 52 | m_layout->addWidget(item); 53 | m_layout->addStretch(); 54 | } 55 | 56 | 57 | 58 | /************************************************* 59 | Function Name: removeItem() 60 | Description: 删除 61 | *************************************************/ 62 | void IMDiscussionListWidget::removeItem(QWidget *item) 63 | { 64 | m_layout->removeWidget(item); 65 | if (m_layout->count() == 1) 66 | { 67 | m_layout->removeItem(m_layout->itemAt(0)); 68 | } 69 | } 70 | 71 | 72 | 73 | /************************************************* 74 | Function Name: creatMenu() 75 | Description: 创建右键菜单 76 | *************************************************/ 77 | void IMDiscussionListWidget::creatMenu() 78 | { 79 | m_menu = new QMenu(this); 80 | QAction *actCreateDiscussion = new QAction(tr("新建讨论组"), this); 81 | // QAction *actAddFlock = new QAction(tr("添加讨论组"), this); 82 | QAction *actRefresh = new QAction(tr("刷新讨论组列表"), this); 83 | 84 | connect(actCreateDiscussion, SIGNAL(triggered()), 85 | m_mainWidget, SLOT(createDiscussion())); 86 | // connect(actAddDiscussion, SIGNAL(triggered()), 87 | // m_mainWidget, SLOT(onClickAddFlock())); 88 | connect(actRefresh, SIGNAL(triggered()), 89 | m_mainWidget, SLOT(getDiscussionsInformation())); 90 | 91 | m_menu->addAction(actCreateDiscussion); 92 | // m_menu->addAction(actAddDiscussion); 93 | m_menu->addAction(actRefresh); 94 | } 95 | 96 | 97 | /************************************************* 98 | Function Name: showMenu() 99 | Description: 显示右键菜单 100 | *************************************************/ 101 | void IMDiscussionListWidget::showMenu() 102 | { 103 | if (m_menu == NULL) 104 | { 105 | //创建右键菜单 106 | creatMenu(); 107 | } 108 | m_menu->exec(QCursor::pos()); 109 | } 110 | 111 | 112 | /************************************************* 113 | Function Name: mousePressEvent 114 | Description: 鼠标单击事件 115 | *************************************************/ 116 | void IMDiscussionListWidget::mousePressEvent(QMouseEvent *event) 117 | { 118 | if (event->button() == Qt::RightButton) 119 | { 120 | showMenu(); 121 | return; 122 | } 123 | QWidget::mousePressEvent(event); 124 | } 125 | -------------------------------------------------------------------------------- /IMClient/view/IMDiscussionListWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef IMDISCUSSIONLISTWIDGET_H 2 | #define IMDISCUSSIONLISTWIDGET_H 3 | 4 | #include 5 | 6 | class QVBoxLayout; 7 | class QScrollArea; 8 | class QMenu; 9 | class IMMainWidget; 10 | 11 | class IMDiscussionListWidget : public QWidget 12 | { 13 | Q_OBJECT 14 | public: 15 | IMDiscussionListWidget(IMMainWidget *mainWidget, QWidget *parent = 0); 16 | void addItem(QWidget *item); 17 | void removeItem(QWidget *item); 18 | 19 | //创建右键菜单 20 | void creatMenu(); 21 | 22 | signals: 23 | 24 | public slots: 25 | void showMenu(); 26 | 27 | protected: 28 | void mousePressEvent(QMouseEvent *e); 29 | 30 | private: 31 | QVBoxLayout *m_layout; 32 | QWidget *m_contentsWidget; 33 | QScrollArea *m_discussionsScrollArea; 34 | 35 | //右键菜单 36 | QMenu *m_menu; 37 | 38 | IMMainWidget *m_mainWidget; 39 | 40 | }; 41 | 42 | #endif // IMDISCUSSIONLISTWIDGET_H 43 | -------------------------------------------------------------------------------- /IMClient/view/IMDiscussionMemberButton.h: -------------------------------------------------------------------------------- 1 | #ifndef IMDISCUSSIONMEMBERBUTTON_H 2 | #define IMDISCUSSIONMEMBERBUTTON_H 3 | 4 | #include 5 | #include "model/IMConstant.h" 6 | 7 | class QMenu; 8 | class QLabel; 9 | class IMDiscussionChatWidget; 10 | class IMChatWidget; 11 | class IMMainWidget; 12 | class IMMainCtrl; 13 | 14 | 15 | class IMDiscussionMemberButton : public QPushButton 16 | { 17 | Q_OBJECT 18 | public: 19 | IMDiscussionMemberButton(const DiscussionMember &, IMDiscussionChatWidget *, 20 | IMMainWidget *, QWidget *parent = 0); 21 | 22 | ~IMDiscussionMemberButton(); 23 | 24 | 25 | DiscussionMember &getInformation() 26 | { return m_info; } 27 | DiscussionMember getInformation() const 28 | { return m_info; } 29 | void setChangedInformation(const DiscussionMember & mem) 30 | { 31 | if (m_info.m_discussionID != mem.m_discussionID) 32 | return; 33 | if (m_info.m_discussionID != mem.m_userID) 34 | return; 35 | 36 | m_info.m_headPortrait = mem.m_headPortrait; 37 | m_info.m_nickname = mem.m_nickname; 38 | // m_loginStatus; 39 | // m_info.m_remark = mem.m_remark; 40 | // m_discussionStatus; 41 | // m_joinDate 42 | 43 | 44 | 45 | } 46 | 47 | // void setRemark(const TempStrings & tmpStr) 48 | // { 49 | // if (0 != tmpStr.m_one.compare(m_info.m_discussionID)) 50 | // return; 51 | // if (0 != tmpStr.m_two.compare(m_info.m_userID)) 52 | // return; 53 | 54 | // m_info.m_remark = tmpStr.m_three; 55 | 56 | // setButtonStatus(); 57 | // } 58 | 59 | // 打开聊天窗口 60 | void openChatRoom(); 61 | // 关闭聊天窗口 62 | void closeChatRoom(); 63 | // 设置button显示信息 64 | void setButtonStatus(); 65 | 66 | signals: 67 | void deleteMemberSignal(const QString &); 68 | public slots: 69 | 70 | // 右键点击按键 71 | void onClickRightButton(/*const QPoint &*/); 72 | 73 | // 发送即时消息 74 | void onClickSendMessage(); 75 | // 发送电子邮件 76 | void onClickSendMail(); 77 | // 显示成员详细信息 78 | void onClickShowInformation(); 79 | // 修改名片 80 | //void onClickChangeRemark(); 81 | // 进入空间 82 | void onClickEnterSpace(); 83 | // 移除该成员 84 | void onClickRemoveMember(); 85 | // 加为好友 86 | void onClickAddFriend(); 87 | 88 | // 左键 双击 89 | void onDoubleClickMemberButton(); 90 | //聊天窗口关闭了 91 | void chatRoomQuit(); 92 | 93 | protected: 94 | void mousePressEvent(QMouseEvent *e); 95 | void mouseDoubleClickEvent(QMouseEvent *); 96 | 97 | 98 | private: 99 | // 将好友状态从数字形式转换为字符串形式 100 | QString getDiscussionStatusFromInt(const int n) const; 101 | 102 | // 将好友在线状态从数字形式转换为字符串形式 103 | QString getLoginStatusFromInt(const int n) const; 104 | // 创建右键菜单 105 | void creatMenu(/*const QList *groutList*/); 106 | 107 | 108 | private: 109 | DiscussionMember m_info; 110 | QString m_strDiscussionStatus; // 身份 111 | QString m_strLoginStatus; // 在线状态 112 | // 聊天窗口是否打开了 113 | bool m_isOpen; 114 | 115 | // 右键菜单 116 | QMenu *m_menu; 117 | // IMChatWidget *m_chatRoom; 118 | IMDiscussionChatWidget *m_discussionWidget; 119 | IMMainWidget *m_mainWidget; 120 | IMMainCtrl *m_mainCtrl; 121 | 122 | QLabel *m_labelHead; 123 | QLabel *m_labelMes; 124 | 125 | }; 126 | 127 | #endif // IMDISCUSSIONMEMBERBUTTON_H 128 | -------------------------------------------------------------------------------- /IMClient/view/IMDiscussionMemberListWidget.cpp: -------------------------------------------------------------------------------- 1 | #include "IMDiscussionMemberListWidget.h" 2 | #include 3 | #include 4 | 5 | IMDiscussionMemberListWidget::IMDiscussionMemberListWidget(QWidget *parent) : 6 | QWidget(parent), m_layout(new QVBoxLayout) 7 | { 8 | QVBoxLayout *mainLayout=new QVBoxLayout(); 9 | mainLayout->setContentsMargins(0,0,0,0); 10 | mainLayout->setSpacing(0); 11 | 12 | m_contentsWidget = new QWidget; 13 | m_layout->setContentsMargins(0,0,0,0); 14 | m_layout->setSpacing(0); 15 | m_contentsWidget->setLayout(m_layout); 16 | m_contentsWidget->setStyleSheet("QWidget{border: 0;}"); 17 | 18 | m_flocksScrollArea = new QScrollArea(this); 19 | m_flocksScrollArea->setWidgetResizable(true); 20 | m_flocksScrollArea->setAlignment(Qt::AlignLeft); 21 | 22 | m_flocksScrollArea->setWidget(m_contentsWidget); 23 | 24 | mainLayout->addWidget(m_flocksScrollArea); 25 | setLayout(mainLayout); 26 | 27 | setStyleSheet("QWidget{border: 0;}"); 28 | } 29 | 30 | 31 | /************************************************* 32 | Function Name: addItem() 33 | Description: 添加 34 | *************************************************/ 35 | void IMDiscussionMemberListWidget::addItem(QWidget *item) 36 | { 37 | // Remove last spacer item if present. 38 | int count = m_layout->count(); 39 | if (count > 1) 40 | { 41 | m_layout->removeItem(m_layout->itemAt(count - 1)); 42 | } 43 | 44 | // Add item and make sure it stretches the remaining space. 45 | m_layout->addWidget(item); 46 | m_layout->addStretch(); 47 | } 48 | -------------------------------------------------------------------------------- /IMClient/view/IMDiscussionMemberListWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef IMDISCUSSIONMEMBERLISTWIDGET_H 2 | #define IMDISCUSSIONMEMBERLISTWIDGET_H 3 | 4 | #include 5 | 6 | class QVBoxLayout; 7 | class QScrollArea; 8 | 9 | class IMDiscussionMemberListWidget : public QWidget 10 | { 11 | Q_OBJECT 12 | public: 13 | explicit IMDiscussionMemberListWidget(QWidget *parent = 0); 14 | void addItem(QWidget *item); 15 | 16 | signals: 17 | 18 | public slots: 19 | 20 | private: 21 | QVBoxLayout *m_layout; 22 | QWidget *m_contentsWidget; 23 | QScrollArea *m_flocksScrollArea; 24 | }; 25 | 26 | #endif // IMDISCUSSIONMEMBERLISTWIDGET_H 27 | -------------------------------------------------------------------------------- /IMClient/view/IMFileReceiverWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef IMFILERECEIVERWIDGET_H 2 | #define IMFILERECEIVERWIDGET_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | class QProgressBar; 9 | class QLabel; 10 | class QPushButton; 11 | class QPushButton; 12 | class QTcpSocket; 13 | class QTcpServer; 14 | class QFile; 15 | class QAbstractSocket; 16 | 17 | 18 | class IMFileReceiverWidget : public QWidget 19 | { 20 | Q_OBJECT 21 | public: 22 | IMFileReceiverWidget(QWidget *parent = 0); 23 | ~IMFileReceiverWidget(); 24 | 25 | // 设置文件名 26 | void setFileName(const QString & fileName); 27 | // 设置服务器地址并连接服务器 28 | void connectToHost(const QHostAddress & address); 29 | 30 | signals: 31 | 32 | 33 | 34 | private: 35 | // 初始化 36 | void initIMFileReceiverWidget(); 37 | 38 | public slots: 39 | // 点击“关闭”按钮 40 | void onClickBtnClose(); 41 | // 点击“取消”按钮 中途取消的操作 42 | void onClickBtnCancel(); 43 | // 读取收到的文件 44 | void readMessage(); 45 | // 错误处理 46 | void displayError(QAbstractSocket::SocketError); 47 | // 连接断开 48 | void showClosedConnect(); 49 | 50 | private: 51 | QLabel *m_labelFileName; 52 | QLabel *m_labelFileStatus; 53 | QProgressBar *m_barFile; 54 | QPushButton *m_btnClose; 55 | QPushButton *m_btnCancel; 56 | 57 | QTcpSocket *m_fileReceiver; 58 | quint16 m_blockSize; 59 | QHostAddress m_hostAddress; 60 | qint16 m_tcpPort; 61 | 62 | qint64 m_totalBytes; 63 | qint64 m_bytesReceived; 64 | qint64 m_bytesToReceive; 65 | qint64 m_fileNameSize; 66 | QString m_fileName; 67 | QFile *m_localFile; 68 | QByteArray m_inBlock; 69 | 70 | QTime m_time; 71 | 72 | }; 73 | 74 | #endif // IMFILERECEIVERWIDGET_H 75 | -------------------------------------------------------------------------------- /IMClient/view/IMFileSenderWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef IMFILESENDERWIDGET_H 2 | #define IMFILESENDERWIDGET_H 3 | 4 | #include 5 | #include 6 | 7 | class QProgressBar; 8 | class QLabel; 9 | class QPushButton; 10 | class QTcpSocket; 11 | class QTcpServer; 12 | class QFile; 13 | 14 | class IMFileSenderWidget : public QWidget 15 | { 16 | Q_OBJECT 17 | public: 18 | IMFileSenderWidget(QWidget *parent = 0); 19 | ~IMFileSenderWidget(); 20 | 21 | // 初始化 22 | void initSender(); 23 | // 被拒绝时触发 聊天窗体调用 24 | void showRefused(); 25 | // 初始化文件服务器,监听对方 26 | bool startSending(const QString &); 27 | bool isStopped(); 28 | 29 | signals: 30 | // void sendFileName(QString fileName,QString addr); 31 | 32 | public slots: 33 | 34 | 35 | private: 36 | // 初始化发送窗口 37 | void initIMFileSenderWidget(); 38 | 39 | private slots: 40 | //点击“取消”按钮 取消发送 41 | void onClickBtnCancel(); 42 | // 点击“关闭”按钮 43 | void onClickBtnClose(); 44 | // 当有新连接时触发 发送文件 45 | void sendMessage(); 46 | // 根据发送情况实时更新进度条 47 | void updateClientProgress(qint64 numBytes); 48 | 49 | // 连接断开 50 | void showClosedConnect(); 51 | 52 | private: 53 | QLabel *m_labelFileName; 54 | QLabel *m_labelFileStatus; 55 | QProgressBar *m_barFile; 56 | QPushButton *m_btnCancel; 57 | QPushButton *m_btnClose; 58 | 59 | QTcpSocket *m_clientConnection; 60 | 61 | qint16 m_tcpPort; 62 | QTcpServer *m_fileSender; 63 | QString m_filePath; 64 | QString m_fileName; 65 | QFile *m_localFile; 66 | 67 | qint64 m_totalBytes; 68 | qint64 m_bytesWritten; 69 | qint64 m_bytesToWrite; 70 | qint64 m_loadSize; 71 | QByteArray m_outBlock; // 缓存一次发送的数据 72 | QTime m_time; // 计时器 73 | 74 | 75 | bool m_isStopped; 76 | }; 77 | 78 | #endif // IMFILESENDERWIDGET_H 79 | -------------------------------------------------------------------------------- /IMClient/view/IMFlockButton.h: -------------------------------------------------------------------------------- 1 | #ifndef IMFLOCKBUTTON_H 2 | #define IMFLOCKBUTTON_H 3 | 4 | #include 5 | #include "model/IMConstant.h" 6 | 7 | class QMenu; 8 | class QLabel; 9 | class IMMainWidget; 10 | class IMFlockChatWidget; 11 | class IMMainCtrl; 12 | 13 | class IMFlockButton : public QPushButton 14 | { 15 | Q_OBJECT 16 | public: 17 | IMFlockButton(const FlockInformation &info, IMMainWidget *mainWidget, 18 | QWidget *parent = 0); 19 | ~IMFlockButton(); 20 | 21 | bool isRoomOpen() const 22 | { 23 | return m_isOpen; 24 | } 25 | bool isRoomShow() const 26 | { 27 | return m_isShow; 28 | } 29 | IMFlockChatWidget *getRoomPoint() const 30 | { 31 | return m_flockRoom; 32 | } 33 | FlockInformation &getInformation() 34 | { return m_flockInfo; } 35 | FlockInformation getInformation() const 36 | { return m_flockInfo; } 37 | void setChangedInformation(const FlockInformation & flock) 38 | { 39 | if (m_flockInfo.m_flockID != flock.m_flockID) 40 | return; 41 | 42 | // m_flockInfo.m_creatorID = flock.m_creatorID; 43 | // m_flockInfo.m_createDate = flock.m_createDate; 44 | m_flockInfo.m_flockName = flock.m_flockName; 45 | m_flockInfo.m_theme = flock.m_theme; 46 | setButtonStatus(); 47 | } 48 | // 打开聊天窗口 49 | void openChatRoom(); 50 | // 显示聊天窗口 51 | void showChatRoom(); 52 | // 关闭聊天窗口 53 | void closeChatRoom(); 54 | 55 | // 设置button显示信息 56 | void setButtonStatus(); 57 | 58 | // 删除群成员 59 | void deleteFlockMember(const QString & memberID); 60 | // 添加群成员 61 | void addFlockMember(const QString & memberID); 62 | 63 | signals: 64 | void leaveFlockSignal(const QString &); 65 | 66 | public slots: 67 | // 左键 双击 68 | void onDoubleClickFlockButton(); 69 | // 右键点击按键 70 | void onClickRightButton(); 71 | // 发送群消息 72 | void onClickSendMessage(); 73 | // 查看消息记录 74 | void onClickShowRecord(); 75 | // 显示群详细信息 76 | void onClickShowInformation(); 77 | // 解散群 78 | void onClickDropFlock(); 79 | // 退出群 80 | void onClickLeaveFlock(); 81 | // 添加群成员 82 | void onClickAddMemberFlock(); 83 | // 进入空间 84 | void onClickEnterSpace(); 85 | //聊天窗口关闭了 86 | void chatRoomQuit(); 87 | 88 | // 设置成员列表 89 | void setFlockMemberList(const QVector &); 90 | 91 | protected: 92 | void mousePressEvent(QMouseEvent *e); 93 | void mouseDoubleClickEvent(QMouseEvent *); 94 | 95 | private: 96 | // 创建右键菜单 97 | void creatMenu(/*const QList *groutList*/); 98 | 99 | private: 100 | FlockInformation m_flockInfo; 101 | 102 | // 聊天窗口是否打开了 103 | bool m_isOpen; 104 | // 聊天窗口是否显示 105 | bool m_isShow; 106 | // 右键菜单 107 | QMenu *m_menu; 108 | // IMFlockChatWidget *m_chatRoom; 109 | IMMainWidget *m_mainWidget; 110 | IMMainCtrl *m_mainCtrl; 111 | 112 | QLabel *m_labelHead; 113 | // QIcon *m_iconHead; 114 | QLabel *m_labelMes; 115 | IMFlockChatWidget *m_flockRoom; 116 | QVector m_flockMembersVec; 117 | }; 118 | 119 | #endif // IMFLOCKBUTTON_H 120 | -------------------------------------------------------------------------------- /IMClient/view/IMFlockInformationWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef IMFLOCKINFORMATIONWIDGET_H 2 | #define IMFLOCKINFORMATIONWIDGET_H 3 | 4 | #include 5 | #include "model/IMConstant.h" 6 | class QPushButton; 7 | class QLabel; 8 | class QLineEdit; 9 | class IMMainWidget; 10 | 11 | class IMFlockInformationWidget : public QWidget 12 | { 13 | Q_OBJECT 14 | public: 15 | IMFlockInformationWidget(IMMainWidget *mainWidget, QWidget *parent = 0); 16 | ~IMFlockInformationWidget(); 17 | void setReadOnly(bool isReadOnly, bool isEdit); 18 | void setFlockInformation(const FlockInformation &); 19 | FlockInformation getInformation(); 20 | signals: 21 | 22 | protected: 23 | void closeEvent(QCloseEvent *); 24 | public slots: 25 | void onClickCancelButton(); 26 | void onClickOKButton(); 27 | private: 28 | void initIMLoginWidget(); 29 | 30 | QLabel *m_labelFlockHead; 31 | QLabel *m_labelFlockName; 32 | QLabel *m_labelFlockID; 33 | QLabel *m_labelCreatorID; 34 | QLabel *m_labelTheme; 35 | QLabel *m_labelCreateDate; 36 | 37 | QLineEdit *m_leFlockName; 38 | QLineEdit *m_leFlockID; 39 | QLineEdit *m_leCreatorID; 40 | QLineEdit *m_leTheme; 41 | QLineEdit *m_leCreateDate; 42 | 43 | QPushButton *m_btnOk;// "注册" 按钮 44 | QPushButton *m_btnCancel; // "取消" 按钮 45 | 46 | bool m_isReadOnly; 47 | bool m_isEdit; 48 | 49 | FlockInformation m_flockInf; 50 | IMMainWidget *m_mainWidget; 51 | }; 52 | 53 | #endif // IMFLOCKINFORMATIONWIDGET_H 54 | -------------------------------------------------------------------------------- /IMClient/view/IMFlockListWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef IMFLOCKLISTWIDGET_H 2 | #define IMFLOCKLISTWIDGET_H 3 | 4 | #include 5 | 6 | class QVBoxLayout; 7 | class QScrollArea; 8 | class QMenu; 9 | class IMMainWidget; 10 | 11 | 12 | class IMFlockListWidget : public QWidget 13 | { 14 | Q_OBJECT 15 | public: 16 | IMFlockListWidget(IMMainWidget *mainWidget, QWidget *parent = 0); 17 | void addItem(QWidget *item); 18 | void removeItem(QWidget *item); 19 | 20 | //创建右键菜单 21 | void creatMenu(); 22 | 23 | signals: 24 | 25 | public slots: 26 | void showMenu(); 27 | 28 | protected: 29 | void mousePressEvent(QMouseEvent *e); 30 | 31 | private: 32 | QVBoxLayout *m_layout; 33 | QWidget *m_contentsWidget; 34 | QScrollArea *m_flocksScrollArea; 35 | 36 | //右键菜单 37 | QMenu *m_menu; 38 | 39 | IMMainWidget *m_mainWidget; 40 | }; 41 | 42 | #endif // IMFLOCKLISTWIDGET_H 43 | -------------------------------------------------------------------------------- /IMClient/view/IMFlockMemberButton.h: -------------------------------------------------------------------------------- 1 | #ifndef IMFLOCKMEMBERBUTTON_H 2 | #define IMFLOCKMEMBERBUTTON_H 3 | 4 | #include 5 | #include "model/IMConstant.h" 6 | 7 | class QMenu; 8 | class QLabel; 9 | class IMFlockChatWidget; 10 | class IMChatWidget; 11 | class IMMainWidget; 12 | class IMMainCtrl; 13 | \ 14 | class IMFlockMemberButton : public QPushButton 15 | { 16 | Q_OBJECT 17 | public: 18 | IMFlockMemberButton(const FlockMember &, IMFlockChatWidget *, 19 | IMMainWidget *, QWidget *parent = 0); 20 | ~IMFlockMemberButton(); 21 | 22 | FlockMember &getInformation() 23 | { return m_info; } 24 | FlockMember getInformation() const 25 | { return m_info; } 26 | void setChangedInformation(const FlockMember & mem) 27 | { 28 | if (m_info.m_flockID != mem.m_flockID) 29 | return; 30 | if (m_info.m_flockID != mem.m_userID) 31 | return; 32 | 33 | m_info.m_headPortrait = mem.m_headPortrait; 34 | m_info.m_nickname = mem.m_nickname; 35 | // m_loginStatus; 36 | m_info.m_remark = mem.m_remark; 37 | // m_flockStatus; 38 | // m_joinDate 39 | 40 | 41 | 42 | } 43 | 44 | void setRemark(const TempStrings & tmpStr) 45 | { 46 | if (0 != tmpStr.m_one.compare(m_info.m_flockID)) 47 | return; 48 | if (0 != tmpStr.m_two.compare(m_info.m_userID)) 49 | return; 50 | 51 | m_info.m_remark = tmpStr.m_three; 52 | 53 | setButtonStatus(); 54 | } 55 | 56 | // 打开聊天窗口 57 | void openChatRoom(); 58 | // 关闭聊天窗口 59 | void closeChatRoom(); 60 | // 设置button显示信息 61 | void setButtonStatus(); 62 | 63 | signals: 64 | void deleteMemberSignal(const QString &); 65 | public slots: 66 | 67 | // 右键点击按键 68 | void onClickRightButton(/*const QPoint &*/); 69 | 70 | // 发送即时消息 71 | void onClickSendMessage(); 72 | // 发送电子邮件 73 | void onClickSendMail(); 74 | // 显示成员详细信息 75 | void onClickShowInformation(); 76 | // 修改群名片 77 | void onClickChangeRemark(); 78 | // 进入空间 79 | void onClickEnterSpace(); 80 | // 移除该成员 81 | void onClickRemoveMember(); 82 | // 加为好友 83 | void onClickAddFriend(); 84 | 85 | // 左键 双击 86 | void onDoubleClickMemberButton(); 87 | //聊天窗口关闭了 88 | void chatRoomQuit(); 89 | 90 | protected: 91 | void mousePressEvent(QMouseEvent *e); 92 | void mouseDoubleClickEvent(QMouseEvent *); 93 | 94 | 95 | private: 96 | // 将好友状态从数字形式转换为字符串形式 97 | QString getFlockStatusFromInt(const int n) const; 98 | 99 | // 将好友在线状态从数字形式转换为字符串形式 100 | QString getLoginStatusFromInt(const int n) const; 101 | // 创建右键菜单 102 | void creatMenu(/*const QList *groutList*/); 103 | 104 | 105 | private: 106 | FlockMember m_info; 107 | QString m_strFlockStatus; // 身份 108 | QString m_strLoginStatus; // 在线状态 109 | // 聊天窗口是否打开了 110 | bool m_isOpen; 111 | 112 | // 右键菜单 113 | QMenu *m_menu; 114 | // IMChatWidget *m_chatRoom; 115 | IMFlockChatWidget *m_flockWidget; 116 | IMMainWidget *m_mainWidget; 117 | IMMainCtrl *m_mainCtrl; 118 | 119 | QLabel *m_labelHead; 120 | QLabel *m_labelMes; 121 | 122 | }; 123 | 124 | #endif // IMFLOCKMEMBERBUTTON_H 125 | -------------------------------------------------------------------------------- /IMClient/view/IMFlockMemberListWidget.cpp: -------------------------------------------------------------------------------- 1 | #include "IMFlockMemberListWidget.h" 2 | #include 3 | #include 4 | 5 | IMFlockMemberListWidget::IMFlockMemberListWidget(QWidget *parent) : 6 | QWidget(parent), m_layout(new QVBoxLayout) 7 | { 8 | QVBoxLayout *mainLayout=new QVBoxLayout(); 9 | mainLayout->setContentsMargins(0,0,0,0); 10 | mainLayout->setSpacing(0); 11 | 12 | m_contentsWidget = new QWidget; 13 | m_layout->setContentsMargins(0,0,0,0); 14 | m_layout->setSpacing(0); 15 | m_contentsWidget->setLayout(m_layout); 16 | m_contentsWidget->setStyleSheet("QWidget{border: 0;}"); 17 | 18 | m_flocksScrollArea = new QScrollArea(this); 19 | m_flocksScrollArea->setWidgetResizable(true); 20 | m_flocksScrollArea->setAlignment(Qt::AlignLeft); 21 | 22 | m_flocksScrollArea->setWidget(m_contentsWidget); 23 | 24 | mainLayout->addWidget(m_flocksScrollArea); 25 | setLayout(mainLayout); 26 | 27 | setStyleSheet("QWidget{border: 0;}"); 28 | } 29 | 30 | 31 | /************************************************* 32 | Function Name: addItem() 33 | Description: 添加 34 | *************************************************/ 35 | void IMFlockMemberListWidget::addItem(QWidget *item) 36 | { 37 | // Remove last spacer item if present. 38 | int count = m_layout->count(); 39 | if (count > 1) 40 | { 41 | m_layout->removeItem(m_layout->itemAt(count - 1)); 42 | } 43 | 44 | // Add item and make sure it stretches the remaining space. 45 | m_layout->addWidget(item); 46 | m_layout->addStretch(); 47 | } 48 | -------------------------------------------------------------------------------- /IMClient/view/IMFlockMemberListWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef IMFLOCKMEMBERLISTWIDGET_H 2 | #define IMFLOCKMEMBERLISTWIDGET_H 3 | 4 | #include 5 | 6 | class QVBoxLayout; 7 | class QScrollArea; 8 | 9 | class IMFlockMemberListWidget : public QWidget 10 | { 11 | Q_OBJECT 12 | public: 13 | explicit IMFlockMemberListWidget(QWidget *parent = 0); 14 | void addItem(QWidget *item); 15 | 16 | signals: 17 | 18 | public slots: 19 | 20 | private: 21 | QVBoxLayout *m_layout; 22 | QWidget *m_contentsWidget; 23 | QScrollArea *m_flocksScrollArea; 24 | }; 25 | 26 | #endif // IMFLOCKMEMBERLISTWIDGET_H 27 | -------------------------------------------------------------------------------- /IMClient/view/IMForgotPwdWidget.cpp: -------------------------------------------------------------------------------- 1 | /********************************************* 2 | File Name: IMForgotPwdWidget.cpp 3 | Author: jet.F.R 4 | Date: 2014.3.14 5 | Description: 客户端,忘记密码找回密码的界面 6 | Changes: 7 | ********************************************/ 8 | 9 | #include "IMForgotPwdWidget.h" 10 | 11 | IMForgotPwdWidget::IMForgotPwdWidget(QWidget *parent) : 12 | QWidget(parent) 13 | { 14 | } 15 | -------------------------------------------------------------------------------- /IMClient/view/IMForgotPwdWidget.h: -------------------------------------------------------------------------------- 1 | /********************************************* 2 | File Name: IMForgotPwdWidget.h 3 | Author: jet.F.R 4 | Date: 2014.3.14 5 | Description: 客户端,忘记密码找回密码的界面 6 | Changes: 7 | ********************************************/ 8 | #ifndef IMFORGOTPWDWIDGET_H 9 | #define IMFORGOTPWDWIDGET_H 10 | 11 | #include 12 | 13 | /************************************************* 14 | Class Name: IMForgotPwdWidget 15 | Description: 客户端忘记密码界面类 16 | *************************************************/ 17 | class IMForgotPwdWidget : public QWidget 18 | { 19 | Q_OBJECT 20 | public: 21 | IMForgotPwdWidget(QWidget *parent = 0); 22 | 23 | signals: 24 | 25 | public slots: 26 | 27 | }; 28 | 29 | #endif // IMFORGOTPWDWIDGET_H 30 | -------------------------------------------------------------------------------- /IMClient/view/IMFriendButton.h: -------------------------------------------------------------------------------- 1 | #ifndef IMFRIENDBUTTON_H 2 | #define IMFRIENDBUTTON_H 3 | 4 | #include 5 | #include "model/IMConstant.h" 6 | 7 | class QMenu; 8 | class IMChatWidget; 9 | class IMMainWidget; 10 | class QLabel; 11 | 12 | class IMFriendButton : public QPushButton 13 | { 14 | Q_OBJECT 15 | public: 16 | IMFriendButton(const FriendInformation &info, QList *groupList, 17 | IMMainWidget *mainWidget, QWidget *parent = 0); 18 | ~IMFriendButton(); 19 | 20 | bool isRoomOpen() const 21 | { 22 | return m_isOpen; 23 | } 24 | bool isRoomShow() const 25 | { 26 | return m_isShow; 27 | } 28 | IMChatWidget *getRoomPoint() const 29 | { 30 | return m_chatRoom; 31 | } 32 | FriendInformation &getInformation() 33 | { return m_info; } 34 | FriendInformation getInformation() const 35 | { return m_info; } 36 | void setChangedInformation(const FriendInformation & fri) 37 | { 38 | if (m_info.m_userID != fri.m_userID) 39 | return; 40 | m_info.m_headPortrait = fri.m_headPortrait; 41 | m_info.m_nickname = fri.m_nickname; 42 | // m_info.m_status = fri.m_status; 43 | } 44 | // 创建聊天窗口 45 | void openChatRoom(); 46 | // 显示聊天窗口 47 | void showChatRoom(); 48 | // 关闭聊天窗口 49 | void closeChatRoom(); 50 | 51 | // 设置button显示信息 52 | void setButtonStatus(); 53 | // 刷新菜单中分组信息 54 | void refreshMoveMenu(); 55 | 56 | signals: 57 | void deleteFriendSignal(const QString &); 58 | // void leftDoubleClickSignal(); 59 | 60 | public slots: 61 | // 左键 双击 62 | void onDoubleClickFriendButton(); 63 | // 右键点击按键 64 | void onClickRightButton(/*const QPoint &*/); 65 | 66 | // 发送即时消息 67 | void onClickSendMessage(); 68 | // 查看消息记录 69 | void onClickShowRecord(); 70 | // 发送电子邮件 71 | void onClickSendMail(); 72 | // 显示好友详细信息 73 | void onClickShowInformation(); 74 | // 点击修改好友备注 75 | void onClickChangeRemark(); 76 | // 移动好友至其他分组 77 | void onClickMove(); 78 | // 删除好友 79 | void onClickRemoveFriend(); 80 | // 进入空间 81 | void onClickEnterSpace(); 82 | 83 | //聊天窗口关闭了 84 | void chatRoomQuit(); 85 | 86 | // //修改好友状态 87 | // void changeRemark(const QString &newRemark); 88 | // void changeStatus(int status); 89 | 90 | protected: 91 | void mousePressEvent(QMouseEvent *e); 92 | void mouseDoubleClickEvent(QMouseEvent *); 93 | 94 | 95 | 96 | private: 97 | // 将好友状态从数字形式转换为字符串形式 98 | QString getStatusFromInt(const int n) const; 99 | // 创建右键菜单 100 | void creatMenu(/*const QList *groutList*/); 101 | 102 | 103 | private: 104 | FriendInformation m_info; 105 | //以字符串形式储存好友状态信息 106 | QString m_strStatus; 107 | // 聊天窗口是否打开了 108 | bool m_isOpen; 109 | // 聊天窗口是否显示 110 | bool m_isShow; 111 | // 右键菜单 112 | QMenu *m_menu; 113 | QMenu *m_moveFriendMenu; 114 | IMChatWidget *m_chatRoom; 115 | IMMainWidget *m_mainWidget; 116 | 117 | QLabel *m_labelHead; 118 | // QIcon *m_iconHead; 119 | QLabel *m_labelMes; 120 | 121 | QList *m_groupList; 122 | }; 123 | 124 | #endif // IMFRIENDBUTTON_H 125 | -------------------------------------------------------------------------------- /IMClient/view/IMFriendListWidget.cpp: -------------------------------------------------------------------------------- 1 | #include "IMFriendListWidget.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include "view/IMMainWidget.h" 8 | 9 | IMFriendListWidget::IMFriendListWidget(IMMainWidget *mainWidget, QWidget *parent) : 10 | m_mainWidget(mainWidget), QWidget(parent), m_layout(new QVBoxLayout) 11 | { 12 | QVBoxLayout *mainLayout=new QVBoxLayout(); 13 | mainLayout->setContentsMargins(0,0,0,0); 14 | mainLayout->setSpacing(0); 15 | 16 | m_contentsWidget = new QWidget; 17 | m_layout->setContentsMargins(0,0,0,0); 18 | m_layout->setSpacing(0); 19 | // QSize AdjustSize = m_contentsWidget->size(); 20 | // m_contentsWidget->setMinimumSize(AdjustSize); 21 | m_contentsWidget->setLayout(m_layout); 22 | 23 | m_friendsScrollArea = new QScrollArea(this); 24 | // m_friendsScrollArea->setObjectName(QString::fromUtf8("scrollArea")); 25 | m_friendsScrollArea->setWidgetResizable(true); 26 | m_friendsScrollArea->setAlignment(Qt::AlignLeft); 27 | // m_friendsScrollArea->setObjectName(QString::fromUtf8("scrollAreaWidgetContents")); 28 | // m_contentsWidget->setGeometry(QRect(0, 0, 270, 100)); 29 | // m_contentsWidget->setMinimumSize(270,100); 30 | // m_contentsWidget->showMaximized(); 31 | //setMinimumSize(270, 600); 32 | m_friendsScrollArea->setWidget(m_contentsWidget); 33 | 34 | mainLayout->addWidget(m_friendsScrollArea); 35 | setLayout(mainLayout); 36 | 37 | setStyleSheet("QWidget{border: 0;}"); 38 | 39 | creatMenu(); 40 | } 41 | 42 | /************************************************* 43 | Function Name: addItem() 44 | Description: 添加 45 | *************************************************/ 46 | void IMFriendListWidget::addItem(QWidget *item) 47 | { 48 | // Remove last spacer item if present. 49 | int count = m_layout->count(); 50 | if (count > 1) 51 | { 52 | m_layout->removeItem(m_layout->itemAt(count - 1)); 53 | } 54 | 55 | // Add item and make sure it stretches the remaining space. 56 | m_layout->addWidget(item); 57 | m_layout->addStretch(); 58 | } 59 | 60 | /************************************************* 61 | Function Name: creatMenu 62 | Description: 创建右键菜单 63 | *************************************************/ 64 | void IMFriendListWidget:: creatMenu() 65 | { 66 | m_menu = new QMenu(this); 67 | QAction *create = new QAction(tr("新建分组"), m_menu); 68 | QAction *refresh = new QAction(tr("刷新好友列表"), m_menu); 69 | QAction *addFriend = new QAction(tr("添加好友"), m_menu); 70 | 71 | connect(create, SIGNAL(triggered()), 72 | m_mainWidget, SLOT(createBox())); 73 | connect(refresh, SIGNAL(triggered()), 74 | m_mainWidget, SLOT(getFriendsInformation())); 75 | connect(addFriend, SIGNAL(triggered()), 76 | m_mainWidget, SLOT(onClickAddFriend())); 77 | 78 | m_menu->addAction(create); 79 | m_menu->addAction(refresh); 80 | m_menu->addAction(addFriend); 81 | } 82 | 83 | 84 | /************************************************* 85 | Function Name: showMenu() 86 | Description: 显示右键菜单 87 | *************************************************/ 88 | void IMFriendListWidget::showMenu() 89 | { 90 | if (m_menu == NULL) 91 | { 92 | //创建右键菜单 93 | creatMenu(); 94 | } 95 | m_menu->exec(QCursor::pos()); 96 | } 97 | 98 | 99 | // mark protected:------------------------------------------------------ 100 | /************************************************* 101 | Function Name: mousePressEvent 102 | Description: 鼠标点击事件 103 | *************************************************/ 104 | void IMFriendListWidget:: mousePressEvent(QMouseEvent *event) 105 | { 106 | if (event->button() == Qt::RightButton) 107 | { 108 | showMenu(); 109 | return; 110 | } 111 | QWidget::mousePressEvent(event); 112 | } 113 | -------------------------------------------------------------------------------- /IMClient/view/IMFriendListWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef IMFRIENDLISTWIDGET_H 2 | #define IMFRIENDLISTWIDGET_H 3 | 4 | #include 5 | 6 | class QVBoxLayout; 7 | class QScrollArea; 8 | class QMenu; 9 | class IMMainWidget; 10 | 11 | class IMFriendListWidget : public QWidget 12 | { 13 | Q_OBJECT 14 | public: 15 | IMFriendListWidget(IMMainWidget *mainWidget, QWidget *parent = 0); 16 | void addItem(QWidget *item); 17 | 18 | //创建右键菜单 19 | void creatMenu(); 20 | 21 | signals: 22 | 23 | 24 | public slots: 25 | void showMenu(); 26 | 27 | protected: 28 | void mousePressEvent(QMouseEvent *e); 29 | 30 | private: 31 | QVBoxLayout *m_layout; 32 | QWidget *m_contentsWidget; 33 | QScrollArea *m_friendsScrollArea; 34 | 35 | //右键菜单 36 | QMenu *m_menu; 37 | 38 | IMMainWidget *m_mainWidget; 39 | }; 40 | 41 | #endif // IMFRIENDLISTWIDGET_H 42 | -------------------------------------------------------------------------------- /IMClient/view/IMInformationWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef IMINFORMATIONWIDGET_H 2 | #define IMINFORMATIONWIDGET_H 3 | 4 | #include 5 | #include "model/IMConstant.h" 6 | 7 | class QPushButton; 8 | class QLabel; 9 | class QLineEdit; 10 | class QCheckBox; 11 | class QComboBox; 12 | class QFrame; 13 | class CustomLineEdit; 14 | class IMMainWidget; 15 | 16 | static const int MAX_NUM = 133; //总头像数 17 | 18 | class IMInformationWidget : public QWidget 19 | { 20 | Q_OBJECT 21 | public: 22 | IMInformationWidget(IMMainWidget *mainWidget, QWidget *parent = 0); 23 | ~IMInformationWidget(); 24 | 25 | void setReadOnly(bool isReadOnly, bool isEdit); 26 | // void setWrite(); 27 | void setUserInformation(const UserInformation &user); 28 | UserInformation getInformation(); 29 | protected: 30 | void closeEvent(QCloseEvent *); 31 | signals: 32 | // void sendInformation(const UserInformation &user); 33 | public slots: 34 | void onClickCancelButton(); 35 | void onClickOKButton(); 36 | void onClickPretButton(); 37 | void onClickNextButton(); 38 | 39 | private: 40 | void initIMLoginWidget(); 41 | 42 | protected: 43 | QLabel *m_labelUserID; // 用户帐号 44 | QLineEdit *m_leUserID; 45 | // QLabel *m_labelDesUserID; 46 | QLabel *m_labelNickname; // 用户昵称 47 | QLineEdit *m_leNickname; 48 | 49 | QFrame *m_frameHead; 50 | QLabel *m_labelHead; 51 | // QLabel *m_labelHeadMes; 52 | QPushButton *m_btnNext; 53 | QPushButton *m_btnPre; 54 | // QLabel *m_labelDesNickname;// 昵称描述 55 | // QLabel *m_labelPwd; // 用户密码 56 | // QLineEdit *m_lePwd; 57 | // QLabel *m_labelDesPwd; 58 | QLabel *m_labelConfirmPwd; // 确认密码 59 | QLineEdit *m_leConfirmPwd; 60 | // QLabel *m_labelDesConfirmPwd; 61 | QLabel *m_labelSex; // 性别 62 | QComboBox *m_cbxSex; 63 | // QLabel *m_labelDesSex; 64 | QLabel *m_labelBirthday; // 生日 65 | CustomLineEdit *m_leBirthday; 66 | // QLabel *m_labelDesBirthday; 67 | // QLabel *m_labelQuestion; // 密保问题 68 | // QLineEdit *m_leQuestion; 69 | // QLabel *m_labelDesQuestion; 70 | // QLabel *m_labelAnswer; // 问题答案 71 | // QLineEdit *m_leAnswer; 72 | // QLabel *m_labelDesAnswer; 73 | QLabel *m_labelName; // 真实姓名 74 | QLineEdit *m_leName; 75 | // QLabel *m_labelDesName; 76 | QLabel *m_labelPhone; // 电话 77 | QLineEdit *m_lePhone; 78 | // QLabel *m_labelDesPhone; 79 | QLabel *m_labelAddress; // 地址 80 | QLineEdit *m_leAddress; 81 | // QLabel *m_labelDesAddress; 82 | 83 | QPushButton *m_btnOk;// "注册" 按钮 84 | QPushButton *m_btnCancel; // "取消" 按钮 85 | 86 | int m_headNum; 87 | bool m_isReadOnly; 88 | bool m_isEdit; 89 | 90 | UserInformation m_userInf; 91 | IMMainWidget *m_mainWidget; 92 | }; 93 | 94 | #endif // IMINFORMATIONWIDGET_H 95 | -------------------------------------------------------------------------------- /IMClient/view/IMInputTextEdit.cpp: -------------------------------------------------------------------------------- 1 | /********************************************* 2 | File Name: IMInputTextEdit.cpp 3 | Author: jet.F.R 4 | Date: 2014.3.26 5 | Description: 输入编辑框 6 | Changes: 7 | ********************************************/ 8 | 9 | #include "IMInputTextEdit.h" 10 | #include 11 | 12 | IMInputTextEdit::IMInputTextEdit(QWidget *parent) : 13 | QTextEdit(parent) 14 | { 15 | 16 | } 17 | 18 | IMInputTextEdit::~IMInputTextEdit() 19 | { 20 | 21 | } 22 | 23 | 24 | void IMInputTextEdit::keyPressEvent(QKeyEvent *event) 25 | { 26 | //如果按下Ctrl+Enter,就发送信息,否则就按默认的方式来处理 27 | bool isSend = (Qt::Key_Return==event->key() || Qt::Key_Enter==event->key()) 28 | && (event->modifiers() & Qt::ControlModifier); 29 | 30 | if(isSend) 31 | emit sendMessage(); 32 | else 33 | QTextEdit::keyPressEvent(event); 34 | } 35 | -------------------------------------------------------------------------------- /IMClient/view/IMInputTextEdit.h: -------------------------------------------------------------------------------- 1 | /********************************************* 2 | File Name: IMInputTextEdit.h 3 | Author: jet.F.R 4 | Date: 2014.3.26 5 | Description: 输入编辑框 6 | Changes: 7 | ********************************************/ 8 | 9 | #ifndef IMINPUTTEXTEDIT_H 10 | #define IMINPUTTEXTEDIT_H 11 | 12 | #include 13 | 14 | class IMInputTextEdit : public QTextEdit 15 | { 16 | Q_OBJECT 17 | public: 18 | IMInputTextEdit(QWidget *parent=0); 19 | ~IMInputTextEdit(); 20 | 21 | protected: 22 | // 重载了keyPressEvent 23 | void keyPressEvent(QKeyEvent *event); 24 | 25 | signals: 26 | void sendMessage(); 27 | }; 28 | 29 | #endif // IMINPUTTEXTEDIT_H 30 | -------------------------------------------------------------------------------- /IMClient/view/IMLatestMessageListWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef IMLATESTMESSAGELISTWIDGET_H 2 | #define IMLATESTMESSAGELISTWIDGET_H 3 | 4 | #include 5 | 6 | class QVBoxLayout; 7 | class QScrollArea; 8 | class QMenu; 9 | class IMMainWidget; 10 | 11 | class IMLatestMessageListWidget : public QWidget 12 | { 13 | Q_OBJECT 14 | public: 15 | IMLatestMessageListWidget(IMMainWidget *mainWidget, QWidget *parent = 0); 16 | void addItem(QWidget *item); 17 | void removeItem(QWidget *item); 18 | int size(); 19 | //创建右键菜单 20 | void creatMenu(); 21 | 22 | signals: 23 | void timerStatus(bool isOpen); 24 | 25 | public slots: 26 | void showMenu(); 27 | protected: 28 | void mousePressEvent(QMouseEvent *e); 29 | 30 | private: 31 | QVBoxLayout *m_layout; 32 | QWidget *m_contentsWidget; 33 | QScrollArea *m_scrollArea; 34 | 35 | //右键菜单 36 | QMenu *m_menu; 37 | 38 | IMMainWidget *m_mainWidget; 39 | 40 | int m_mesCounter; 41 | }; 42 | 43 | #endif // IMLATESTMESSAGELISTWIDGET_H 44 | -------------------------------------------------------------------------------- /IMClient/view/IMLinkButton.cpp: -------------------------------------------------------------------------------- 1 | #include "IMLinkButton.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | IMLinkButton::IMLinkButton(QWidget *parent) : 9 | QPushButton(parent) 10 | { 11 | QHBoxLayout *mainLayout = new QHBoxLayout; 12 | m_labelHead = new QLabel; 13 | m_labelHead->setFixedSize(HEAD_SMALL_SIZE, HEAD_SMALL_SIZE); 14 | QVBoxLayout *rightLayout = new QVBoxLayout; 15 | rightLayout->setContentsMargins(0,0,0,0); 16 | m_labelInfo = new QLabel; 17 | m_labelMes = new QLabel; 18 | rightLayout->addWidget(m_labelInfo); 19 | rightLayout->addWidget(m_labelMes); 20 | 21 | mainLayout->addWidget(m_labelHead); 22 | mainLayout->addLayout(rightLayout); 23 | mainLayout->addStretch(); 24 | mainLayout->setContentsMargins(0,0,0,0); 25 | setLayout(mainLayout); 26 | setMinimumSize(100,40); 27 | 28 | m_menu = NULL; 29 | 30 | setStyleSheet("QPushButton{border: 0;}"); 31 | } 32 | 33 | /************************************************* 34 | Function Name: setLatestMessage() 35 | Description: 设置最新消息 36 | *************************************************/ 37 | void IMLinkButton::setLatestMessage(const TalkMessage & mes) 38 | { 39 | m_labelMes->setText(mes.m_text); 40 | } 41 | 42 | 43 | /************************************************* 44 | Function Name: onClickRightButton() 45 | Description: 右键 单击 46 | *************************************************/ 47 | void IMLinkButton::onClickRightButton(/*const QPoint &*/) 48 | { 49 | if (m_menu == NULL) 50 | { 51 | //创建右键菜单 52 | creatMenu(); 53 | } 54 | m_menu->exec(QCursor::pos()); 55 | } 56 | 57 | 58 | //remark:protected:---------------------------------------- 59 | 60 | /************************************************* 61 | Function Name: mousePressEvent 62 | Description: 鼠标单击事件 63 | *************************************************/ 64 | void IMLinkButton::mousePressEvent(QMouseEvent *event) 65 | { 66 | if (event->button() == Qt::RightButton) 67 | { 68 | onClickRightButton(); 69 | return; 70 | } 71 | QPushButton::mousePressEvent(event); 72 | } 73 | 74 | /************************************************* 75 | Function Name: mouseDoubleClickEvent 76 | Description: 鼠标双击事件 77 | *************************************************/ 78 | void IMLinkButton::mouseDoubleClickEvent(QMouseEvent *event) 79 | { 80 | if (event->button() == Qt::LeftButton) 81 | { 82 | // emit leftDoubleClickSignal(); 83 | onDoubleClickButton(); 84 | return; 85 | } 86 | QPushButton::mouseDoubleClickEvent(event); 87 | } 88 | 89 | 90 | 91 | //remark:private:---------------------------------------- 92 | 93 | /************************************************* 94 | Function Name: getStatusFromInt() 95 | Description: 创建右键菜单 96 | *************************************************/ 97 | void IMLinkButton::creatMenu(/*const QList *groutList*/) 98 | { 99 | m_menu = new QMenu(this); 100 | QAction *showMessage = new QAction(tr("查看消息"), m_menu); 101 | QAction *ignoreMessage = new QAction(tr("忽略消息"), m_menu); 102 | connect(showMessage, SIGNAL(triggered()), 103 | this, SLOT(onDoubleClickButton())); 104 | connect(ignoreMessage, SIGNAL(triggered()), 105 | this, SLOT(ignoreMessage())); 106 | 107 | m_menu->addAction(showMessage); 108 | m_menu->addAction(ignoreMessage); 109 | } 110 | -------------------------------------------------------------------------------- /IMClient/view/IMLinkButton.h: -------------------------------------------------------------------------------- 1 | #ifndef IMLINKBUTTON_H 2 | #define IMLINKBUTTON_H 3 | 4 | #include 5 | #include "model/IMConstant.h" 6 | class QLabel; 7 | 8 | class IMLinkButton : public QPushButton 9 | { 10 | Q_OBJECT 11 | public: 12 | IMLinkButton(QWidget *parent = 0); 13 | virtual ~IMLinkButton(){} 14 | 15 | void setLatestMessage(const TalkMessage & mes); 16 | 17 | // 设置button显示信息 18 | virtual void setButtonStatus() = 0; 19 | 20 | signals: 21 | void deleteLinkButton(const QString & id); 22 | 23 | 24 | public slots: 25 | // 左键 双击 26 | virtual void onDoubleClickButton() = 0; 27 | // 右键点击按键 28 | virtual void onClickRightButton(/*const QPoint &*/); 29 | // 忽略消息 30 | virtual void ignoreMessage() = 0; 31 | 32 | protected: 33 | void mousePressEvent(QMouseEvent *e); 34 | void mouseDoubleClickEvent(QMouseEvent *); 35 | 36 | protected: 37 | QLabel *m_labelHead; 38 | QLabel *m_labelInfo; 39 | QLabel *m_labelMes; 40 | 41 | // 右键菜单 42 | QMenu *m_menu; 43 | 44 | private: 45 | // 创建右键菜单 46 | void creatMenu(/*const QList *groutList*/); 47 | }; 48 | 49 | #endif // IMLINKBUTTON_H 50 | -------------------------------------------------------------------------------- /IMClient/view/IMLinkDiscussionButton.cpp: -------------------------------------------------------------------------------- 1 | #include "IMLinkDiscussionButton.h" 2 | #include 3 | #include "IMDiscussionButton.h" 4 | 5 | IMLinkDiscussionButton::IMLinkDiscussionButton( 6 | IMDiscussionButton * btn, QWidget *parent) : 7 | IMLinkButton(parent), m_discussionBtn(btn) 8 | { 9 | m_info = m_discussionBtn->getInformation(); 10 | 11 | setButtonStatus(); 12 | } 13 | 14 | 15 | IMLinkDiscussionButton::~IMLinkDiscussionButton() 16 | { 17 | } 18 | 19 | 20 | /************************************************* 21 | Function Name: setButtonStatus() 22 | Description: 设置button显示信息 23 | *************************************************/ 24 | void IMLinkDiscussionButton::setButtonStatus() 25 | { 26 | QString str = QString(":/images/discussion.png"); 27 | QPixmap pixmap; 28 | QIcon icon(str); 29 | pixmap = icon.pixmap(QSize(HEAD_SMALL_SIZE, HEAD_SMALL_SIZE)); 30 | m_labelHead->setPixmap(pixmap); 31 | 32 | QString text = QString("%1"). 33 | arg(m_info.m_discussionName); 34 | m_labelInfo->setText(text);; 35 | } 36 | 37 | 38 | //remark:public slots:--------------------------- 39 | 40 | /************************************************* 41 | Function Name: onDoubleClickFriendButton() 42 | Description: 左键 双击 43 | *************************************************/ 44 | void IMLinkDiscussionButton::onDoubleClickButton() 45 | { 46 | m_discussionBtn->openChatRoom(); 47 | m_discussionBtn->showChatRoom(); 48 | emit deleteLinkButton(m_info.m_discussionID); 49 | } 50 | 51 | 52 | 53 | /************************************************* 54 | Function Name: ignoreMessage() 55 | Description: 忽略消息 56 | *************************************************/ 57 | void IMLinkDiscussionButton::ignoreMessage() 58 | { 59 | emit deleteLinkButton(m_info.m_discussionID); 60 | } 61 | -------------------------------------------------------------------------------- /IMClient/view/IMLinkDiscussionButton.h: -------------------------------------------------------------------------------- 1 | #ifndef IMLINKDISCUSSIONBUTTON_H 2 | #define IMLINKDISCUSSIONBUTTON_H 3 | 4 | #include "IMLinkButton.h" 5 | #include "model/IMConstant.h" 6 | 7 | class QLabel; 8 | class IMDiscussionButton; 9 | 10 | class IMLinkDiscussionButton : public IMLinkButton 11 | { 12 | Q_OBJECT 13 | public: 14 | IMLinkDiscussionButton(IMDiscussionButton * btn, QWidget *parent = 0); 15 | ~IMLinkDiscussionButton(); 16 | 17 | // 设置button显示信息 18 | void setButtonStatus(); 19 | 20 | signals: 21 | 22 | public slots: 23 | // 左键 双击 24 | void onDoubleClickButton(); 25 | // 忽略消息 26 | void ignoreMessage(); 27 | 28 | private: 29 | IMDiscussionButton *m_discussionBtn; 30 | DiscussionInformation m_info; 31 | 32 | }; 33 | 34 | #endif // IMLINKDISCUSSIONBUTTON_H 35 | -------------------------------------------------------------------------------- /IMClient/view/IMLinkFlockButton.cpp: -------------------------------------------------------------------------------- 1 | #include "IMLinkFlockButton.h" 2 | #include "IMFlockButton.h" 3 | #include 4 | 5 | IMLinkFlockButton::IMLinkFlockButton(IMFlockButton *btn, QWidget *parent) : 6 | IMLinkButton(parent), m_flockBtn(btn) 7 | { 8 | m_info = m_flockBtn->getInformation(); 9 | 10 | setButtonStatus(); 11 | } 12 | 13 | IMLinkFlockButton::~IMLinkFlockButton() 14 | { 15 | } 16 | 17 | /************************************************* 18 | Function Name: setButtonStatus() 19 | Description: 设置button显示信息 20 | *************************************************/ 21 | void IMLinkFlockButton::setButtonStatus() 22 | { 23 | QString str = QString(":/images/flock.png"); 24 | QPixmap pixmap; 25 | QIcon icon(str); 26 | pixmap = icon.pixmap(QSize(HEAD_SMALL_SIZE, HEAD_SMALL_SIZE)); 27 | m_labelHead->setPixmap(pixmap); 28 | QString text = QString("%1"). 29 | arg(m_info.m_flockName); 30 | m_labelInfo->setText(text);; 31 | } 32 | 33 | 34 | //remark:public slots:--------------------------- 35 | 36 | /************************************************* 37 | Function Name: onDoubleClickFriendButton() 38 | Description: 左键 双击 39 | *************************************************/ 40 | void IMLinkFlockButton::onDoubleClickButton() 41 | { 42 | m_flockBtn->openChatRoom(); 43 | m_flockBtn->showChatRoom(); 44 | emit deleteLinkButton(m_info.m_flockID); 45 | } 46 | 47 | 48 | 49 | /************************************************* 50 | Function Name: ignoreMessage() 51 | Description: 忽略消息 52 | *************************************************/ 53 | void IMLinkFlockButton::ignoreMessage() 54 | { 55 | emit deleteLinkButton(m_info.m_flockID); 56 | } 57 | -------------------------------------------------------------------------------- /IMClient/view/IMLinkFlockButton.h: -------------------------------------------------------------------------------- 1 | #ifndef IMLINKFLOCKBUTTON_H 2 | #define IMLINKFLOCKBUTTON_H 3 | 4 | #include "IMLinkButton.h" 5 | #include "model/IMConstant.h" 6 | 7 | class QLabel; 8 | class IMFlockButton; 9 | 10 | class IMLinkFlockButton : public IMLinkButton 11 | { 12 | Q_OBJECT 13 | public: 14 | IMLinkFlockButton(IMFlockButton * btn, QWidget *parent = 0); 15 | ~IMLinkFlockButton(); 16 | 17 | // 设置button显示信息 18 | void setButtonStatus(); 19 | 20 | signals: 21 | 22 | public slots: 23 | // 左键 双击 24 | void onDoubleClickButton(); 25 | // 忽略消息 26 | void ignoreMessage(); 27 | 28 | private: 29 | IMFlockButton *m_flockBtn; 30 | FlockInformation m_info; 31 | 32 | }; 33 | 34 | #endif // IMLINKFLOCKBUTTON_H 35 | -------------------------------------------------------------------------------- /IMClient/view/IMLinkFriendButton.cpp: -------------------------------------------------------------------------------- 1 | #include "IMLinkFriendButton.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include "IMFriendButton.h" 8 | 9 | IMLinkFriendButton::IMLinkFriendButton(IMFriendButton *btn, QWidget *parent) : 10 | IMLinkButton(parent), m_friendBtn(btn) 11 | { 12 | m_info = m_friendBtn->getInformation(); 13 | 14 | setButtonStatus(); 15 | } 16 | 17 | 18 | IMLinkFriendButton::~IMLinkFriendButton() 19 | { 20 | } 21 | 22 | 23 | /************************************************* 24 | Function Name: setButtonStatus() 25 | Description: 设置button显示信息 26 | *************************************************/ 27 | void IMLinkFriendButton::setButtonStatus() 28 | { 29 | QString str = QString("resource/image/head/%1.bmp"). 30 | arg(QString::number(m_info.m_headPortrait)); 31 | QString text, mark; 32 | 33 | if(m_info.m_remarkName.isEmpty()) 34 | mark = m_info.m_nickname; 35 | else 36 | mark = m_info.m_remarkName; 37 | 38 | QPixmap pixmap; 39 | QIcon icon(str); 40 | pixmap = icon.pixmap(QSize(HEAD_SMALL_SIZE, HEAD_SMALL_SIZE)); 41 | m_labelHead->setPixmap(pixmap); 42 | 43 | text = QString("%1(%2)"). 44 | arg(m_info.m_userID).arg(mark); 45 | m_labelInfo->setText(text);; 46 | } 47 | 48 | 49 | //remark:public slots:--------------------------- 50 | 51 | /************************************************* 52 | Function Name: onDoubleClickFriendButton() 53 | Description: 左键 双击 54 | *************************************************/ 55 | void IMLinkFriendButton::onDoubleClickButton() 56 | { 57 | m_friendBtn->openChatRoom(); 58 | m_friendBtn->showChatRoom(); 59 | emit deleteLinkButton(m_info.m_userID); 60 | } 61 | 62 | 63 | 64 | /************************************************* 65 | Function Name: ignoreMessage() 66 | Description: 忽略消息 67 | *************************************************/ 68 | void IMLinkFriendButton::ignoreMessage() 69 | { 70 | emit deleteLinkButton(m_info.m_userID); 71 | } 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /IMClient/view/IMLinkFriendButton.h: -------------------------------------------------------------------------------- 1 | #ifndef IMLINKFRIENDBUTTON_H 2 | #define IMLINKFRIENDBUTTON_H 3 | 4 | #include 5 | #include "IMLinkButton.h" 6 | #include "model/IMConstant.h" 7 | 8 | class QLabel; 9 | class IMFriendButton; 10 | 11 | class IMLinkFriendButton : public IMLinkButton 12 | { 13 | Q_OBJECT 14 | public: 15 | IMLinkFriendButton(IMFriendButton * btn, QWidget *parent = 0); 16 | ~IMLinkFriendButton(); 17 | 18 | 19 | // 设置button显示信息 20 | void setButtonStatus(); 21 | 22 | public slots: 23 | // 左键 双击 24 | void onDoubleClickButton(); 25 | // 忽略消息 26 | void ignoreMessage(); 27 | 28 | 29 | private: 30 | IMFriendButton * m_friendBtn; 31 | FriendInformation m_info; 32 | 33 | }; 34 | 35 | #endif // IMLinkFriendButton_H 36 | -------------------------------------------------------------------------------- /IMClient/view/IMLittleWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef IMLITTLEWIDGET_H 2 | #define IMLITTLEWIDGET_H 3 | 4 | #include 5 | 6 | class QLabel; 7 | class QLineEdit; 8 | class QPushButton; 9 | struct TempStrings; 10 | 11 | class IMLittleWidget : public QWidget 12 | { 13 | Q_OBJECT 14 | public: 15 | IMLittleWidget(int num, QWidget *parent = 0); 16 | virtual ~IMLittleWidget() = 0; 17 | 18 | // 设置各编辑框的标题栏 19 | void setLabelsText(const QString & first = "", 20 | const QString & second = "", 21 | const QString & third = ""); 22 | // 获取用户输入的信息 23 | TempStrings getInputInformation() const; 24 | // 将用户输入的信息设置为密码风格 25 | void setPasswordStyle(); 26 | // 将所有输入框设置可用属性 27 | void setAllEnabled(bool enable); 28 | signals: 29 | 30 | public slots: 31 | virtual void onClickedBtnOk() = 0; 32 | void onClickedBtnClose(); 33 | private: 34 | int m_numOfLineEdit; // 输入栏的个数 35 | QLabel *m_labelFirst; 36 | QLabel *m_labelSecond; 37 | QLabel *m_labelThird; 38 | QLineEdit *m_leFirst; 39 | QLineEdit *m_leSecond; 40 | QLineEdit *m_leThird; 41 | QPushButton *m_btnOk; 42 | QPushButton *m_btnClose; 43 | }; 44 | 45 | #endif // IMLITTLEWIDGET_H 46 | -------------------------------------------------------------------------------- /IMClient/view/IMLocalMessageWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef IMLOCALMESSAGEWIDGET_H 2 | #define IMLOCALMESSAGEWIDGET_H 3 | 4 | #include 5 | #include "IMMessageWidget.h" 6 | 7 | class IMMainWidget; 8 | 9 | class IMLocalMessageWidget : public IMMessageWidget 10 | { 11 | Q_OBJECT 12 | public: 13 | IMLocalMessageWidget(IMMainWidget *, QWidget *parent = 0); 14 | ~IMLocalMessageWidget(); 15 | 16 | signals: 17 | 18 | public slots: 19 | // 删除某日的信息记录 20 | void onClickDeleteDate(); 21 | // 删除某好友信息记录 22 | void onClickDeleteOne(); 23 | // 删除全部消息记录 24 | void onClickDeleteAll(); 25 | // 导人消息记录 26 | void onClickImport(); 27 | // 导出当前好友消息记录 28 | void onClickExportOne(); 29 | // 导出所有消息记录 30 | void onClickExportAll(); 31 | // 获取消息记录 32 | void onClickGetMessage(); 33 | // // 单击好友列表项 34 | // void friendItemClicked(const QModelIndex &); 35 | 36 | private: 37 | IMMainWidget * m_mainWidget; 38 | }; 39 | 40 | #endif // IMLOCALMESSAGEWIDGET_H 41 | -------------------------------------------------------------------------------- /IMClient/view/IMLoginWidget.h: -------------------------------------------------------------------------------- 1 | /********************************************* 2 | File Name: IMLoginWidget.h 3 | Author: jet.F.R 4 | Date: 2014.3.10 5 | Description: 客户端登录界面 6 | Changes: 7 | ********************************************/ 8 | 9 | #ifndef IMLOGINWIDGET_H 10 | #define IMLOGINWIDGET_H 11 | 12 | #include 13 | 14 | class QPushButton; 15 | class QLabel; 16 | class QLineEdit; 17 | class QCheckBox; 18 | class QComboBox; 19 | class IMClickLabel; 20 | class IMLoginCtrl; 21 | struct UserInformation; 22 | 23 | /************************************************* 24 | Class Name: IMLoginWidget 25 | Description: 客户端登录界面类 26 | *************************************************/ 27 | class IMLoginWidget : public QWidget 28 | { 29 | Q_OBJECT 30 | 31 | public: 32 | IMLoginWidget(QWidget *parent = 0); 33 | ~IMLoginWidget(); 34 | signals: 35 | 36 | public slots: 37 | // 显示主界面 38 | void showMainWidget(); 39 | // 设置状态标签 40 | void setLabelStatus(const QString &mes, bool isLogin, 41 | const UserInformation *me = 0); 42 | // 获取m_isAutoLogin 43 | bool getIsAutoLogin(); 44 | // 单击“登录”按钮 45 | void onClickBtnLogin(); 46 | 47 | protected: 48 | // 处理定时器事件 49 | void timerEvent(QTimerEvent * event); 50 | private slots: 51 | // 单击"注册帐号"标签 52 | void onClickLabelRegister(); 53 | // 单击“忘记密码"标签 54 | void onClickLabelForgotPwd(); 55 | // 自动登录选择框改变 56 | void onClickCbAutoLogin(int state); 57 | private: 58 | // 初始化登录界面 59 | void initIMLoginWidget(); 60 | // 连接信号与槽 61 | void linkSignalWithSlot(); 62 | // 关闭定时器 63 | void closeTimer(); 64 | // 设置服务器信息 65 | void setServer(const QString &ip = "127.0.0.1", const int port = 1234); 66 | // 读取自动登录配置文件 67 | bool readAutoLoginFile(const QString &); 68 | 69 | private: 70 | QLineEdit *m_leUserID; // id 71 | QLineEdit *m_leUserPwd; // 密码 72 | IMClickLabel *m_labelRegister; // 注册帐号 73 | IMClickLabel *m_labelForgotPwd; // 忘记密码 74 | QCheckBox *m_cbKeepPwd; // 记住密码 75 | QCheckBox *m_cbAutoLogin; // 自动登录 76 | QComboBox *m_cbxStatus; // 登录状态 77 | QPushButton *m_btnLogin; // 登录按钮 78 | 79 | QPushButton *m_moreButton;// 拓展按钮 80 | QWidget *m_extendedWidget;// 拓展界面 81 | QLineEdit *m_hostAddress; // 服务器ip地址 82 | QLineEdit *m_hostPort; // 服务器端口 83 | 84 | QLabel *m_labelStatus; // 状态标签 85 | bool m_isLogin; // 是否能登录 86 | IMLoginCtrl *m_loginCtrl; // 用于控制登录 87 | 88 | int m_timerID; // 定时器ID 89 | bool m_closeTimer; // 定时器是否关闭 90 | int m_counter; // 计数器 91 | bool m_isAutoLogin; // 是否自动登录 92 | 93 | int m_status; 94 | }; 95 | 96 | #endif // IMLOGINWIDGET_H 97 | -------------------------------------------------------------------------------- /IMClient/view/IMMailButton.h: -------------------------------------------------------------------------------- 1 | #ifndef IMMAILBUTTON_H 2 | #define IMMAILBUTTON_H 3 | 4 | #include 5 | #include "model/IMConstant.h" 6 | 7 | class QCheckBox; 8 | class QLabel; 9 | class IMMailWidget; 10 | class IMMailCtrl; 11 | 12 | class IMMailButton : public QPushButton 13 | { 14 | Q_OBJECT 15 | public: 16 | IMMailButton(const MailInformation &, IMMailWidget *, QWidget *parent = 0); 17 | 18 | protected: 19 | void mousePressEvent(QMouseEvent *e); 20 | void mouseDoubleClickEvent(QMouseEvent *); 21 | 22 | signals: 23 | 24 | public slots: 25 | 26 | private slots: 27 | // 点击删除邮件 28 | void onClickDeleteMail(); 29 | // 左键 双击 30 | void onDoubleClickDiscussionButton(); 31 | // 右键点击按键 32 | void onClickRightButton(); 33 | 34 | private: 35 | // 设置button显示信息 36 | void setButtonStatus(); 37 | // 创建右键菜单 38 | void creatMenu(); 39 | 40 | private: 41 | // QCheckBox m_cbSelected; 42 | QLabel *m_labelStatus; 43 | QLabel *m_labelSender; 44 | QLabel *m_labelTheme; 45 | QLabel *m_labelTime; 46 | QMenu *m_menu; 47 | IMMailWidget *m_mailWidget; 48 | IMMailCtrl *m_mailCtrl; 49 | MailInformation m_mail; 50 | }; 51 | 52 | #endif // IMMAILBUTTON_H 53 | -------------------------------------------------------------------------------- /IMClient/view/IMMailInWidget.cpp: -------------------------------------------------------------------------------- 1 | #include "IMMailInWidget.h" 2 | 3 | IMMailInWidget::IMMailInWidget(IMMailCtrl * ctrl, QWidget *parent) : 4 | m_mailCtrl(ctrl), IMMailListWidget(parent) 5 | { 6 | } 7 | -------------------------------------------------------------------------------- /IMClient/view/IMMailInWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef IMMAILINWIDGET_H 2 | #define IMMAILINWIDGET_H 3 | 4 | //#include 5 | #include "IMMailListWidget.h" 6 | 7 | class IMMailCtrl; 8 | 9 | class IMMailInWidget : public IMMailListWidget 10 | { 11 | Q_OBJECT 12 | public: 13 | IMMailInWidget(IMMailCtrl *, QWidget *parent = 0); 14 | 15 | signals: 16 | 17 | public slots: 18 | 19 | private: 20 | 21 | private: 22 | IMMailCtrl *m_mailCtrl; 23 | 24 | }; 25 | 26 | #endif // IMMAILINWIDGET_H 27 | -------------------------------------------------------------------------------- /IMClient/view/IMMailInformationWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef IMMAILINFORMATIONWIDGET_H 2 | #define IMMAILINFORMATIONWIDGET_H 3 | 4 | #include 5 | #include "model/IMConstant.h" 6 | 7 | class QLineEdit; 8 | class QLabel; 9 | class QPushButton; 10 | class QTextCharFormat; 11 | class QTextEdit; 12 | class IMMailCtrl; 13 | class IMMailWidget; 14 | class QTextBrowser; 15 | class QTextEdit; 16 | 17 | 18 | class IMMailInformationWidget : public QWidget 19 | { 20 | Q_OBJECT 21 | public: 22 | IMMailInformationWidget(IMMailWidget *, QWidget *parent = 0); 23 | void setMailInformation(const MailInformation &); 24 | 25 | signals: 26 | 27 | private slots: 28 | // 删除 29 | void onClickBtnDelete(); 30 | // 关闭 31 | void onClickBtnClose(); 32 | private: 33 | void initIMMailInformationWidget(); 34 | void linkSignalWithSlot(); 35 | private: 36 | QLabel *m_labelSenderAddress; 37 | QLabel *m_labelReceiverAddress; 38 | QLabel *m_labelTheme; 39 | QLabel *m_labelTime; 40 | QTextBrowser *m_textContnet; 41 | // QTextEdit *m_textInput; 42 | 43 | QPushButton *m_btnDelete; 44 | QPushButton *m_btnClose; 45 | 46 | MailInformation m_mail; 47 | 48 | IMMailWidget *m_mailWidget; 49 | IMMailCtrl *m_mailCtrl; 50 | 51 | }; 52 | 53 | #endif // IMMAILINFORMATIONWIDGET_H 54 | -------------------------------------------------------------------------------- /IMClient/view/IMMailListWidget.cpp: -------------------------------------------------------------------------------- 1 | #include "IMMailListWidget.h" 2 | #include 3 | #include 4 | 5 | IMMailListWidget::IMMailListWidget(QWidget *parent) : 6 | QWidget(parent), m_layout(new QVBoxLayout) 7 | { 8 | QVBoxLayout *mainLayout=new QVBoxLayout(); 9 | mainLayout->setContentsMargins(0,0,0,0); 10 | mainLayout->setSpacing(0); 11 | 12 | m_contentsWidget = new QWidget; 13 | m_layout->setContentsMargins(0,0,0,0); 14 | m_layout->setSpacing(0); 15 | m_contentsWidget->setLayout(m_layout); 16 | m_contentsWidget->setStyleSheet("QWidget{border: 0;}"); 17 | 18 | m_flocksScrollArea = new QScrollArea(this); 19 | m_flocksScrollArea->setWidgetResizable(true); 20 | m_flocksScrollArea->setAlignment(Qt::AlignLeft); 21 | 22 | m_flocksScrollArea->setWidget(m_contentsWidget); 23 | 24 | mainLayout->addWidget(m_flocksScrollArea); 25 | setLayout(mainLayout); 26 | 27 | setStyleSheet("QWidget{border: 0;}"); 28 | } 29 | 30 | /************************************************* 31 | Function Name: addItem() 32 | Description: 添加 33 | *************************************************/ 34 | void IMMailListWidget::addItem(QWidget *item) 35 | { 36 | // Remove last spacer item if present. 37 | int count = m_layout->count(); 38 | if (count > 1) 39 | { 40 | m_layout->removeItem(m_layout->itemAt(count - 1)); 41 | } 42 | 43 | // Add item and make sure it stretches the remaining space. 44 | m_layout->addWidget(item); 45 | m_layout->addStretch(); 46 | } 47 | 48 | /************************************************* 49 | Function Name: removeItem() 50 | Description: 删除 51 | *************************************************/ 52 | void IMMailListWidget::removeItem(QWidget *item) 53 | { 54 | m_layout->removeWidget(item); 55 | if (m_layout->count() == 1) 56 | { 57 | m_layout->removeItem(m_layout->itemAt(0)); 58 | } 59 | } 60 | 61 | 62 | /************************************************* 63 | Function Name: insertItem() 64 | Description: 插入 65 | *************************************************/ 66 | void IMMailListWidget::insertItem(int index, QWidget * widget) 67 | { 68 | m_layout->insertWidget(index, widget); 69 | if (m_layout->count() == 1) 70 | { 71 | m_layout->addStretch(); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /IMClient/view/IMMailListWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef IMMAILLISTWIDGET_H 2 | #define IMMAILLISTWIDGET_H 3 | 4 | #include 5 | 6 | class QVBoxLayout; 7 | class QScrollArea; 8 | 9 | class IMMailListWidget : public QWidget 10 | { 11 | Q_OBJECT 12 | public: 13 | IMMailListWidget(QWidget *parent = 0); 14 | void addItem(QWidget *item); 15 | void removeItem(QWidget *item); 16 | void insertItem(int index, QWidget * widget); 17 | 18 | //创建右键菜单 19 | // void creatMenu(); 20 | signals: 21 | 22 | public slots: 23 | 24 | private: 25 | QVBoxLayout *m_layout; 26 | QWidget *m_contentsWidget; 27 | QScrollArea *m_flocksScrollArea; 28 | }; 29 | 30 | #endif // IMMAILLISTWIDGET_H 31 | -------------------------------------------------------------------------------- /IMClient/view/IMMailOutWidget.cpp: -------------------------------------------------------------------------------- 1 | #include "IMMailOutWidget.h" 2 | 3 | IMMailOutWidget::IMMailOutWidget(IMMailCtrl * ctrl, QWidget *parent) : 4 | m_mailCtrl(ctrl), IMMailListWidget(parent) 5 | { 6 | } 7 | -------------------------------------------------------------------------------- /IMClient/view/IMMailOutWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef IMMAILOUTWIDGET_H 2 | #define IMMAILOUTWIDGET_H 3 | 4 | #include "IMMailListWidget.h" 5 | class IMMailCtrl; 6 | 7 | class IMMailOutWidget : public IMMailListWidget 8 | { 9 | Q_OBJECT 10 | public: 11 | IMMailOutWidget(IMMailCtrl *, QWidget *parent = 0); 12 | 13 | signals: 14 | 15 | public slots: 16 | 17 | private: 18 | 19 | private: 20 | IMMailCtrl *m_mailCtrl; 21 | 22 | }; 23 | 24 | #endif // IMMAILOUTWIDGET_H 25 | -------------------------------------------------------------------------------- /IMClient/view/IMMailWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef IMMAILWIDGET_H 2 | #define IMMAILWIDGET_H 3 | 4 | #include 5 | #include 6 | #include "model/IMConstant.h" 7 | 8 | class QPushButton; 9 | class QTabWidget; 10 | class IMMailButton; 11 | class IMMailOutWidget; 12 | class IMMailInWidget; 13 | class IMMailWriteWidget; 14 | class QLabel; 15 | class IMMailCtrl; 16 | class IMMailInformationWidget; 17 | 18 | class IMMailWidget : public QWidget 19 | { 20 | Q_OBJECT 21 | public: 22 | IMMailWidget(const QString & myID, QWidget *parent = 0); 23 | ~IMMailWidget(); 24 | 25 | IMMailCtrl* getMailCtrl(); 26 | QString getMyID(); 27 | void showMailInformationWidget(const MailInformation & mail); 28 | void showMailInWidget(); 29 | void showMailWriteWidget(const QString & address); 30 | 31 | signals: 32 | 33 | public slots: 34 | 35 | private slots: 36 | // 设置收件箱 37 | void setInMailsWidget(const QVector &); 38 | // 设置发件箱 39 | void setOutMailsWidget(const QVector &); 40 | 41 | // 添加收件箱按钮 42 | bool addInMailButton(const MailInformation &); 43 | // 添加发件箱按钮 44 | bool addOutMailButton(const MailInformation &); 45 | // 删除邮件按钮 46 | void deleteMail(const int &); 47 | 48 | // 添加新邮件到发件箱 49 | bool addNewOutMailButton(const MailInformation &); 50 | // 添加新邮件到收件箱 51 | bool addNewInMailButton(const MailInformation &); 52 | 53 | private: 54 | void initIMMailWidget(); 55 | void linkSignalWithSlot(); 56 | void clearContainers(); 57 | 58 | private: 59 | // QPushButton *m_btnWrite; // 写信 60 | // QPushButton *m_btnIn; // 收件箱 61 | // QPushButton *m_btnOut; // 已发送 62 | // QPushButton *m_btnDrafts; // 草稿箱 63 | // QPushButton *m_btnTrash; // 垃圾箱 64 | 65 | QString m_myID; 66 | 67 | QLabel *m_labelInformation; 68 | QTabWidget *m_tabWidget; 69 | IMMailOutWidget *m_outWidget; 70 | IMMailInWidget *m_inWidget; 71 | IMMailWriteWidget *m_writeWidget; 72 | IMMailInformationWidget *m_informationWidget; 73 | 74 | IMMailCtrl *m_mailCtrl; 75 | 76 | QMap m_inMailMap; 77 | QMap m_outMailMap; 78 | }; 79 | 80 | #endif // IMMAILWIDGET_H 81 | -------------------------------------------------------------------------------- /IMClient/view/IMMailWriteWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef IMMAILWRITEWIDGET_H 2 | #define IMMAILWRITEWIDGET_H 3 | 4 | #include 5 | #include "model/IMConstant.h" 6 | 7 | class QLineEdit; 8 | class QComboBox; 9 | class QFontComboBox; 10 | class QLabel; 11 | class QPushButton; 12 | class QToolButton; 13 | class QTextCharFormat; 14 | class QTextEdit; 15 | class IMMailCtrl; 16 | 17 | class IMMailWriteWidget : public QWidget 18 | { 19 | Q_OBJECT 20 | public: 21 | IMMailWriteWidget(QString, IMMailCtrl *, QWidget *parent = 0); 22 | 23 | void setReceiverAddress(const QString & address); 24 | 25 | signals: 26 | 27 | public slots: 28 | 29 | private slots: 30 | // 字体样式 31 | void setInputTextFont(const QFont &font); 32 | // 字体大小 33 | void setInputTextSize(const QString & size); 34 | // 加粗 35 | void onClickBtnBold(bool checked); 36 | // 斜体 37 | void onClickBtnItalic(bool checked); 38 | // 下划线 39 | void onClickBtnUnderline(bool checked); 40 | // 颜色 41 | void onClickBtnColor(); 42 | // 发送聊天信息 43 | void onClickBtnSend(); 44 | 45 | private: 46 | void initIMMailWriteWidget(); 47 | void linkSignalWithSlot(); 48 | void setWidgetToolBtn(); 49 | // 获取信息输入框的信息 50 | void getMailInformation(); 51 | 52 | private: 53 | QLineEdit *m_leReceiverAddress; 54 | QLineEdit *m_leTheme; 55 | QTextEdit *m_textInput; 56 | 57 | QFontComboBox *m_cbFont; // 字体样式选择框 58 | QComboBox *m_cbSize; // 字体大小选择框 59 | QToolButton *m_toolBtnBold; // 加粗 60 | QToolButton *m_toolBtnItalic; // 斜体 61 | QToolButton *m_toolBtnUnderline; // 下划线 62 | QToolButton *m_toolBtnColor; // 颜色 63 | 64 | QPushButton *m_btnSend; 65 | 66 | MailInformation m_mail; 67 | QString m_myID; 68 | IMMailCtrl *m_mailCtrl; 69 | }; 70 | 71 | #endif // IMMAILWRITEWIDGET_H 72 | -------------------------------------------------------------------------------- /IMClient/view/IMMessageManageWidget.cpp: -------------------------------------------------------------------------------- 1 | #include "IMMessageManageWidget.h" 2 | #include 3 | #include "IMLocalMessageWidget.h" 4 | #include "IMNetWorkMessageWidget.h" 5 | #include 6 | 7 | IMMessageManageWidget::IMMessageManageWidget(IMMainWidget *mainWidget, 8 | QWidget *parent) : 9 | QWidget(parent), m_mainWidget(mainWidget) 10 | { 11 | if (m_mainWidget == NULL) 12 | { 13 | return; 14 | } 15 | m_tabWidget= new QTabWidget(this); 16 | m_localWidget = new IMLocalMessageWidget(m_mainWidget, this); 17 | m_networkWidget = new IMNetWorkMessageWidget(m_mainWidget, this); 18 | setWindowTitle(tr("消息管理")); 19 | m_tabWidget->addTab(m_localWidget, tr("本地消息")); 20 | m_tabWidget->addTab(m_networkWidget, tr("网络消息")); 21 | 22 | QVBoxLayout *mainLayout = new QVBoxLayout; 23 | mainLayout->addWidget(m_tabWidget); 24 | mainLayout->setContentsMargins(0, 0, 0, 0); 25 | setLayout(mainLayout); 26 | 27 | // connect(m_localWidget, SIGNAL(currentIndexClicked(int)), 28 | // this, SLOT()); 29 | // connect(m_networkWidget, SIGNAL(currentIndexClicked(int)), 30 | // this, SLOT()); 31 | } 32 | 33 | 34 | IMMessageManageWidget::~IMMessageManageWidget() 35 | { 36 | } 37 | 38 | 39 | void IMMessageManageWidget::setLocalMessageWidget(const QVector & mesVec) 40 | { 41 | m_localWidget->setMessageShow(mesVec); 42 | } 43 | 44 | void IMMessageManageWidget::setNetworkMessageWidget(const QVector & mesVec) 45 | { 46 | m_networkWidget->setMessageShow(mesVec); 47 | } 48 | 49 | 50 | void IMMessageManageWidget::setListModelGroup() 51 | { 52 | m_localWidget->setListModelGroup(); 53 | m_networkWidget->setListModelGroup(); 54 | } 55 | -------------------------------------------------------------------------------- /IMClient/view/IMMessageManageWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef IMMESSAGEMANAGEWIDGET_H 2 | #define IMMESSAGEMANAGEWIDGET_H 3 | 4 | #include 5 | #include "model/IMConstant.h" 6 | class IMMainWidget; 7 | class QTabWidget; 8 | class IMLocalMessageWidget; 9 | class IMNetWorkMessageWidget; 10 | 11 | class IMMessageManageWidget : public QWidget 12 | { 13 | Q_OBJECT 14 | public: 15 | IMMessageManageWidget(IMMainWidget *, QWidget *parent = 0); 16 | ~IMMessageManageWidget(); 17 | 18 | void setLocalMessageWidget(const QVector &mesVec); 19 | void setNetworkMessageWidget(const QVector &mesVec); 20 | 21 | void setListModelGroup(); 22 | 23 | signals: 24 | 25 | public slots: 26 | 27 | private: 28 | IMMainWidget * m_mainWidget; 29 | QTabWidget *m_tabWidget; 30 | IMLocalMessageWidget *m_localWidget; 31 | IMNetWorkMessageWidget *m_networkWidget; 32 | 33 | }; 34 | 35 | #endif // IMMESSAGEMANAGEWIDGET_H 36 | -------------------------------------------------------------------------------- /IMClient/view/IMMessageWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef IMMESSAGEWIDGET_H 2 | #define IMMESSAGEWIDGET_H 3 | 4 | #include 5 | #include "model/IMConstant.h" 6 | 7 | class QLabel; 8 | class QToolButton; 9 | class QPixmap; 10 | class QListView; 11 | class CustomLineEdit; 12 | class QTextBrowser; 13 | class QTextCharFormat; 14 | class QStringListModel; 15 | class IMMainWidget; 16 | class QModelIndex; 17 | 18 | class IMMessageWidget : public QWidget 19 | { 20 | Q_OBJECT 21 | public: 22 | IMMessageWidget(IMMainWidget *, QWidget *parent = 0); 23 | 24 | virtual ~IMMessageWidget(); 25 | 26 | // 设置 分组 的model 27 | void setListModelGroup(const QStringList & groupList); 28 | void setListModelGroup(); 29 | 30 | // 设置 好友 的model 31 | void setListModelFriend(const QStringList & friendList); 32 | void setListModelFriend(const QString & groupName); 33 | 34 | enum Mode{ LOCAL, NETWORK}; 35 | // 设置模式 36 | void setShowMode(Mode mode); 37 | 38 | void setMessageShow(const QVector & mesVec); 39 | 40 | signals: 41 | void currentIndexClicked(int); 42 | public slots: 43 | // 删除某日的信息记录 44 | virtual void onClickDeleteDate() = 0; 45 | // 删除某好友信息记录 46 | virtual void onClickDeleteOne() = 0; 47 | // 删除全部消息记录 48 | virtual void onClickDeleteAll() = 0; 49 | // 导人消息记录 50 | virtual void onClickImport(){} 51 | // 导出某好友消息记录 52 | virtual void onClickExportOne() = 0; 53 | // 导出所有消息记录 54 | virtual void onClickExportAll() = 0; 55 | // 获取消息记录 56 | virtual void onClickGetMessage() = 0; 57 | 58 | // 单击 组列表 59 | void groupItemClicked(const QModelIndex &); 60 | // 单击 好友列表 61 | void friendItemClicked(const QModelIndex &); 62 | // virtual void friendItemClicked(const QModelIndex &) = 0; 63 | 64 | protected: 65 | int m_indexOfFriendList; 66 | QString m_name; 67 | QDate m_date; 68 | CustomLineEdit *m_leBirthday; 69 | QListView *m_listViewGroup; 70 | QListView *m_listViewFriend; 71 | QTextBrowser *m_tbMessageShow; 72 | 73 | private: 74 | // 初始化 75 | void initIMMessageWidget(); 76 | // 链接信号与槽 77 | void linkSignalWithSlot(); 78 | 79 | private: 80 | IMMainWidget * m_mainWidget; 81 | 82 | QStringList m_groupList; 83 | QStringList m_friendList; 84 | 85 | QStringListModel *m_modelGroup; 86 | QStringListModel *m_modelFriend; 87 | 88 | 89 | QLabel *m_labelInformation; 90 | // QToolButton *m_toolBtnDeleteDate; 91 | QToolButton *m_toolBtnDeleteOne; 92 | QToolButton *m_toolBtnDeleteAll; 93 | QToolButton *m_tooBtnImport; 94 | QToolButton *m_toolBtnExportOne; 95 | QToolButton *m_toolBtnExportAll; 96 | QToolButton *m_toolBtnGetMessage; 97 | }; 98 | 99 | #endif // IMMESSAGEWIDGET_H 100 | -------------------------------------------------------------------------------- /IMClient/view/IMNetWorkMessageWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef IMNETWORKMESSAGEWIDGET_H 2 | #define IMNETWORKMESSAGEWIDGET_H 3 | 4 | #include "IMMessageWidget.h" 5 | 6 | class IMMainWidget; 7 | 8 | class IMNetWorkMessageWidget : public IMMessageWidget 9 | { 10 | Q_OBJECT 11 | public: 12 | IMNetWorkMessageWidget(IMMainWidget *, QWidget *parent = 0); 13 | ~IMNetWorkMessageWidget(); 14 | 15 | signals: 16 | 17 | public slots: 18 | // 删除某日的信息记录 19 | void onClickDeleteDate(); 20 | // 删除某好友信息记录 21 | void onClickDeleteOne(); 22 | // 删除全部消息记录 23 | void onClickDeleteAll(); 24 | // 导出某好友消息记录 25 | void onClickExportOne(); 26 | // 导出所有消息记录 27 | void onClickExportAll(); 28 | // 获取消息记录 29 | void onClickGetMessage(); 30 | // // 单击好友列表项 31 | // void friendItemClicked(const QModelIndex & index); 32 | private: 33 | IMMainWidget * m_mainWidget; 34 | }; 35 | 36 | #endif // IMNETWORKMESSAGEWIDGET_H 37 | -------------------------------------------------------------------------------- /IMClient/view/IMRegisterWidget.h: -------------------------------------------------------------------------------- 1 | /********************************************* 2 | File Name: IMRegisterWidget.h 3 | Author: jet.F.R 4 | Date: 2014.3.14 5 | Description: 客户端注册界面 6 | Changes: 7 | ********************************************/ 8 | #ifndef IMREGISTERWIDGET_H 9 | #define IMREGISTERWIDGET_H 10 | 11 | #include 12 | #include "model/IMConstant.h" 13 | class QPushButton; 14 | class QLabel; 15 | class QLineEdit; 16 | class QCheckBox; 17 | class QComboBox; 18 | class IMRegisterCtrl; 19 | class CustomLineEdit; 20 | 21 | /************************************************* 22 | Class Name: IMRegisterWidget 23 | Description: 客户端注册帐号界面类 24 | *************************************************/ 25 | class IMRegisterWidget : public QWidget 26 | { 27 | Q_OBJECT 28 | public: 29 | explicit IMRegisterWidget(QWidget *parent = 0); 30 | ~IMRegisterWidget(); 31 | 32 | signals: 33 | 34 | public slots: 35 | void resetBtnRegister(bool ); // 重置注册按钮 36 | 37 | protected: 38 | void moveEvent(QMoveEvent *); // 窗口移动事件 39 | 40 | private slots: 41 | void onClickBtnRegister(); // 单击“注册”按钮 42 | void conClickBtnCancel(); // 单击“取消”按钮 43 | 44 | private: 45 | // 初始化注册界面 46 | void initIMRegisterWidget(); 47 | // 连接信号与槽 48 | void linkSignalWithSlot(); 49 | 50 | 51 | private: 52 | QLabel *m_labelHead; 53 | 54 | // QLabel *m_labelUserID; // 用户帐号 55 | // QLineEdit *m_leUserID; 56 | // QLabel *m_labelDesUserID; 57 | QLabel *m_labelNickname; // 用户昵称 58 | QLineEdit *m_leNickname; 59 | QLabel *m_labelDesNickname;// 昵称描述 60 | QLabel *m_labelPwd; // 用户密码 61 | QLineEdit *m_lePwd; 62 | QLabel *m_labelDesPwd; 63 | QLabel *m_labelConfirmPwd; // 确认密码 64 | QLineEdit *m_leConfirmPwd; 65 | QLabel *m_labelDesConfirmPwd; 66 | QLabel *m_labelSex; // 性别 67 | QComboBox *m_cbxSex; 68 | QLabel *m_labelDesSex; 69 | QLabel *m_labelBirthday; // 生日 70 | CustomLineEdit *m_leBirthday; 71 | QLabel *m_labelDesBirthday; 72 | QLabel *m_labelQuestion; // 密保问题 73 | QLineEdit *m_leQuestion; 74 | QLabel *m_labelDesQuestion; 75 | QLabel *m_labelAnswer; // 问题答案 76 | QLineEdit *m_leAnswer; 77 | QLabel *m_labelDesAnswer; 78 | QLabel *m_labelName; // 真实姓名 79 | QLineEdit *m_leName; 80 | QLabel *m_labelDesName; 81 | QLabel *m_labelPhone; // 电话 82 | QLineEdit *m_lePhone; 83 | QLabel *m_labelDesPhone; 84 | QLabel *m_labelAddress; // 地址 85 | QLineEdit *m_leAddress; 86 | QLabel *m_labelDesAddress; 87 | 88 | QPushButton *m_btnRegister;// "注册" 按钮 89 | QPushButton *m_btnCancel; // "取消" 按钮 90 | 91 | IMRegisterCtrl * m_regCtrl; 92 | 93 | UserInformation m_userInf; 94 | }; 95 | 96 | #endif // IMREGISTERWIDGET_H 97 | -------------------------------------------------------------------------------- /IMClient/view/IMSearchListWidget.cpp: -------------------------------------------------------------------------------- 1 | #include "IMSearchListWidget.h" 2 | #include 3 | #include 4 | #include 5 | #include "IMMainWidget.h" 6 | #include 7 | #include 8 | 9 | IMSearchListWidget::IMSearchListWidget(QWidget *parent) : 10 | QWidget(parent), m_layout(new QVBoxLayout) 11 | { 12 | if (NULL == m_mainWidget) 13 | return; 14 | QVBoxLayout *mainLayout=new QVBoxLayout(); 15 | mainLayout->setContentsMargins(0,0,0,0); 16 | mainLayout->setSpacing(0); 17 | 18 | m_contentsWidget = new QWidget; 19 | m_layout->setContentsMargins(0,0,0,0); 20 | m_layout->setSpacing(0); 21 | m_contentsWidget->setLayout(m_layout); 22 | m_contentsWidget->setStyleSheet("QWidget{border: 0;}"); 23 | 24 | m_scrollArea = new QScrollArea(this); 25 | m_scrollArea->setWidgetResizable(true); 26 | m_scrollArea->setAlignment(Qt::AlignLeft); 27 | 28 | m_scrollArea->setWidget(m_contentsWidget); 29 | 30 | mainLayout->addWidget(m_scrollArea); 31 | setLayout(mainLayout); 32 | 33 | // setStyleSheet("QWidget{border: 0;}"); 34 | } 35 | 36 | 37 | /************************************************* 38 | Function Name: addItem() 39 | Description: 添加 40 | *************************************************/ 41 | void IMSearchListWidget::addItem(QWidget *item) 42 | { 43 | // Remove last spacer item if present. 44 | int count = m_layout->count(); 45 | // if (count == 0) 46 | // { 47 | // delete m_layout; 48 | // m_layout = new QVBoxLayout(); 49 | // m_layout->setContentsMargins(0,0,0,0); 50 | // m_layout->setSpacing(0); 51 | // m_contentsWidget->setLayout(m_layout); 52 | // } 53 | if (count > 1) 54 | { 55 | m_layout->removeItem(m_layout->itemAt(count - 1)); 56 | } 57 | 58 | // Add item and make sure it stretches the remaining space. 59 | m_layout->addWidget(item); 60 | m_layout->addStretch(); 61 | } 62 | 63 | /************************************************* 64 | Function Name: removeItem() 65 | Description: 删除 66 | *************************************************/ 67 | void IMSearchListWidget::removeItem(QWidget *item) 68 | { 69 | m_layout->removeWidget(item); 70 | if (m_layout->count() == 1) 71 | { 72 | m_layout->removeItem(m_layout->itemAt(0)); 73 | 74 | 75 | } 76 | } 77 | 78 | /************************************************* 79 | Function Name: clearAll() 80 | Description: 删除所有 81 | *************************************************/ 82 | void IMSearchListWidget::clearAll() 83 | { 84 | // while(m_layout->count() > 0) 85 | // { 86 | // m_layout->removeItem(m_layout->itemAt(0)); 87 | // } 88 | QLayoutItem *child; 89 | while ((child = m_layout->takeAt(0)) != 0) 90 | { 91 | m_layout->removeItem(child); 92 | QWidget *widget = child->widget(); 93 | if (widget != NULL) 94 | widget->deleteLater(); 95 | } 96 | } 97 | 98 | /************************************************* 99 | Function Name: size() 100 | Description: size 101 | *************************************************/ 102 | int IMSearchListWidget::size() 103 | { 104 | m_mesCounter = m_layout->count(); 105 | if (m_mesCounter > 1) 106 | --m_mesCounter; 107 | 108 | return m_mesCounter; 109 | } 110 | -------------------------------------------------------------------------------- /IMClient/view/IMSearchListWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef IMSEARCHLISTWIDGET_H 2 | #define IMSEARCHLISTWIDGET_H 3 | 4 | #include 5 | 6 | class QVBoxLayout; 7 | class QScrollArea; 8 | class QMenu; 9 | class IMMainWidget; 10 | 11 | class IMSearchListWidget : public QWidget 12 | { 13 | Q_OBJECT 14 | public: 15 | IMSearchListWidget(QWidget *parent = 0); 16 | void addItem(QWidget *item); 17 | void removeItem(QWidget *item); 18 | int size(); 19 | void clearAll(); 20 | 21 | signals: 22 | 23 | public slots: 24 | 25 | private: 26 | QVBoxLayout *m_layout; 27 | QWidget *m_contentsWidget; 28 | QScrollArea *m_scrollArea; 29 | IMMainWidget *m_mainWidget; 30 | 31 | int m_mesCounter; 32 | }; 33 | 34 | #endif // IMSEARCHLISTWIDGET_H 35 | -------------------------------------------------------------------------------- /IMClient/view/IMToolBox.h: -------------------------------------------------------------------------------- 1 | #ifndef IMTOOLBOX_H 2 | #define IMTOOLBOX_H 3 | 4 | #include 5 | class QVBoxLayout; 6 | class QLabel; 7 | class QMenu; 8 | 9 | class IMToolItem : public QWidget { 10 | Q_OBJECT 11 | public: 12 | IMToolItem(const QString &title, QWidget *parent = 0); 13 | 14 | void addItem(QWidget *item); 15 | 16 | void removeItem(QWidget *item); 17 | 18 | void setTile(const QString &); 19 | 20 | int getSize(); 21 | 22 | QList * getWidgetList() 23 | { 24 | return &m_itemList; 25 | } 26 | 27 | signals: 28 | void renameBoxSignal(const QString & title); 29 | void removeBoxSignal(const QString & title); 30 | 31 | protected: 32 | void mousePressEvent(QMouseEvent *event); 33 | 34 | private slots: 35 | void renameBox(); 36 | void removeBox(); 37 | void onClickRightButton(); 38 | 39 | private: 40 | void creatMenu(); 41 | 42 | private: 43 | QList m_itemList; 44 | QVBoxLayout *m_layout; 45 | bool m_isVisable; 46 | QMenu *m_menu; 47 | QLabel *m_label; 48 | }; 49 | 50 | 51 | class IMToolBox : public QWidget { 52 | Q_OBJECT 53 | public: 54 | 55 | IMToolBox(QWidget *parent = 0); 56 | void addItem(IMToolItem *item); 57 | 58 | signals: 59 | 60 | public slots: 61 | 62 | private: 63 | QVBoxLayout *m_layout; 64 | }; 65 | 66 | #endif // IMTOOLBOX_H 67 | -------------------------------------------------------------------------------- /IMServer/IMServer: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyueshiqi/LAN_IM/40611ad2e61bdb0f50c85adf230c35d6618dfbf8/IMServer/IMServer -------------------------------------------------------------------------------- /IMServer/IMServer.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2014-03-14T17:26:27 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui network sql 8 | 9 | TARGET = IMServer 10 | TEMPLATE = app 11 | 12 | 13 | SOURCES += main.cpp\ 14 | view/IMServerWindow.cpp \ 15 | control/IMServerMessageCtrl.cpp \ 16 | model/IMTcpServer.cpp \ 17 | model/IMThread.cpp \ 18 | control/IMDatabaseCtrl.cpp \ 19 | model/IMUser.cpp \ 20 | control/IMClientSocketCtrl.cpp 21 | 22 | HEADERS += view/IMServerWindow.h \ 23 | control/IMServerMessageCtrl.h \ 24 | model/IMTcpServer.h \ 25 | model/IMThread.h \ 26 | control/IMDatabaseCtrl.h \ 27 | model/IMUser.h \ 28 | control/IMClientSocketCtrl.h \ 29 | model/IMEncryption.h \ 30 | model/IMConstant.h 31 | -------------------------------------------------------------------------------- /IMServer/control/IMClientSocketCtrl.h: -------------------------------------------------------------------------------- 1 | /********************************************* 2 | File Name: IMClientSocketCtrl.h 3 | Author: jet.F.R 4 | Date: 2014.3.10 5 | Description: 用于控制客户端socket的类 6 | Changes: 7 | ********************************************/ 8 | 9 | #ifndef IMCLIENTSOCKETCTRL_H 10 | #define IMCLIENTSOCKETCTRL_H 11 | 12 | #include 13 | #include "IMDatabaseCtrl.h" 14 | #include "model/IMConstant.h" 15 | 16 | class QDateTime; 17 | class IMUser; 18 | 19 | 20 | /************************************************* 21 | Class Name: IMClientSocketCtrl 22 | Description: 来自客户端socket,用于处理各种请求 23 | *************************************************/ 24 | class IMClientSocketCtrl : public QTcpSocket 25 | { 26 | Q_OBJECT 27 | public: 28 | IMClientSocketCtrl(QObject *parent = 0); 29 | ~IMClientSocketCtrl(); 30 | 31 | signals: 32 | // void havaNewClientSocket(IMClientSocket *); 33 | // 请求server处理 34 | void sendSignal(const SaveTmpInformation &temp); 35 | // 用户登录 36 | void userLoginSignal(const UserInformation &user); 37 | //用户断开连接了 38 | void deleteSignal(const QString &acc); 39 | 40 | public slots: 41 | // 接收信息 42 | void receiveMessage(); 43 | // 发送信息 44 | void sendMessage(const SaveTmpInformation &temp); 45 | // 删除socket 46 | void deleteScoket(); 47 | 48 | private: 49 | quint16 m_blockSize; 50 | SaveTmpInformation m_save; 51 | 52 | /****************************************/ 53 | //public slots: 54 | // // 发送用户的信息至另一个用户 55 | // void sendTalkMessage(TalkMessage); 56 | 57 | //private slots: 58 | // // 读取信息 59 | // void readMessage(); 60 | 61 | private: 62 | // // 检测登录信息 63 | // bool checkUser(const QString & id,const QString & pwd, 64 | // const QDateTime &); 65 | 66 | // // 添加用户 67 | // bool addUser(IMUser &); 68 | 69 | // // 获取所有好友 70 | // bool getFriends(const QString &); 71 | 72 | // // 发送信息 73 | // void sendMessage(MessageType type,bool is = false, 74 | // const IMUser *user = NULL, 75 | // const QString &mes1 = "", 76 | // const QString &mes2 = ""); 77 | 78 | // // 发送检测结果 79 | // void sendCheckResult(bool isSuccess, const QString &id = "", 80 | // const QString &nick = ""); 81 | 82 | // // 发送注册结果 83 | // void sendRegisterResult(bool isSuccess, const IMUser * user = NULL); 84 | 85 | // // 发送所有好友信息 86 | // void sendFriends(bool isSuccess, 87 | // const QMultiMap * map = NULL); 88 | 89 | private: 90 | IMDatabaseCtrl m_database; 91 | 92 | }; 93 | 94 | #endif // IMCLIENTSOCKETCTRL_H 95 | -------------------------------------------------------------------------------- /IMServer/control/IMServerMessageCtrl.h: -------------------------------------------------------------------------------- 1 | /********************************************* 2 | File Name: IMServerMessageCtrl.h 3 | Author: jet.F.R 4 | Date: 2014.3.10 5 | Description: 控制服务器类 6 | Changes: 7 | ********************************************/ 8 | 9 | #ifndef IMSERVERMESSAGECTRL_H 10 | #define IMSERVERMESSAGECTRL_H 11 | 12 | #include 13 | #include "IMDatabaseCtrl.h" 14 | 15 | class IMClientSocketCtrl; 16 | class IMTcpServer; 17 | 18 | class QStringListModel; 19 | class QListView; 20 | 21 | /************************************************* 22 | Class Name: IMServerMessageCtrl 23 | Description: 控制服务器 24 | *************************************************/ 25 | class IMServerMessageCtrl : public QObject 26 | { 27 | Q_OBJECT 28 | public: 29 | IMServerMessageCtrl(QObject *parent = 0); 30 | ~IMServerMessageCtrl(); 31 | void runServer(); // 用于启动服务器 32 | QListView *getIDListView(); 33 | QListView *getAddressListView(); 34 | 35 | signals: 36 | 37 | public slots: 38 | 39 | private slots: 40 | void showConnectedMedssage(); //暂时没用,本来是用于显示链接信息 mark: Not used 41 | void readMessage(IMClientSocketCtrl *); //暂时没用,本来是用于读取信息 mark: Not used 42 | 43 | void insertIDData(const QString &id); 44 | void deleteIDData(const QString &id); 45 | 46 | void insertAddressData(const QString &address); 47 | void deleteAddressData(const QString &address); 48 | 49 | private: 50 | 51 | private: 52 | IMTcpServer *m_tcpServer; 53 | quint16 m_blockSize; //暂时没用 54 | IMDatabaseCtrl m_databaseCtrl; 55 | 56 | QStringList m_listID; 57 | QStringListModel *m_modelID; 58 | QListView *m_listViewID; 59 | 60 | QStringList m_listAddress; 61 | QStringListModel *m_modelAddress; 62 | QListView *m_listViewAddress; 63 | }; 64 | 65 | #endif // IMSERVERMESSAGECTRL_H 66 | -------------------------------------------------------------------------------- /IMServer/main.cpp: -------------------------------------------------------------------------------- 1 | #include "view/IMServerWindow.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | int main(int argc, char *argv[]) 8 | { 9 | QApplication a(argc, argv); 10 | 11 | // 以下部分解决中文乱码 12 | QTextCodec::setCodecForTr(QTextCodec::codecForName("utf-8")); 13 | QTextCodec::setCodecForLocale(QTextCodec::codecForName("utf-8")); 14 | QTextCodec::setCodecForCStrings(QTextCodec::codecForName("utf-8")); 15 | // 以上部分解决中文乱码 16 | 17 | // //确保只运行一次 18 | // QSystemSemaphore sema("IMServerKey",1,QSystemSemaphore::Open); 19 | // //在临界区操作共享内存 20 | // sema.acquire(); 21 | // QSharedMemory mem("IMServerObject"); 22 | 23 | // // 如果全局对象以存在则退出 24 | // if (!mem.create(1)) 25 | // { 26 | // QMessageBox::warning(NULL, "error", 27 | // "A server has already been running."); 28 | // sema.release(); 29 | // return 0; 30 | // } 31 | // sema.release(); 32 | 33 | IMServerWindow w; 34 | w.show(); 35 | 36 | return a.exec(); 37 | } 38 | -------------------------------------------------------------------------------- /IMServer/model/IMEncryption.h: -------------------------------------------------------------------------------- 1 | /********************************************* 2 | File Name: IMEncryption.h 3 | Author: jet.F.R 4 | Date: 2014.3.17 5 | Description: 加密解密 6 | Changes: 7 | ********************************************/ 8 | 9 | #ifndef IMENCRYPTION_H 10 | #define IMENCRYPTION_H 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | class IMEncryption 20 | { 21 | public: 22 | // 用户获取实例,返回实例的引用 23 | static IMEncryption& getInstace(void); 24 | 25 | // 使用异或运算加密 26 | QString getXorEncryptDecrypt(const QString &, const char &); 27 | // QByteArray 转 QString 28 | QString byteToQString(const QByteArray &byte); 29 | // QString 转 QByteArray 30 | QByteArray qstringToByte(const QString &strInfo); 31 | 32 | private: 33 | IMEncryption(){}//禁止构造函数。 34 | IMEncryption(const IMEncryption &);//禁止拷贝构造函数。 35 | IMEncryption & operator =(const IMEncryption &);//禁止赋值拷贝函数。 36 | 37 | QReadWriteLock m_internalMutex;//函数使用的读写锁。 38 | static QMutex s_mutex;//实例互斥锁。 39 | static QAtomicPointer s_instance; //使用原子指针,默认初始化为0 40 | }; 41 | 42 | QMutex IMEncryption::s_mutex;//实例互斥锁。 43 | QAtomicPointer IMEncryption::s_instance = 0; //使用原子指针,默认初始化为0 44 | 45 | IMEncryption& IMEncryption::getInstace(void) 46 | { 47 | #ifndef Q_ATOMIC_POINTER_TEST_AND_SET_IS_ALWAYS_NATIVE 48 | // 运行时检测 49 | if (!QAtomicPointer::isTestAndSetNative()) 50 | { 51 | qDebug() << "Error: TestAndSetNative not supported!"; 52 | } 53 | #endif 54 | 55 | //使用双重检测。 56 | //testAndSetOrders操作保证在原子操作前和后的的内存访问不会被重新排序。 57 | 58 | if (s_instance.testAndSetOrdered(0, 0))//第一次检测 59 | { 60 | QMutexLocker locker(&s_mutex);//加互斥锁。 61 | s_instance.testAndSetOrdered(0, new IMEncryption);//第二次检测。 62 | } 63 | return *s_instance; 64 | } 65 | 66 | QString IMEncryption::getXorEncryptDecrypt(const QString &str, const char &key) 67 | { 68 | QString result; 69 | QByteArray bs = qstringToByte(str); 70 | 71 | for(int i=0; i 0) 85 | { 86 | QTextCodec *codec = QTextCodec::codecForName("utf-8"); 87 | result = codec->toUnicode(byte); 88 | } 89 | 90 | return result; 91 | } 92 | 93 | QByteArray IMEncryption::qstringToByte(const QString &strInfo) 94 | { 95 | QByteArray result; 96 | if (strInfo.length() > 0) 97 | { 98 | QTextCodec *codec = QTextCodec::codecForName("utf-8"); 99 | result = codec->fromUnicode(strInfo); 100 | } 101 | return result; 102 | } 103 | 104 | 105 | #endif // IMENCRYPTION_H 106 | -------------------------------------------------------------------------------- /IMServer/model/IMTcpServer.h: -------------------------------------------------------------------------------- 1 | /********************************************* 2 | File Name: IMTcpServer.h 3 | Author: jet.F.R 4 | Date: 2014.3.10 5 | Description: 服务器类 6 | Changes: 7 | ********************************************/ 8 | 9 | #ifndef IMTCPSERVER_H 10 | #define IMTCPSERVER_H 11 | 12 | #include 13 | #include "control/IMClientSocketCtrl.h" 14 | #include "IMConstant.h" 15 | #include "control/IMDatabaseCtrl.h" 16 | 17 | /************************************************* 18 | Class Name: IMTcpServer 19 | Description: 服务器 20 | *************************************************/ 21 | class IMTcpServer : public QTcpServer 22 | { 23 | Q_OBJECT 24 | public: 25 | IMTcpServer(QObject *parent = 0); 26 | ~IMTcpServer(); 27 | 28 | public slots: 29 | // 客户端断开连接 30 | void clientDisconnected(const QString &id); 31 | // 要求clientSocket发送信息 32 | void sendMessage(const SaveTmpInformation &temp); 33 | 34 | signals: 35 | void haveNewID(const QString & id); 36 | void haveNewAddress(const QString & address); 37 | void haveLeftID(const QString & id); 38 | void haveLeftAddress(const QString & address); 39 | 40 | private: 41 | // 当有新的连接时,会调用此函数。用于创建新的线程去控制socket通信 42 | void incomingConnection(int socketDescriptor); 43 | 44 | // 处理好友请求 45 | void friendRequest(const SaveTmpInformation & save); 46 | // 处理群请求 47 | void flockRequest(const SaveTmpInformation & save); 48 | // 处理讨论组请求 49 | void discussionRequest(const SaveTmpInformation & saves); 50 | // 处理对话请求 51 | void talkRequest(const SaveTmpInformation & save); 52 | 53 | 54 | // 通知好友,改变用户状态 55 | void tellFriendsStatusChanged(const QString &id, int status); 56 | // 通知好友,改变用户信息 57 | void tellFriendsInformationChanged(const QString & id);//, const FriendInformation &fri); 58 | // 通知群成员,群被解散 59 | void tellMembersFlockDroped(const QString & flockID); 60 | // 通知讨论组成员, 讨论组被解散了 61 | void tellMembersDiscussionDroped(const QString & discussionID); 62 | // 通知群成员,群信息被改变 63 | void tellMembersFlockChanged(const FlockInformation &); 64 | // 通知讨论组成员,讨论组信息被修改了 65 | void tellMembersDiscussionChanged(const DiscussionInformation &); 66 | 67 | // 通知群成员, 有新的成员 68 | void tellFlockMemberHaveNewMember(const QString &flockID); 69 | // 通知群成员, 有成员退出 70 | void tellFlockMemberHaveLeavedMember(const QString & flockID); 71 | 72 | // 通知群成员, 有新的成员 73 | void tellDiscussionMemberHaveNewMember(const QString & discussionID); 74 | // 通知讨论组成员, 有成员退出 75 | void tellDiscussionMemberHaveLeavedMember(const QString & discussionID); 76 | 77 | private: 78 | // 临时信息 79 | SaveTmpInformation m_save; 80 | // 操作数据库 81 | IMDatabaseCtrl m_database; 82 | // 在线用户列表 83 | QMap m_userMap; 84 | // 在线用户状态 85 | QMap m_userStatus; 86 | 87 | // 邮箱在线的用户 88 | QMap m_userMailMap; 89 | }; 90 | 91 | #endif // IMTCPSERVER_H 92 | 93 | -------------------------------------------------------------------------------- /IMServer/model/IMThread.cpp: -------------------------------------------------------------------------------- 1 | /********************************************* 2 | File Name: IMThread.cpp 3 | Author: jet.F.R 4 | Date: 2014.3.10 5 | Description: 服务器用于处理socket通信的线程类 6 | Changes: 7 | ********************************************/ 8 | 9 | #include "IMThread.h" 10 | #include "control/IMClientSocketCtrl.h" 11 | 12 | // mark: public-------------------------------------------- 13 | IMThread::IMThread(QObject *parent) : 14 | QThread(parent) 15 | { 16 | } 17 | 18 | 19 | IMThread::IMThread( QObject * parent, int socketDescriptor): 20 | QThread(parent) 21 | 22 | { 23 | m_socketDescriptor = socketDescriptor; 24 | } 25 | 26 | IMThread::~IMThread() 27 | { 28 | // if (m_clientSocket != NULL) 29 | // { 30 | // delete m_clientSocket; 31 | // m_clientSocket = NULL; 32 | // } 33 | } 34 | 35 | 36 | // mark: public slots:-------------------------------------- 37 | //void IMThread::sendTalkMessage(TalkMessage mes) 38 | //{ 39 | // m_clientSocket->sendTalkMessage(mes); 40 | //} 41 | 42 | // mark: private------------------------------------------ 43 | /************************************************* 44 | Function Name: run() 45 | Description: 线程运行时,会调用此函数 46 | Input: NULL 47 | Output:NULL 48 | Changes: NULL 49 | *************************************************/ 50 | void IMThread::run() 51 | { 52 | m_clientSocket = new IMClientSocketCtrl; 53 | m_clientSocket->setSocketDescriptor(m_socketDescriptor); 54 | 55 | connect(m_clientSocket, SIGNAL(destroyed()),this, SLOT(quit()));//断开连接时线程退出 56 | exec(); 57 | } 58 | -------------------------------------------------------------------------------- /IMServer/model/IMThread.h: -------------------------------------------------------------------------------- 1 | /********************************************* 2 | File Name: IMThread.h 3 | Author: jet.F.R 4 | Date: 2014.3.10 5 | Description: 服务器用于处理socket通信的线程类 6 | Changes: 7 | ********************************************/ 8 | #ifndef IMTHREAD_H 9 | #define IMTHREAD_H 10 | 11 | #include 12 | #include "model/IMConstant.h" 13 | 14 | class IMClientSocketCtrl; 15 | 16 | 17 | /************************************************* 18 | Class Name: IMThread 19 | Description: 处理socket通信的线程类 20 | *************************************************/ 21 | class IMThread : public QThread 22 | { 23 | Q_OBJECT 24 | public: 25 | explicit IMThread(QObject *parent = 0); 26 | explicit IMThread( QObject * parent, int socketDescriptor); 27 | ~IMThread(); 28 | 29 | signals: 30 | 31 | public slots: 32 | // void sendTalkMessage(TalkMessage mes); 33 | 34 | private: 35 | void run(); // 线程运行时,会调用此函数 36 | 37 | private: 38 | int m_socketDescriptor; 39 | IMClientSocketCtrl * m_clientSocket; 40 | 41 | }; 42 | 43 | #endif // IMTHREAD_H 44 | -------------------------------------------------------------------------------- /IMServer/model/IMUser.cpp: -------------------------------------------------------------------------------- 1 | /********************************************* 2 | File Name: IMUser.cpp 3 | Author: jet.F.R 4 | Date: 2014.3.17 5 | Description: 用户类 6 | Changes: 7 | ********************************************/ 8 | 9 | #include "IMUser.h" 10 | 11 | 12 | 13 | // mark: public------------------------------------------------------ 14 | IMUser::IMUser(QObject *parent) : 15 | QObject(parent) 16 | { 17 | } 18 | 19 | IMUser::IMUser(QString id, const QString &nick, const QString &pwd, const QString &sex, 20 | const QDate birth, const QString &name, const QString &addr, 21 | const QString &phone, const QString &ques, const QString &ans, 22 | const QDateTime regDate, const int status) 23 | { 24 | m_userID = id; 25 | m_nickname = nick; 26 | m_password = pwd; 27 | m_sex = sex; 28 | m_birthday = birth; 29 | m_question = ques; 30 | m_answer = ans; 31 | m_name = name; 32 | m_phone = phone; 33 | m_address = addr; 34 | m_regDateTime = regDate; 35 | m_status = status; 36 | } 37 | 38 | 39 | /************************************************* 40 | Function Name: getXX() 41 | Description: 获取用户信息 42 | Input: NULL 43 | Output:**(QString / int / QDateTime) 44 | Changes: NULL 45 | *************************************************/ 46 | 47 | /********************* bgein getXX()****************************/ 48 | QString IMUser::getUserID() const { return m_userID; } 49 | 50 | QString IMUser::getNickname() const { return m_nickname; } 51 | 52 | QString IMUser::getPassword() const { return m_password; } 53 | 54 | QString IMUser::getSex() const { return m_sex; } 55 | 56 | QDate IMUser::getBirthday() const { return m_birthday;} 57 | 58 | QString IMUser::getQuestion() const { return m_question; } 59 | 60 | QString IMUser::getAnswer() const { return m_answer; } 61 | 62 | QString IMUser::getName() const { return m_name; } 63 | 64 | QString IMUser::getPhone() const { return m_phone; } 65 | 66 | QString IMUser::getAddress() const { return m_address; } 67 | 68 | QDateTime IMUser::getRegDateTime() const { return m_regDateTime; } 69 | 70 | int IMUser::getStatus() const {return m_status; } 71 | 72 | /********************* end getXX()******************************/ 73 | 74 | /********************* bgein setXX()****************************/ 75 | void IMUser::setUserID(const QString &id) { m_userID = id; } 76 | void IMUser::setNickname(const QString &nick) { m_nickname = nick; } 77 | void IMUser::setPassword(const QString &pwd) { m_password = pwd; } 78 | void IMUser::setSex(const QString &sex) { m_sex = sex; } 79 | void IMUser::setBirthday(const QDate &birth) { m_birthday = birth; } 80 | void IMUser::setQusetion(const QString &ques) { m_question = ques; } 81 | void IMUser::setAnswer(const QString &ans) { m_answer = ans; } 82 | void IMUser::setName(const QString &name) { m_name = name; } 83 | void IMUser::setPhone(const QString &phone) { m_phone = phone; } 84 | void IMUser::setAddress(const QString & add) { m_address = add; } 85 | void IMUser::setRegDateTime(const QDateTime &date) { m_regDateTime = date; } 86 | void IMUser::setStatus(const int status) { m_status = status; } 87 | /********************* end setXX()******************************/ 88 | 89 | 90 | QDataStream &operator<<(QDataStream &out, const IMUser &user) 91 | { 92 | out << user.m_userID << user.m_nickname << user.m_password 93 | << user.m_sex << user.m_birthday << user.m_question 94 | << user.m_answer << user.m_name << user.m_phone 95 | << user.m_address << user.m_regDateTime << user.m_status; 96 | return out; 97 | } 98 | 99 | QDataStream &operator>>(QDataStream &in, IMUser &user) 100 | { 101 | in >> user.m_userID >> user.m_nickname >> user.m_password 102 | >> user.m_sex >> user.m_birthday >> user.m_question 103 | >> user.m_answer >> user.m_name >> user.m_phone 104 | >> user.m_address >> user.m_regDateTime >> user.m_status; 105 | return in; 106 | } 107 | -------------------------------------------------------------------------------- /IMServer/model/IMUser.h: -------------------------------------------------------------------------------- 1 | /********************************************* 2 | File Name: IMUser.h 3 | Author: jet.F.R 4 | Date: 2014.3.17 5 | Description: 用户类 6 | Changes: 7 | ********************************************/ 8 | #ifndef IMUSER_H 9 | #define IMUSER_H 10 | 11 | #include 12 | #include 13 | #include "model/IMConstant.h" 14 | 15 | class IMUser : public QObject 16 | { 17 | Q_OBJECT 18 | public: 19 | IMUser(QObject *parent = 0); 20 | IMUser(QString id, const QString &nick, const QString &pwd = "", 21 | const QString &sex = "", 22 | const QDate birth = QDate::currentDate(), 23 | const QString &name ="", const QString &addr = "", 24 | const QString &phone = "",const QString &ques = "", 25 | const QString &ans = "", 26 | const QDateTime regDate = QDateTime::currentDateTime(), 27 | const int status = ONLINE); 28 | 29 | QString getUserID() const; 30 | QString getNickname() const; 31 | QString getPassword() const; 32 | QString getSex() const; 33 | QDate getBirthday() const; 34 | QString getQuestion() const; 35 | QString getAnswer() const; 36 | QString getName() const; 37 | QString getPhone() const; 38 | QString getAddress() const; 39 | QDateTime getRegDateTime() const; 40 | int getStatus() const; 41 | 42 | void setUserID(const QString &); 43 | void setNickname(const QString &); 44 | void setPassword(const QString &); 45 | void setSex(const QString &); 46 | void setBirthday(const QDate &); 47 | void setQusetion(const QString &); 48 | void setAnswer(const QString &); 49 | void setName(const QString &); 50 | void setPhone(const QString &); 51 | void setAddress(const QString &); 52 | void setRegDateTime(const QDateTime &); 53 | void setStatus(const int status); 54 | 55 | signals: 56 | 57 | public slots: 58 | 59 | private: 60 | QString m_userID; 61 | QString m_nickname; 62 | QString m_password; 63 | QString m_sex; 64 | QDate m_birthday; 65 | QString m_question; 66 | QString m_answer; 67 | QString m_name; 68 | QString m_phone; 69 | QString m_address; 70 | QDateTime m_regDateTime; 71 | int m_status; 72 | 73 | friend QDataStream &operator<<(QDataStream &out, const IMUser &user); 74 | 75 | friend QDataStream &operator>>(QDataStream &in, IMUser &user); 76 | }; 77 | 78 | 79 | 80 | 81 | #endif // IMUSER_H 82 | -------------------------------------------------------------------------------- /IMServer/view/IMServerWindow.cpp: -------------------------------------------------------------------------------- 1 | /********************************************* 2 | File Name: IMServerWindow.cpp 3 | Author: jet.F.R 4 | Date: 2014.3.10 5 | Description: 服务器主界面类 6 | Changes: 7 | ********************************************/ 8 | 9 | #include "IMServerWindow.h" 10 | #include 11 | #include 12 | #include "control/IMServerMessageCtrl.h" 13 | #include 14 | 15 | IMServerWindow::IMServerWindow(QWidget *parent) 16 | : QWidget(parent) 17 | { 18 | m_serverCtrl = new IMServerMessageCtrl(this); 19 | m_serverCtrl->runServer(); 20 | 21 | QHBoxLayout *viewLayout = new QHBoxLayout; 22 | viewLayout->addWidget(m_serverCtrl->getIDListView()); 23 | viewLayout->addWidget(m_serverCtrl->getAddressListView()); 24 | 25 | QVBoxLayout *layout = new QVBoxLayout; 26 | QLabel *labelTitle = new QLabel(tr("连接服务器用户帐号列表:")); 27 | layout->addWidget(labelTitle); 28 | layout->addLayout(viewLayout); 29 | 30 | setLayout(layout); 31 | } 32 | 33 | IMServerWindow::~IMServerWindow() 34 | { 35 | if (m_serverCtrl != NULL) 36 | { 37 | delete m_serverCtrl; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /IMServer/view/IMServerWindow.h: -------------------------------------------------------------------------------- 1 | /********************************************* 2 | File Name: IMServerWindow.h 3 | Author: jet.F.R 4 | Date: 2014.3.10 5 | Description: 服务器主界面类 6 | Changes: 7 | ********************************************/ 8 | 9 | #ifndef IMSERVERWINDOW_H 10 | #define IMSERVERWINDOW_H 11 | 12 | #include 13 | 14 | class IMServerMessageCtrl; 15 | 16 | /************************************************* 17 | Class Name: IMServerWindow 18 | Description: 服务器主界面类 19 | *************************************************/ 20 | class IMServerWindow : public QWidget 21 | { 22 | Q_OBJECT 23 | 24 | public: 25 | IMServerWindow(QWidget *parent = 0); 26 | ~IMServerWindow(); 27 | 28 | private: 29 | IMServerMessageCtrl *m_serverCtrl; 30 | }; 31 | 32 | #endif // IMSERVERWINDOW_H 33 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | LAN instant messaging system mainly uses Qt technology and QtCreator development tool in this article. As a kind of C++ GUI application development framework for cross-platform, Qt is very popular in the Linux. Qt technology has become increasingly mature, and also got great performance. In addition, the system also involves Socket, MySQL, MVC, V4L2, FFmpeg and other related theories and technologies. 2 | The LAN instant messaging system mainly achieved registration, login, friend management, instant messaging, group chat, message management, mail transfer, file transfer, shared space and so on. After a simple registration, users can log into the system. Users can add friends, groups and discussion groups to communicate with other online users. What's more, the server and clients will store message records in the files or databases by themselves, so users can manage local records and network records at any time. Of course, file and mail transfer also be realized in this system. Besides that, Users and groups have their unique shared spaces, users can access friends' spaces, members of the group can access the space of the group, and share files with other users in the space.(The video module has been deleted.) 3 | 4 | See more, please visit http://blog.csdn.net/shuideyidi/article/details/38260513 5 | 6 | Please note that this project was developed by QT4, not QT5. And database is MYSQL. UI was written by pure code without any other tools. Thank you. 7 | If you meet some problems which you can not solve, when you run this project. You can send me a email, my email address is frazq10@163.com. If I have time, I will help you solve them. 8 | 9 | 10 | 本系统主要实现了注册登录、好友管理、即时通信(文本、视频)、群组功能、消息管理、邮件收发、文件收发等主要功能。用户通过简单的注册以后,便可以登录系统。随后进行好友、群以及讨论组的添加,就可以与其他在线的用户进行行即时通信。对于消息记录,服务器以及客户端都会在各自文件或者数据库中进行相应的存储,用户可以随时进行本地消息以及网络消息的管理。当然文件的收发也得到了很好的实现,并且也集成了简单邮件收发功能。(视频模块已删除) 11 | 12 | 详细介绍: http://blog.csdn.net/shuideyidi/article/details/38260513 13 | 14 | 请注意这个项目是用QT4开发,不是QT5。数据是MYSQL。并且界面是纯QT代码写的,没有用QTCreator的工具去拖拽。 15 | 如果运行的时候有问题,可以加QQ群(530240681),如果有时间,我会帮忙解决。邮箱:frazq10@163.com. 16 | --------------------------------------------------------------------------------