File indexing completed on 2025-02-16 04:57:43
0001 /* 0002 * SPDX-FileCopyrightText: 2006 Dmitry Morozhnikov <dmiceman@mail.ru> 0003 * SPDX-FileCopyrightText: 2018-2024 Laurent Montel <montel@kde.org> 0004 * 0005 * SPDX-License-Identifier: GPL-2.0-or-later 0006 */ 0007 0008 #pragma once 0009 0010 #include "templateparser_export.h" 0011 #include <QPushButton> 0012 #include <TemplateParser/TemplatesCommandMenu> 0013 0014 namespace TemplateParser 0015 { 0016 /** 0017 * @brief The TemplatesInsertCommandPushButton class 0018 * @author Laurent Montel <montel@kde.org> 0019 */ 0020 class TEMPLATEPARSER_EXPORT TemplatesInsertCommandPushButton : public QPushButton 0021 { 0022 Q_OBJECT 0023 public: 0024 explicit TemplatesInsertCommandPushButton(QWidget *parent, const QString &name = QString()); 0025 ~TemplatesInsertCommandPushButton() override; 0026 0027 [[nodiscard]] TemplatesCommandMenu::MenuTypes type() const; 0028 void setType(TemplatesCommandMenu::MenuTypes type); 0029 0030 Q_SIGNALS: 0031 void insertCommand(const QString &cmd, int adjustCursor = 0); 0032 0033 private: 0034 TemplatesCommandMenu *const mMenuCommand; 0035 }; 0036 }