File indexing completed on 2024-04-28 16:13:26

0001 /*
0002     SPDX-FileCopyrightText: 2018 Ralf Habacker ralf.habacker @freenet.de
0003 
0004     This file is part of libalkimia.
0005 
0006     SPDX-License-Identifier: LGPL-2.1-or-later
0007 */
0008 
0009 #ifndef ALKONLINEQUOTESPROFILE_H
0010 #define ALKONLINEQUOTESPROFILE_H
0011 
0012 #include <alkimia/alk_export.h>
0013 #include <alkimia/alkonlinequotesource.h>
0014 
0015 #include <QObject>
0016 #include <QString>
0017 #include <QMap>
0018 
0019 class KConfig;
0020 
0021 class AlkOnlineQuoteSource;
0022 class AlkOnlineQuotesProfileManager;
0023 
0024 class ALK_EXPORT AlkOnlineQuotesProfile : public QObject
0025 {
0026     Q_OBJECT
0027 public:
0028     typedef QMap<QString, AlkOnlineQuoteSource> Map;
0029     enum class Type {
0030         Undefined, None, Alkimia4, Alkimia5, KMyMoney4, KMyMoney5, Skrooge4, Skrooge5, Script
0031     };
0032     AlkOnlineQuotesProfile(const QString &name = "alkimia", Type type = Type::None,
0033         const QString &ghnsConfigFile = QString());
0034     ~AlkOnlineQuotesProfile();
0035 
0036     QString name() const;
0037     QString hotNewStuffConfigFile() const;
0038     QString hotNewStuffRelPath() const;
0039     QStringList hotNewStuffReadPath() const;
0040     QString hotNewStuffWriteDir() const;
0041     QString hotNewStuffReadFilePath(const QString &fileName) const;
0042     QString hotNewStuffWriteFilePath(const QString &fileName) const;
0043     QString kConfigFile() const;
0044     void setManager(AlkOnlineQuotesProfileManager *manager);
0045     AlkOnlineQuotesProfileManager *manager();
0046     KConfig *kConfig() const;
0047     Type type();
0048     bool hasGHNSSupport();
0049 
0050     /**
0051      * return available default sources of this profile
0052      */
0053     const Map defaultQuoteSources();
0054 
0055     /**
0056      * return available sources of this profile
0057      */
0058     const QStringList quoteSources();
0059 
0060     QString scriptPath();
0061 
0062 Q_SIGNALS:
0063     /**
0064      * emit quote source for which an update is available
0065      */
0066    void updateAvailable(const QString &profile, const QString &name);
0067 
0068 private:
0069     class Private;
0070     Private *const d;
0071 };
0072 
0073 #endif // ALKONLINEQUOTESPROFILE_H