File indexing completed on 2024-05-12 04:41:11

0001 /* AtCore KDE Libary for 3D Printers
0002     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0003     SPDX-FileCopyrightText: 2018, 2020 Chris Rizzitello <rizzitello@kde.org>
0004 */
0005 
0006 #pragma once
0007 
0008 #include <QWidget>
0009 
0010 #include "atcorewidgets_export.h"
0011 
0012 class QLineEdit;
0013 
0014 /**
0015  * @brief CommandWidget provides a widget to send commands or messages to the printer.
0016  *
0017  * Usage:
0018  * Connect to commandPressed or messagePressed to capture the events.
0019  */
0020 class ATCOREWIDGETS_EXPORT CommandWidget : public QWidget
0021 {
0022     Q_OBJECT
0023 public:
0024     explicit CommandWidget(QWidget *parent = nullptr);
0025     ~CommandWidget() = default;
0026 
0027 signals:
0028     /**
0029      * @brief User has requested to send a command.
0030      * @param command: The command to send.
0031      */
0032     void commandPressed(const QString &command);
0033 
0034     /**
0035      * @brief User has requested to send a message
0036      * @param message: The message to send.
0037      */
0038     void messagePressed(const QString &message);
0039 
0040 private:
0041     QLineEdit *lineCommand = nullptr;
0042     QLineEdit *lineMessage = nullptr;
0043 };