File indexing completed on 2024-06-23 05:18:34

0001 /*
0002    SPDX-FileCopyrightText: 2015-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "messagecomposer_export.h"
0010 #include <QString>
0011 class QAction;
0012 
0013 namespace MessageComposer
0014 {
0015 /**
0016  * @brief The PluginActionType class
0017  * @author Laurent Montel <montel@kde.org>
0018  */
0019 class MESSAGECOMPOSER_EXPORT PluginActionType
0020 {
0021 public:
0022     enum Type {
0023         Tools = 0,
0024         Edit = 1,
0025         File = 2,
0026         Action = 3,
0027         PopupMenu = 4,
0028         ToolBar = 5,
0029         Options = 6,
0030         None = 7,
0031         Insert = 8,
0032         View = 9,
0033     };
0034     PluginActionType();
0035 
0036     PluginActionType(QAction *action, Type type);
0037     [[nodiscard]] QAction *action() const;
0038     [[nodiscard]] Type type() const;
0039 
0040     static QString actionXmlExtension(PluginActionType::Type type);
0041 
0042 private:
0043     QAction *mAction = nullptr;
0044     Type mType = Tools;
0045 };
0046 }
0047 Q_DECLARE_TYPEINFO(MessageComposer::PluginActionType, Q_RELOCATABLE_TYPE);