KMyMoney Plugin API

onlinepluginextended.h
1 /*
2 
3  SPDX-FileCopyrightText: 2014 Christian Dávid <[email protected]>
4  SPDX-FileCopyrightText: 2021 Dawid Wróbel <[email protected]>
5  SPDX-License-Identifier: GPL-2.0-or-later
6 */
7 
8 #ifndef ONLINEPLUGINEXTENDED_H
9 #define ONLINEPLUGINEXTENDED_H
10 
11 #include "kmymoneyplugin.h"
12 
13 #include "mymoney/onlinejob.h"
14 #include "onlinetasks/interfaces/tasks/ionlinetasksettings.h"
15 
16 class onlineJob;
17 class onlineTask;
18 class payeeIdentifierData;
19 
20 namespace KMyMoneyPlugin {
21 
22 /**
23  * @brief Interface between KMyMoney and Online Banking plugins for executing transactions
24  *
25  * This interface is under active development and will change often! Do not use it at the moment!
26  *
27  * @author Christian David ([email protected])
28  */
29 class KMM_PLUGIN_EXPORT OnlinePluginExtended : public Plugin, public OnlinePlugin
30 {
31  Q_OBJECT
32 
33 public:
34  OnlinePluginExtended(QObject* parent, const KPluginMetaData& metaData, const QVariantList& args);
35  virtual ~OnlinePluginExtended()
36  {
37  }
38 
39  /**
40  * @brief List onlineJobs supported by an account
41  *
42  * KMyMoney will use this function to ask the online plugin which online jobs it supports.
43  * Later changes can be made public using the jobAvailable signals.
44  *
45  * @return A QStringList with supported onlineTask::name()s as values.
46  */
47  virtual QStringList availableJobs(QString accountId) const = 0;
48 
49  /**
50  * @brief Get settings for onlineTask
51  *
52  * @see onlineTask::settings
53  */
54  virtual IonlineTaskSettings::ptr settings(QString accountId, QString taskName) = 0;
55 
56  /**
57  * @brief Send onlineJobs to bank
58  *
59  * @param jobs Do not delete the onlineJob objects. You can edit them but expect them to be deleted after
60  * you returned from this function.
61  */
62  virtual void sendOnlineJob(QList<onlineJob>& jobs) = 0;
63 
64  virtual void plug(KXMLGUIFactory* guiFactory) override = 0;
65  virtual void unplug() override = 0;
66 
67 Q_SIGNALS:
68  /**
69  * @brief Emit to make onlineJob available
70  *
71  * In case a onlineJob got available during runtime, emit one of these signals.
72  */
73  void jobAvailable(QString accountId, QString);
74  void jobAvailable(QString accountId, QStringList);
75  void jobUnavailable(QString accountId, QString);
76  // void jobUnavailable( QString accountId );
77 };
78 
79 class KMM_PLUGIN_EXPORT onlineTaskFactory : public QObject
80 {
81  Q_OBJECT
82 
83 public:
84  onlineTaskFactory(QObject* parent, const QVariantList &args)
85  : QObject(parent)
86  {
87  Q_UNUSED(args)
88  }
89 
90 public:
91  virtual onlineTask* createOnlineTask(const QString& taskId) const = 0;
92 
93  // Make g++ happy
94  virtual ~onlineTaskFactory()
95  {
96  }
97 };
98 
99 class KMM_PLUGIN_EXPORT payeeIdentifierDataFactory
100 {
101 public:
102  virtual payeeIdentifierData* createPayeeIdentifier(const QString& payeeIdentifierIid) const = 0;
103  // Make g+ happy
104  virtual ~payeeIdentifierDataFactory()
105  {
106  }
107 };
108 
109 } // namespace KMyMoneyPlugin
110 
111 Q_DECLARE_INTERFACE(KMyMoneyPlugin::OnlinePluginExtended, "org.kmymoney.plugin.onlinepluginextended");
112 Q_DECLARE_INTERFACE(KMyMoneyPlugin::onlineTaskFactory, "org.kmymoney.plugin.onlinetaskfactory");
113 Q_DECLARE_INTERFACE(KMyMoneyPlugin::payeeIdentifierDataFactory, "org.kmymoney.plugin.payeeidentifierfactory");
114 
115 #endif // ONLINEPLUGINEXTENDED_H
This class describes the interface between KMyMoney and it's plugins.
Interface between KMyMoney and Online Banking plugins for executing transactions.
This class describes the interface between the KMyMoney application and it's ONLINE-BANKING plugins.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Fri Dec 1 2023 03:48:57 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.