1 Star 0 Fork 9

fuyb/linux_feiq

forked from uenigma/linux_feiq 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
mainwindow.h 3.19 KB
一键复制 编辑 原始数据 按行查看 历史
lpx 提交于 2021-12-16 21:35 +08:00 . 格式化代码
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include "chooseemojidlg.h"
#include "feiqlib/feiqengine.h"
#include "fellowlistwidget.h"
#include "filemanagerdlg.h"
#include "recvtextedit.h"
#include "searchfellowdlg.h"
#include "sendtextedit.h"
#include "settings.h"
#include <QFileInfo>
#include <QMainWindow>
#include <unordered_map>
using namespace std;
namespace Ui
{
class MainWindow;
}
class FeiqWin;
struct UnshownMessage
{
shared_ptr<ViewEvent> event;
bool replied = false;
bool read = false;
long notifyId = 0;
bool isUnread()
{
return !replied && !read;
}
};
Q_DECLARE_METATYPE(shared_ptr<ViewEvent>)
class MainWindow : public QMainWindow, IFeiqView
{
Q_OBJECT
friend class FeiqWin;
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
void setFeiqWin(FeiqWin *feiqWin);
public slots:
void onNotifyClicked(const QString &fellowIp);
void onNotifyReplied(long notifyId, const QString &fellowIp, const QString &reply);
protected:
void enterEvent(QEvent *event);
signals:
void showErrorAndQuit(const QString &text);
void statChanged(FileTask *fileTask);
void progressChanged(FileTask *fileTask);
void feiqViewEvent(shared_ptr<ViewEvent> event);
private slots:
void finishSearch(const Fellow *fellow);
void openSettings();
void openSearchDlg();
void openDownloadDlg();
void onShowErrorAndQuit(const QString &text);
void navigateToFileTask(IdType packetNo, IdType fileId, bool upload);
void sendKnock();
void sendText();
void openChartTo(const Fellow *fellow);
void handleFeiqViewEvent(shared_ptr<ViewEvent> event);
void refreshFellowList();
void addFellow();
void openChooseEmojiDlg();
void sendFile();
void sendFile(string filepath);
void sendFiles(QList<QFileInfo> files);
private:
void userAddFellow(QString ip);
long showNotification(const Fellow *fellow, const QString &text);
shared_ptr<Fellow> checkCurFellow();
void showResult(pair<bool, string> ret, const Content *content);
vector<const Fellow *> fellowSearchDriver(const QString &text);
void initFeiq();
void readEvent(const ViewEvent *event);
void setBadgeNumber(int number);
QString simpleTextOf(const Content *content);
UnshownMessage &addUnshownMessage(const Fellow *fellow, shared_ptr<ViewEvent> event);
UnshownMessage *findUnshownMessage(int id);
void notifyUnshown(UnshownMessage &umsg);
void updateUnshownHint(const Fellow *fellow);
int getUnreadCount();
void flushUnshown(const Fellow *fellow);
// IFileTaskObserver interface
public:
void onStateChanged(FileTask *fileTask);
void onProgress(FileTask *fileTask);
// IFeiqView interface
public:
void onEvent(shared_ptr<ViewEvent> event);
private:
Ui::MainWindow *ui;
FellowListWidget mFellowList;
SearchFellowDlg *mSearchFellowDlg;
FileManagerDlg *mDownloadFileDlg;
ChooseEmojiDlg *mChooseEmojiDlg;
Settings *mSettings;
FeiqEngine mFeiq;
RecvTextEdit *mRecvTextEdit;
SendTextEdit *mSendTextEdit;
QString mTitle;
unordered_map<const Fellow *, list<UnshownMessage>> mUnshownEvents;
FeiqWin *mFeiqWin = nullptr;
};
#endif // MAINWINDOW_H
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/HALOBING/linux_feiq.git
git@gitee.com:HALOBING/linux_feiq.git
HALOBING
linux_feiq
linux_feiq
master

搜索帮助