| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- #ifndef MEETINGSELECTIONWIDGET_H
- #define MEETINGSELECTIONWIDGET_H
- #include <QWidget>
- #include <QVBoxLayout>
- #include <QHBoxLayout>
- #include <QPushButton>
- #include <QLabel>
- #include <QFrame>
- #include <QStringList>
- class UserProfileWidget; // 前置声明:复用已有的用户资料组件
- class StatsWidget; // 前置声明:消息统计组件
- class WebSocketClient; // 前置声明:消息源
- class MeetingSelectionWidget : public QWidget
- {
- Q_OBJECT
- public:
- explicit MeetingSelectionWidget(QWidget *parent = nullptr);
- ~MeetingSelectionWidget();
- // 设置用户角色(兼容两种输入)
- void setUserRoles(const QStringList &roles);
- void setUserRoles(const QString &roles);
-
- // 设置用户信息
- void setUserInfo(const QString &username, const QString &userId);
- // 临时:设置统计信息来源(来自 WebSocketClient 的 statsUpdate 信号)
- void setWebSocketClient(WebSocketClient *client);
- signals:
- // 用户选择加入会议
- void joinMeetingRequested();
-
- // 用户选择创建会议
- void createMeetingRequested();
-
- // 用户选择退出登录
- void logoutRequested();
- private slots:
- void onJoinMeetingClicked();
- void onCreateMeetingClicked();
- void onLogoutClicked();
- private:
- void setupUI();
- void updateButtonsVisibility();
- void applyStyles();
- // UI组件
- QVBoxLayout *m_mainLayout;
- QLabel *m_titleLabel;
- QLabel *m_welcomeLabel;
- UserProfileWidget *m_userProfile; // 使用已有的用户资料组件
- StatsWidget *m_statsWidget; // 新增:消息统计组件
- QFrame *m_buttonFrame;
- QVBoxLayout *m_buttonLayout;
- QPushButton *m_joinMeetingBtn;
- QPushButton *m_createMeetingBtn;
- QPushButton *m_logoutBtn;
-
- // 用户信息
- QStringList m_userRoles;
- QString m_username;
- QString m_userId;
-
- // 是否为管理员
- bool m_isAdmin;
- // 统计信号来源
- WebSocketClient *m_wsClient = nullptr;
- };
- #endif // MEETINGSELECTIONWIDGET_H
|