File indexing completed on 2025-02-16 04:57:43

0001 /*
0002    SPDX-FileCopyrightText: 2018-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include <QWidgetAction>
0010 #include <TemplateParser/TemplatesCommandMenu>
0011 
0012 #include "templateparser_export.h"
0013 namespace TemplateParser
0014 {
0015 /**
0016  * @brief The TemplatesInsertCommandAction class
0017  * @author Laurent Montel <montel@kde.org>
0018  */
0019 class TEMPLATEPARSER_EXPORT TemplatesInsertCommandAction : public QWidgetAction
0020 {
0021     Q_OBJECT
0022 public:
0023     explicit TemplatesInsertCommandAction(QObject *parent = nullptr);
0024     ~TemplatesInsertCommandAction() override;
0025 
0026     [[nodiscard]] TemplatesCommandMenu::MenuTypes type() const;
0027     void setType(TemplatesCommandMenu::MenuTypes type);
0028 
0029 Q_SIGNALS:
0030     void insertCommand(const QString &cmd, int adjustCursor);
0031 
0032 private:
0033     TemplatesCommandMenu *const mMenuCommand;
0034 };
0035 }