KMyMoney Plugin API

onlinepluginextended.h
1/*
2
3 SPDX-FileCopyrightText: 2014 Christian Dávid <christian-david@web.de>
4 SPDX-FileCopyrightText: 2021 Dawid Wróbel <me@dawidwrobel.com>
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
16class onlineJob;
17class onlineTask;
18class payeeIdentifierData;
19
20namespace 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 (christian-david@web.de)
28 */
29class KMM_PLUGIN_EXPORT OnlinePluginExtended : public Plugin, public OnlinePlugin
30{
31 Q_OBJECT
32
33public:
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
67Q_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
79class KMM_PLUGIN_EXPORT onlineTaskFactory : public QObject
80{
81 Q_OBJECT
82
83public:
84 onlineTaskFactory(QObject* parent, const QVariantList &args)
85 : QObject(parent)
86 {
87 Q_UNUSED(args)
88 }
89
90public:
91 virtual onlineTask* createOnlineTask(const QString& taskId) const = 0;
92
93 // Make g++ happy
94 virtual ~onlineTaskFactory()
95 {
96 }
97};
98
99class KMM_PLUGIN_EXPORT payeeIdentifierDataFactory
100{
101public:
102 virtual payeeIdentifierData* createPayeeIdentifier(const QString& payeeIdentifierIid) const = 0;
103 // Make g+ happy
104 virtual ~payeeIdentifierDataFactory()
105 {
106 }
107};
108
109} // namespace KMyMoneyPlugin
110
111Q_DECLARE_INTERFACE(KMyMoneyPlugin::OnlinePluginExtended, "org.kmymoney.plugin.onlinepluginextended");
112Q_DECLARE_INTERFACE(KMyMoneyPlugin::onlineTaskFactory, "org.kmymoney.plugin.onlinetaskfactory");
113Q_DECLARE_INTERFACE(KMyMoneyPlugin::payeeIdentifierDataFactory, "org.kmymoney.plugin.payeeidentifierfactory");
114
115#endif // ONLINEPLUGINEXTENDED_H
Interface between KMyMoney and Online Banking plugins for executing transactions.
virtual IonlineTaskSettings::ptr settings(QString accountId, QString taskName)=0
Get settings for onlineTask.
void jobAvailable(QString accountId, QString)
Emit to make onlineJob available.
virtual void plug(KXMLGUIFactory *guiFactory) override=0
Called during plug in process.
virtual QStringList availableJobs(QString accountId) const =0
List onlineJobs supported by an account.
virtual void unplug() override=0
Called before unloading.
virtual void sendOnlineJob(QList< onlineJob > &jobs)=0
Send onlineJobs to bank.
This class describes the interface between the KMyMoney application and it's ONLINE-BANKING plugins.
This class describes the interface between KMyMoney and it's plugins.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:18:13 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.