| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- #ifndef MEETINGSELECTIONWIDGET_H
- #define MEETINGSELECTIONWIDGET_H
- #include <QWidget>
- #include <QVBoxLayout>
- #include <QHBoxLayout>
- #include <QPushButton>
- #include <QLabel>
- #include <QFrame>
- #include <QStringList>
- class UserProfileWidget; // 前置声明:复用已有的用户资料组件
- 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; // 使用已有的用户资料组件
- 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
|