Pimcommon

abstractgenericplugininterface.h
1 /*
2  SPDX-FileCopyrightText: 2016-2022 Laurent Montel <[email protected]>
3 
4  SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 
7 #pragma once
8 #include "pimcommon_export.h"
9 #include <QObject>
10 #include <memory>
11 class QAction;
12 class KActionCollection;
13 namespace PimCommon
14 {
15 class AbstractGenericPlugin;
16 class GenericPlugin;
17 /**
18  * @brief The ActionType class
19  * @author Laurent Montel <[email protected]>
20  */
21 class PIMCOMMON_EXPORT ActionType
22 {
23 public:
24  enum Type { Tools = 0, Edit = 1, File = 2, Action = 3, PopupMenu = 4, ToolBar = 5, Message = 6, Folder = 7 };
25  ActionType() = default;
26 
27  ActionType(QAction *action, Type type);
28  Q_REQUIRED_RESULT QAction *action() const;
29  Q_REQUIRED_RESULT Type type() const;
30 
31 private:
32  QAction *mAction = nullptr;
33  Type mType = Tools;
34 };
35 
36 class AbstractGenericPluginInterfacePrivate;
37 class PIMCOMMON_EXPORT AbstractGenericPluginInterface : public QObject
38 {
39  Q_OBJECT
40 public:
41  explicit AbstractGenericPluginInterface(QObject *parent = nullptr);
42  ~AbstractGenericPluginInterface() override;
43 
44  void setParentWidget(QWidget *parent);
45  Q_REQUIRED_RESULT QWidget *parentWidget() const;
46 
47  void setPlugin(AbstractGenericPlugin *plugin);
48  Q_REQUIRED_RESULT AbstractGenericPlugin *plugin() const;
49 
50  virtual void createAction(KActionCollection *ac) = 0;
51  virtual void exec() = 0;
52 
53  virtual void showConfigureDialog(QWidget *parentWidget = nullptr);
54 
55 Q_SIGNALS:
56  void emitPluginActivated(PimCommon::AbstractGenericPluginInterface *interface);
57  void message(const QString &str);
58 
59 private:
60  std::unique_ptr<AbstractGenericPluginInterfacePrivate> const d;
61 };
62 }
folderdialogacltab.h
The AbstractGenericPlugin class.
QString message
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Fri Aug 12 2022 03:51:53 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.