File indexing completed on 2024-04-28 05:02:30

0001 /*
0002     SPDX-FileCopyrightText: 2004 Ace Jones acejones @users.sourceforge.net
0003     SPDX-FileCopyrightText: 2004 Thomas Baumgart <tbaumgart@kde.org>
0004 
0005     This file is part of libalkimia.
0006 
0007     SPDX-License-Identifier: GPL-2.0-or-later
0008 */
0009 
0010 #ifndef ALKFINANCEQUOTEPROCESS_H
0011 #define ALKFINANCEQUOTEPROCESS_H
0012 
0013 #include <alkimia/alk_export.h>
0014 
0015 #include <KProcess>
0016 
0017 /**
0018  * Helper class to run the Finance::Quote process. This is used only for the purpose
0019  * of obtaining a list of valid sources. The actual price quotes are obtained using
0020  * AlkOnlineQoute.
0021  *
0022  * The class also contains functions to convert between the rather cryptic source
0023  * names used by the Finance::Quote package, and more user-friendly names.
0024  *
0025  * @author Thomas Baumgart <tbaumgart@kde.org>
0026  * @author Ace Jones <acejones@users.sourceforge.net>
0027  * @author Tony B<tonybloom@users.sourceforge.net>
0028  */
0029 class ALK_EXPORT AlkFinanceQuoteProcess : public KProcess
0030 {
0031     Q_OBJECT
0032 public:
0033     AlkFinanceQuoteProcess();
0034     void launch(const QString &scriptPath);
0035     /**
0036      * Check that all modules for Finance::Quote are installed
0037      */
0038     void testLaunch(const QString& scriptPath);
0039     bool isFinished() const;
0040     const QStringList getSourceList() const;
0041     const QString crypticName(const QString &niceName) const;
0042     const QString niceName(const QString &crypticName) const;
0043 
0044 public Q_SLOTS:
0045     void slotReceivedDataFromFilter();
0046     void slotProcessExited();
0047 
0048 private:
0049     class Private;
0050     Private *const d;
0051 };
0052 
0053 #endif // ALKFINANCEQUOTEPROCESS_H