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 #include "pluginactiontype.h"
0008 
0009 using namespace MessageComposer;
0010 
0011 PluginActionType::PluginActionType() = default;
0012 
0013 PluginActionType::PluginActionType(QAction *action, PluginActionType::Type type)
0014     : mAction(action)
0015     , mType(type)
0016 {
0017 }
0018 
0019 QAction *PluginActionType::action() const
0020 {
0021     return mAction;
0022 }
0023 
0024 PluginActionType::Type PluginActionType::type() const
0025 {
0026     return mType;
0027 }
0028 
0029 QString PluginActionType::actionXmlExtension(PluginActionType::Type type)
0030 {
0031     switch (type) {
0032     case MessageComposer::PluginActionType::Tools:
0033         return QStringLiteral("_plugins_tools");
0034     case MessageComposer::PluginActionType::Edit:
0035         return QStringLiteral("_plugins_edit");
0036     case MessageComposer::PluginActionType::File:
0037         return QStringLiteral("_plugins_file");
0038     case MessageComposer::PluginActionType::Action:
0039         return QStringLiteral("_plugins_actions");
0040     case MessageComposer::PluginActionType::PopupMenu:
0041         return QStringLiteral("_popupmenu_actions");
0042     case MessageComposer::PluginActionType::ToolBar:
0043         return QStringLiteral("_toolbar_actions");
0044     case MessageComposer::PluginActionType::Options:
0045         return QStringLiteral("_plugins_options");
0046     case MessageComposer::PluginActionType::Insert:
0047         return QStringLiteral("_plugins_insert");
0048     case MessageComposer::PluginActionType::View:
0049         return QStringLiteral("_plugins_view");
0050     case MessageComposer::PluginActionType::None:
0051         return {};
0052     }
0053     return {};
0054 }