matrixion/src/dialogs/UserProfile.h

68 lines
1.2 KiB
C
Raw Normal View History

2018-07-20 12:02:35 +03:00
#pragma once
#include <QString>
#include <QWidget>
class Avatar;
class FlatButton;
class QLabel;
class QListWidget;
class Toggle;
struct DeviceInfo
{
QString device_id;
QString display_name;
};
Q_DECLARE_METATYPE(std::vector<DeviceInfo>)
2018-07-20 12:02:35 +03:00
namespace dialogs {
class DeviceItem : public QWidget
{
Q_OBJECT
public:
explicit DeviceItem(DeviceInfo device, QWidget *parent);
2018-07-20 12:02:35 +03:00
private:
DeviceInfo info_;
2018-07-20 12:02:35 +03:00
// Toggle *verifyToggle_;
};
class UserProfile : public QWidget
{
Q_OBJECT
public:
explicit UserProfile(QWidget *parent = nullptr);
void init(const QString &userId, const QString &roomId);
protected:
void paintEvent(QPaintEvent *) override;
signals:
void devicesRetrieved(const std::vector<DeviceInfo> &devices);
private slots:
void updateDeviceList(const std::vector<DeviceInfo> &devices);
2018-07-20 12:02:35 +03:00
private:
Avatar *avatar_;
QLabel *userIdLabel_;
QLabel *displayNameLabel_;
FlatButton *banBtn_;
FlatButton *kickBtn_;
FlatButton *ignoreBtn_;
FlatButton *startChat_;
QLabel *devicesLabel_;
2018-07-20 12:02:35 +03:00
QListWidget *devices_;
};
2018-07-20 12:02:35 +03:00
} // dialogs