#ifndef KASENDBAR_H
#define KASENDBAR_H

#include <QWidget>
#include <memory>

class KASendBar : public QWidget
{
    Q_OBJECT
public:
    explicit KASendBar(QWidget *parent = nullptr);

    void setMaxShowRows(int rows);
    void setEditEnabled(bool enable);
    void setClearEnabled(bool enable);

private slots:
    void onTextChange();
    void updateFixedHeight();
    void onButtonClearClicked();
    void onButtonSendClicked();

    void initLayout();

signals:
    void sigSendMessage(const QString &message);
    void sigClearMessage();

protected:
    bool eventFilter(QObject *watched, QEvent *event) override;

private:
    struct Private;
    std::shared_ptr<Private> d_ptr;
};

#endif // KASENDBAR_H
