Messagelib

pluginactiontype.cpp
1/*
2 SPDX-FileCopyrightText: 2015-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#include "pluginactiontype.h"
8
9using namespace MessageComposer;
10
11PluginActionType::PluginActionType() = default;
12
13PluginActionType::PluginActionType(QAction *action, PluginActionType::Type type)
14 : mAction(action)
15 , mType(type)
16{
17}
18
19QAction *PluginActionType::action() const
20{
21 return mAction;
22}
23
24PluginActionType::Type PluginActionType::type() const
25{
26 return mType;
27}
28
29QString PluginActionType::actionXmlExtension(PluginActionType::Type type)
30{
31 switch (type) {
32 case MessageComposer::PluginActionType::Tools:
33 return QStringLiteral("_plugins_tools");
34 case MessageComposer::PluginActionType::Edit:
35 return QStringLiteral("_plugins_edit");
36 case MessageComposer::PluginActionType::File:
37 return QStringLiteral("_plugins_file");
38 case MessageComposer::PluginActionType::Action:
39 return QStringLiteral("_plugins_actions");
40 case MessageComposer::PluginActionType::PopupMenu:
41 return QStringLiteral("_popupmenu_actions");
42 case MessageComposer::PluginActionType::ToolBar:
43 return QStringLiteral("_toolbar_actions");
44 case MessageComposer::PluginActionType::Options:
45 return QStringLiteral("_plugins_options");
46 case MessageComposer::PluginActionType::Insert:
47 return QStringLiteral("_plugins_insert");
48 case MessageComposer::PluginActionType::View:
49 return QStringLiteral("_plugins_view");
50 case MessageComposer::PluginActionType::None:
51 return {};
52 }
53 return {};
54}
Simple interface that both EncryptJob and SignEncryptJob implement so the composer can extract some e...
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sun Feb 25 2024 18:37:31 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.