Alkimia API

alkonlinequotesprofile.h
1/*
2 SPDX-FileCopyrightText: 2018 Ralf Habacker ralf.habacker @freenet.de
3
4 This file is part of libalkimia.
5
6 SPDX-License-Identifier: LGPL-2.1-or-later
7*/
8
9#ifndef ALKONLINEQUOTESPROFILE_H
10#define ALKONLINEQUOTESPROFILE_H
11
12#include <alkimia/alk_export.h>
13#include <alkimia/alkonlinequotesource.h>
14
15#include <KSharedConfig>
16
17#include <QMap>
18#include <QObject>
19#include <QString>
20
22class AlkOnlineQuotesProfileManager;
23
24class ALK_EXPORT AlkOnlineQuotesProfile : public QObject
25{
26 Q_OBJECT
27public:
29 enum class Type {
30 Undefined, None, Alkimia4, Alkimia5, KMyMoney4, KMyMoney5, Skrooge4, Skrooge5, Script, Test
31 };
32 explicit AlkOnlineQuotesProfile(const QString &name = "alkimia", Type type = Type::None,
33 const QString &ghnsConfigFile = QString());
34 ~AlkOnlineQuotesProfile();
35
36 QString name() const;
37 QString hotNewStuffConfigFile() const;
38 QString hotNewStuffRelPath() const;
39 QStringList hotNewStuffReadPath() const;
40 QString hotNewStuffWriteDir() const;
41 QString hotNewStuffReadFilePath(const QString &fileName) const;
42 QString hotNewStuffWriteFilePath(const QString &fileName) const;
43 QString kConfigFile() const;
44 void setManager(AlkOnlineQuotesProfileManager *manager);
45 AlkOnlineQuotesProfileManager *manager();
46
47 KSharedConfigPtr kConfig() const;
48 void setKConfig(KSharedConfigPtr kconfig);
49
50 /**
51 * Check if the profile is supported (build) by Alkimia
52 *
53 * @returns @c true if support is compiled, @c false otherwise.
54 */
55 bool typeIsSupported() const;
56
57 /**
58 * Check if the profile is functional
59 *
60 * @returns @c true if support is available, @c false otherwise.
61 */
62 bool typeIsOperational() const;
63
64 Type type();
65 bool hasGHNSSupport();
66
67 /**
68 * return available default sources of this profile
69 */
70 const Map defaultQuoteSources();
71
72 /**
73 * return available sources of this profile
74 */
75 const QStringList quoteSources();
76
77 /**
78 * return testing sources from this profile
79 */
80 const Map quoteSourcesTesting();
81
82 QString scriptPath();
83
84 QString GHNSId(const QString &name) const;
85 QString GHNSFilePath(const QString &name) const;
86 QString GHNSName(const QString &id) const;
87
88 void reload();
89
91 /**
92 * emit quote source for which an update is available
93 */
94 void updateAvailable(const QString &profile, const QString &name);
95
96 /**
97 * emit that the sources from this profile has been changed
98 */
99 void sourcesChanged();
100
101private:
102 class Private;
103 Private *const d;
104};
105
106#endif // ALKONLINEQUOTESPROFILE_H
Type type(const QSqlDatabase &db)
QString name(StandardAction id)
const QList< QKeySequence > & reload()
Q_SIGNALSQ_SIGNALS
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:01:13 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.