File indexing completed on 2024-07-14 04:55:01

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 ALKONLINEQUOTESPROFILEMANAGER_H
0010 #define ALKONLINEQUOTESPROFILEMANAGER_H
0011 
0012 #include <alkimia/alkonlinequotesprofile.h>
0013 
0014 #include <QList>
0015 #include <QStringList>
0016 
0017 class AlkWebPage;
0018 
0019 typedef QList<AlkOnlineQuotesProfile *> AlkOnlineQuotesProfileList;
0020 
0021 class ALK_EXPORT AlkOnlineQuotesProfileManager : public QObject
0022 {
0023     Q_OBJECT
0024 public:
0025     ~AlkOnlineQuotesProfileManager();
0026 
0027     void addProfile(AlkOnlineQuotesProfile *profile);
0028     AlkOnlineQuotesProfileList profiles();
0029     AlkOnlineQuotesProfile *profile(const QString &name);
0030     QStringList profileNames();
0031     AlkWebPage *webPage();
0032     void setWebPageEnabled(bool enable);
0033     bool webPageEnabled();
0034 
0035     /**
0036      * Return instance of this class
0037      * @return instance
0038      */
0039     static AlkOnlineQuotesProfileManager &instance();
0040 
0041     /**
0042      * Return pointer to the singleton instance of this class
0043      * @return pointer to instance
0044      */
0045     static AlkOnlineQuotesProfileManager *instancePointer();
0046 
0047 Q_SIGNALS:
0048     /**
0049      * emit quote source for which an update is available
0050      */
0051     void updateAvailable(const QString &profile, const QString &name);
0052 
0053 private:
0054     AlkOnlineQuotesProfileManager();
0055     class Private;
0056     Private *const d;
0057 };
0058 
0059 #endif // ALKONLINEQUOTESPROFILEMANAGER_H