File indexing completed on 2024-04-21 15:40:27

0001 // SPDX-FileCopyrightText: 2018-2019 Black Hat <bhat@encom.eu.org>
0002 // SPDX-License-Identifier: GPL-3.0-only
0003 
0004 #pragma once
0005 
0006 #include <QObject>
0007 
0008 #include <Quotient/user.h>
0009 
0010 /**
0011  * @class NeoChatUser
0012  *
0013  * A class inherited from Quotient::User to add a user color function.
0014  *
0015  * @sa Quotient::User
0016  */
0017 class NeoChatUser : public Quotient::User
0018 {
0019     Q_OBJECT
0020 
0021     /**
0022      * @brief The color to use for the user.
0023      */
0024     Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
0025 public:
0026     explicit NeoChatUser(QString userId, Quotient::Connection *connection);
0027 
0028 public Q_SLOTS:
0029     QColor color();
0030     void setColor(const QColor &color);
0031 
0032 Q_SIGNALS:
0033     void colorChanged(QColor _t1);
0034 
0035 private:
0036     QColor m_color;
0037 
0038     void polishColor();
0039 };