Messagelib

pluginactiontype.cpp
1 /*
2  SPDX-FileCopyrightText: 2015-2023 Laurent Montel <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #include "pluginactiontype.h"
8 
9 using namespace MessageComposer;
10 
11 PluginActionType::PluginActionType() = default;
12 
13 PluginActionType::PluginActionType(QAction *action, PluginActionType::Type type)
14  : mAction(action)
15  , mType(type)
16 {
17 }
18 
19 QAction *PluginActionType::action() const
20 {
21  return mAction;
22 }
23 
24 PluginActionType::Type PluginActionType::type() const
25 {
26  return mType;
27 }
28 
29 QString 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-2023 The KDE developers.
Generated on Wed Sep 27 2023 03:53:08 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.