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 #if KCOREADDONS_VERSION < QT_VERSION_CHECK(5, 77, 0)
35  OnlinePluginExtended(QObject* parent, const QVariantList& args);
36 #else
37  OnlinePluginExtended(QObject* parent, const KPluginMetaData& metaData, const QVariantList& args);
38 #endif
39  virtual ~OnlinePluginExtended()
40  {
41  }
42 
43  /**
44  * @brief List onlineJobs supported by an account
45  *
46  * KMyMoney will use this function to ask the online plugin which online jobs it supports.
47  * Later changes can be made public using the jobAvailable signals.
48  *
49  * @return A QStringList with supported onlineTask::name()s as values.
50  */
51  virtual QStringList availableJobs(QString accountId) const = 0;
52 
53  /**
54  * @brief Get settings for onlineTask
55  *
56  * @see onlineTask::settings
57  */
58  virtual IonlineTaskSettings::ptr settings(QString accountId, QString taskName) = 0;
59 
60  /**
61  * @brief Send onlineJobs to bank
62  *
63  * @param jobs Do not delete the onlineJob objects. You can edit them but expect them to be deleted after
64  * you returned from this function.
65  */
66  virtual void sendOnlineJob(QList<onlineJob>& jobs) = 0;
67 
68  virtual void plug(KXMLGUIFactory* guiFactory) override = 0;
69  virtual void unplug() override = 0;
70 
71 Q_SIGNALS:
72  /**
73  * @brief Emit to make onlineJob available
74  *
75  * In case a onlineJob got available during runtime, emit one of these signals.
76  */
77  void jobAvailable(QString accountId, QString);
78  void jobAvailable(QString accountId, QStringList);
79  void jobUnavailable(QString accountId, QString);
80  // void jobUnavailable( QString accountId );
81 };
82 
83 class KMM_PLUGIN_EXPORT onlineTaskFactory
84 {
85 public:
86  virtual onlineTask* createOnlineTask(const QString& taskId) const = 0;
87 
88  // Make g++ happy
89  virtual ~onlineTaskFactory()
90  {
91  }
92 };
93 
94 class KMM_PLUGIN_EXPORT payeeIdentifierDataFactory
95 {
96 public:
97  virtual payeeIdentifierData* createPayeeIdentifier(const QString& payeeIdentifierIid) const = 0;
98  // Make g+ happy
99  virtual ~payeeIdentifierDataFactory()
100  {
101  }
102 };
103 
104 } // namespace KMyMoneyPlugin
105 
106 Q_DECLARE_INTERFACE(KMyMoneyPlugin::OnlinePluginExtended, "org.kmymoney.plugin.onlinepluginextended");
107 Q_DECLARE_INTERFACE(KMyMoneyPlugin::onlineTaskFactory, "org.kmymoney.plugin.onlinetaskfactory");
108 Q_DECLARE_INTERFACE(KMyMoneyPlugin::payeeIdentifierDataFactory, "org.kmymoney.plugin.payeeidentifierfactory");
109 
110 #endif // ONLINEPLUGINEXTENDED_H
Interface between KMyMoney and Online Banking plugins for executing transactions. ...
This class describes the interface between the KMyMoney application and it&#39;s ONLINE-BANKING plugins...
This class describes the interface between KMyMoney and it&#39;s plugins.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Tue Oct 19 2021 23:23:38 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.